-
Notifications
You must be signed in to change notification settings - Fork 0
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
newSpecFile should update scan_id if provided #307
Conversation
prjemian
commented
Jun 12, 2024
- close BUG: newSpecFile() does not reset the scan ID #271
Pull Request Test Coverage Report for Build 9490632653Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9490687156Details
💛 - Coveralls |
Had to make a function that searched for the |
def test_issue_271(scan_id, tempdir): | ||
"""newSpecFile("title", scan_id=1) did not reset scan id.""" | ||
found_RE = RE_finder() # Won't find the one in this module's globals() | ||
assert found_RE is None | ||
|
||
RE = RunEngine() # define for this function, so it can be found | ||
found_RE = RE_finder() | ||
assert found_RE is not None | ||
assert found_RE == RE | ||
|
||
assert isinstance(scan_id, int) | ||
assert tempdir.exists() | ||
os.chdir(tempdir) # newSpecFile() works in pwd | ||
|
||
RE.md["scan_id"] = INITIAL_SCAN_ID | ||
assert RE.md["scan_id"] == INITIAL_SCAN_ID | ||
|
||
newSpecFile("title", scan_id=scan_id, RE=RE) | ||
assert RE.md["scan_id"] != INITIAL_SCAN_ID | ||
assert RE.md["scan_id"] == scan_id | ||
|
||
# repeat, without passing RE as parameter | ||
RE.md["scan_id"] = INITIAL_SCAN_ID | ||
assert RE.md["scan_id"] == INITIAL_SCAN_ID | ||
|
||
newSpecFile("title", scan_id=scan_id) | ||
assert RE.md["scan_id"] != INITIAL_SCAN_ID | ||
assert RE.md["scan_id"] == scan_id | ||
|
||
|
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.
Good testing!
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.
Solve conflicts in .rst file and we should be ok
Pull Request Test Coverage Report for Build 9506629724Details
💛 - Coveralls |