-
Notifications
You must be signed in to change notification settings - Fork 147
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
WIP: JSON enrollment importer #2187
base: main
Are you sure you want to change the base?
WIP: JSON enrollment importer #2187
Conversation
6f2f53a
to
cc0f045
Compare
with TemporaryDirectory() as temp_dir: | ||
test_filename = os.path.join(temp_dir, "test.json") | ||
with open(test_filename, "w", encoding="utf-8") as f: | ||
f.write(EXAMPLE_JSON) | ||
call_command("json_import", self.semester.id, test_filename, stdout=output) | ||
|
||
mock_import_json.assert_called_once_with(EXAMPLE_JSON) |
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.
I'd rather not make this physically go to disk, there is so much that can go wrong here (read-only filesystem, we may leave garbage on the disk, ...).
Can we just mock away all the filesystem access here?
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.
not yet manually tested, because test data doesn't import (course = self.course_map[event["relatedevents"]["gguid"]] KeyError: '0x6'
)
If possible, we should remove the debug info text from the log email |
Done. |
No description provided.