Skip to content
Snippets Groups Projects
Commit f4a28e0e authored by Manuel Günther's avatar Manuel Günther
Browse files

Fixed exception message

parent a74a5f29
Branches
Tags
No related merge requests found
...@@ -47,7 +47,7 @@ def main(command_line_options = None): ...@@ -47,7 +47,7 @@ def main(command_line_options = None):
# assert the the version file is there # assert the the version file is there
version_file = 'version.txt' version_file = 'version.txt'
if not os.path.exists(version_file): if not os.path.exists(version_file):
raise ValueError("Could not find the file '%s' containing the version number. Are you inside the root directory of your package?") raise ValueError("Could not find the file '%s' containing the version number. Are you inside the root directory of your package?" % version_file)
def run_commands(version, *calls): def run_commands(version, *calls):
"""Updates the version.txt to the given version and runs the given commands.""" """Updates the version.txt to the given version and runs the given commands."""
......
...@@ -18,10 +18,12 @@ def test_new_version(): ...@@ -18,10 +18,12 @@ def test_new_version():
# test the script using the dry-run option (to avoid to actually tag and push code) # test the script using the dry-run option (to avoid to actually tag and push code)
# assert that it does not raise an exception, when both latest and stable version are specified # assert that it does not raise an exception, when both latest and stable version are specified
new_version(['--dry-run', '--stable-version', '20.7.0', '--latest-version', '20.8.0']) if os.path.exists("version.txt"):
new_version(['--dry-run', '--stable-version', '20.7.0', '--latest-version', '20.8.0'])
# assert that it does not raise an exception, when only the latest version is specified # assert that it does not raise an exception, when only the latest version is specified
new_version(['--dry-run', '--latest-version', '20.8.0']) if os.path.exists("version.txt"):
new_version(['--dry-run', '--latest-version', '20.8.0'])
# assert that it does raise an exception, when the latest version is too low # assert that it does raise an exception, when the latest version is too low
nose.tools.assert_raises(ValueError, new_version, ['--dry-run', '--latest-version', '0.8.0']) nose.tools.assert_raises(ValueError, new_version, ['--dry-run', '--latest-version', '0.8.0'])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment