Skip to content

Commit

Permalink
Renaming the config_parser to config_parser_json
Browse files Browse the repository at this point in the history
This is to avoid the problem in case someone thinks this is configparser (.ini) from official python library.
  • Loading branch information
Letme committed Mar 26, 2018
1 parent be43cc1 commit 114df92
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/mlx/warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __init__(self, sphinx = False, doxygen = False, junit = False, verbose = Fal
if configfile is not None:
with open(configfile, 'r') as f:
config = json.load(f)
self.config_parser(config)
self.config_parser_json(config)
else:
if sphinx:
self.activate_checker(SphinxChecker(self.verbose))
Expand Down Expand Up @@ -154,7 +154,7 @@ def toggle_printout(self, printout):
'''
self.printout = printout

def config_parser(self, config):
def config_parser_json(self, config):
''' Parsing configuration dict extracted by previously opened json file
Args:
Expand Down
26 changes: 13 additions & 13 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_partial_sphinx_config_parsing(self):
}
}

warnings.config_parser(tmpjson)
warnings.config_parser_json(tmpjson)
warnings.check('testfile.c:6: warning: group test: ignoring title "Some test functions" that does not match old title "Some freaky test functions"')
self.assertEqual(warnings.return_count(), 0)
with open('tests/junit_single_fail.xml', 'r') as xmlfile:
Expand All @@ -44,7 +44,7 @@ def test_partial_doxygen_config_parsing(self):
}
}

warnings.config_parser(tmpjson)
warnings.config_parser_json(tmpjson)
with open('tests/junit_single_fail.xml', 'r') as xmlfile:
warnings.check(xmlfile.read())
self.assertEqual(warnings.return_count(), 0)
Expand All @@ -63,7 +63,7 @@ def test_partial_junit_config_parsing(self):
}
}

warnings.config_parser(tmpjson)
warnings.config_parser_json(tmpjson)
warnings.check("/home/bljah/test/index.rst:5: WARNING: toctree contains reference to nonexisting document u'installation'")
self.assertEqual(warnings.return_count(), 0)
warnings.check('testfile.c:6: warning: group test: ignoring title "Some test functions" that does not match old title "Some freaky test functions"')
Expand All @@ -87,7 +87,7 @@ def test_doxy_junit_options_config_parsing(self):
}

}
warnings.config_parser(tmpjson)
warnings.config_parser_json(tmpjson)
warnings.check("/home/bljah/test/index.rst:5: WARNING: toctree contains reference to nonexisting document u'installation'")
self.assertEqual(warnings.return_count(), 0)
warnings.check('testfile.c:6: warning: group test: ignoring title "Some test functions" that does not match old title "Some freaky test functions"')
Expand All @@ -111,7 +111,7 @@ def test_sphinx_doxy_config_parsing(self):
}
}

warnings.config_parser(tmpjson)
warnings.config_parser_json(tmpjson)
with open('tests/junit_single_fail.xml', 'r') as xmlfile:
warnings.check(xmlfile.read())
self.assertEqual(warnings.return_count(), 0)
Expand All @@ -137,7 +137,7 @@ def test_sphinx_config_max(self):
}
}

warnings.config_parser(tmpjson)
warnings.config_parser_json(tmpjson)
self.assertEqual(warnings.get_checker(SphinxChecker().name).get_maximum(), 5)

def test_doxygen_config_max(self):
Expand All @@ -150,7 +150,7 @@ def test_doxygen_config_max(self):
}
}

warnings.config_parser(tmpjson)
warnings.config_parser_json(tmpjson)
self.assertEqual(warnings.get_checker(DoxyChecker().name).get_maximum(), 5)

def test_junit_config_max(self):
Expand All @@ -163,7 +163,7 @@ def test_junit_config_max(self):
}
}

warnings.config_parser(tmpjson)
warnings.config_parser_json(tmpjson)
self.assertEqual(warnings.get_checker(JUnitChecker().name).get_maximum(), 5)

def test_all_config_max(self):
Expand All @@ -186,7 +186,7 @@ def test_all_config_max(self):
}
}

warnings.config_parser(tmpjson)
warnings.config_parser_json(tmpjson)
self.assertEqual(warnings.get_checker(SphinxChecker().name).get_maximum(), 4)
self.assertEqual(warnings.get_checker(DoxyChecker().name).get_maximum(), 5)
self.assertEqual(warnings.get_checker(JUnitChecker().name).get_maximum(), 6)
Expand All @@ -201,7 +201,7 @@ def test_sphinx_config_min(self):
}
}

warnings.config_parser(tmpjson)
warnings.config_parser_json(tmpjson)
self.assertEqual(warnings.get_checker(SphinxChecker().name).get_minimum(), 5)

def test_doxygen_config_min(self):
Expand All @@ -214,7 +214,7 @@ def test_doxygen_config_min(self):
}
}

warnings.config_parser(tmpjson)
warnings.config_parser_json(tmpjson)
self.assertEqual(warnings.get_checker(DoxyChecker().name).get_minimum(), 5)

def test_junit_config_min(self):
Expand All @@ -227,7 +227,7 @@ def test_junit_config_min(self):
}
}

warnings.config_parser(tmpjson)
warnings.config_parser_json(tmpjson)
self.assertEqual(warnings.get_checker(JUnitChecker().name).get_minimum(), 5)

def test_all_config_min(self):
Expand All @@ -250,7 +250,7 @@ def test_all_config_min(self):
}
}

warnings.config_parser(tmpjson)
warnings.config_parser_json(tmpjson)
self.assertEqual(warnings.get_checker(SphinxChecker().name).get_minimum(), 4)
self.assertEqual(warnings.get_checker(DoxyChecker().name).get_minimum(), 3)
self.assertEqual(warnings.get_checker(JUnitChecker().name).get_minimum(), 5)
Expand Down

0 comments on commit 114df92

Please sign in to comment.