-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test if mode is unique #184
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lsetiawan this is ready for review now.
I don't know why Travis-CI recycles the id_node
, but the directory is overwritten. Probably some smart disk cache? Dunno...
@@ -89,5 +95,9 @@ def main(): | |||
copytree(_CONFIG, _PRODUCTION, overwrite=overwrite) | |||
|
|||
|
|||
def main(): | |||
args = parse_args() | |||
cli(args) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Factoring the cli
out of main
helps us to create "real user case" tests.
assert os.path.isdir(os.path.join(_directory, 'production_configs')) | ||
args.update({'--mode': 'development'}) | ||
cli(args) | ||
assert not os.path.isdir(os.path.join(_directory, 'production_configs')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sequence of assert
s check if an instance created under production
mode lost the production_configs
when it was overwritten by a second call with development
. This is not an ideal test b/c it test a corner case only, but it works on Windows and we can add additional cases later. (For example, a test that modifies the contents of the config files and see if the expected modification are there, or not, when calling the cli
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great @ocefpaf! Thanks for fixing it 👍
Wow. So many changes on Travis CI side! I guess it keeps us on our toes 😄 |
Thanks. |
@lsetiawan ignore this for a while. I am just testing to see if I can get it to fail.