Closed Mogeng closed 7 years ago
Looks great! Thanks for adding this. A couple comments below.
And a note on the title: in general we want the title of the pull request to be as descriptive as possible because it will become the commit message in the commit logs. We want others looking back at the commit history to understand which changes are where. So a little bit more info in the title could help, eg "Add support for versioning to config files"
PS I'm not sure why coveralls is showing your coverage as going down. That seems wrong. I wouldn't pay much attention to it :)
Review status: 0 of 3 files reviewed at latest revision, 2 unresolved discussions, some commit checks failed.
doppelganger/config.py, line 52 at r1 (raw file):
assert 'version' in config_json, 'config_json has no key named version' assert config_json['version'] == CURRENT_VERSION, 'config_json version not current'
Since the user will be seeing these error messages and won't have access to the code, let's try to make them as understandable to a user who hasn't read the code. Here are suggestions:
"The config file is missing a 'version' field"
and
"The config file version is incorrect. Please upgrade your config file to version {}.".format(CURRENT_VERSION)
test/test_config.py, line 50 at r1 (raw file):
config_json = self._mock_config_files() config_json['version'] = '1' self.assertRaises(AssertionError, Configuration.from_json, config_json)
Awesome, great tests!
Can you add a test where the creation of a config succeeds?
Comments from Reviewable
Changed the commit title to "Updated support for versioning to config files, error message more clear and added a success test case."
Review status: 0 of 3 files reviewed at latest revision, 2 unresolved discussions.
doppelganger/config.py, line 52 at r1 (raw file):
Since the user will be seeing these error messages and won't have access to the code, let's try to make them as understandable to a user who hasn't read the code. Here are suggestions: `"The config file is missing a 'version' field"` and `"The config file version is incorrect. Please upgrade your config file to version {}.".format(CURRENT_VERSION)`
Changed the assertion error message more clear and understandable.
test/test_config.py, line 50 at r1 (raw file):
Awesome, great tests! Can you add a test where the creation of a config succeeds?
Added a test case where the correct config_json works.
Comments from Reviewable
Looks good! Did you see my note about change the title of the pull request?
Review status: 0 of 3 files reviewed at latest revision, all discussions resolved.
Comments from Reviewable
Oops, just updated the title of the pull request. Thought it referred to the title of the commit...
Review status: 0 of 3 files reviewed at latest revision, all discussions resolved.
Comments from Reviewable
Great!
Review status: 0 of 3 files reviewed at latest revision, all discussions resolved.
Comments from Reviewable
This change is