-
Notifications
You must be signed in to change notification settings - Fork 4
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
Update test_saveFile.py #26
Conversation
UnitTests/test_saveFile.py
Outdated
@@ -15,17 +15,21 @@ | |||
|
|||
def test_SaveFile(): | |||
|
|||
if (os.path.isfile("/testResults/save.rs9")): | |||
os.remove("/testResults/save.rs9") | |||
savePath = r"\testResults\save.rs9" |
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.
savePath variable is kinda redundant since it is used only once. The bellow looks better to me. Also the string should have forward slashes not backward.
filepath = dirName + "/testResults/save.rs9"
UnitTests/test_saveFile.py
Outdated
savePath = r"\testResults\save.rs9" | ||
filepath = dirName + savePath | ||
|
||
if (os.path.isfile(savePath)): |
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.
The string checked should be filepath not savePath.
UnitTests/test_saveFile.py
Outdated
if (os.path.isfile("/testResults/save.rs9")): | ||
os.remove("/testResults/save.rs9") | ||
savePath = r"\testResults\save.rs9" | ||
filepath = dirName + savePath |
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.
Name of the variable should be in camelCase or snake_case. In this instance filePath.
UnitTests/test_saveFile.py
Outdated
assert os.path.isfile(dirName + "/testResults/save.rs9") | ||
os.remove(dirName + '/testResults/save.rs9') | ||
assert os.path.isfile(filepath) | ||
os.remove(filepath) |
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.
The last line is redundant because you can't check the result of the test afterwards. That is why it is deleted before saving.
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 :ok_hand: :thumbsdown: (Email) |
Description
fixed a problem in the test of the function save model
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist: