Skip to content
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

Draft
wants to merge 25 commits into
base: main
Choose a base branch
from

Conversation

hansegucker
Copy link
Collaborator

No description provided.

@hansegucker hansegucker marked this pull request as draft May 13, 2024 18:17
@richardebeling richardebeling linked an issue May 17, 2024 that may be closed by this pull request
evap/staff/importers/json.py Outdated Show resolved Hide resolved
evap/staff/importers/json.py Outdated Show resolved Hide resolved
evap/staff/importers/json.py Outdated Show resolved Hide resolved
evap/staff/importers/json.py Outdated Show resolved Hide resolved
evap/staff/importers/json.py Outdated Show resolved Hide resolved
evap/staff/tests/test_json_importer.py Outdated Show resolved Hide resolved
evap/staff/tests/test_json_importer.py Outdated Show resolved Hide resolved
evap/staff/importers/json.py Outdated Show resolved Hide resolved
evap/staff/tests/test_json_importer.py Show resolved Hide resolved
evap/staff/tests/test_json_importer.py Outdated Show resolved Hide resolved
evap/staff/management/commands/json_import.py Outdated Show resolved Hide resolved
evap/staff/management/commands/json_import.py Outdated Show resolved Hide resolved
evap/staff/management/commands/json_import.py Outdated Show resolved Hide resolved
evap/staff/tests/test_json_importer.py Outdated Show resolved Hide resolved
evap/staff/tests/test_json_importer.py Show resolved Hide resolved
evap/staff/importers/json.py Show resolved Hide resolved
evap/staff/importers/json.py Outdated Show resolved Hide resolved
evap/staff/importers/json.py Outdated Show resolved Hide resolved
evap/staff/importers/json.py Show resolved Hide resolved
evap/staff/importers/json.py Outdated Show resolved Hide resolved
evap/staff/importers/json.py Outdated Show resolved Hide resolved
evap/staff/importers/json.py Outdated Show resolved Hide resolved
evap/staff/importers/json.py Outdated Show resolved Hide resolved
evap/staff/importers/json.py Outdated Show resolved Hide resolved
evap/staff/importers/json.py Outdated Show resolved Hide resolved
evap/staff/tests/test_json_importer.py Outdated Show resolved Hide resolved
Comment on lines +289 to +295
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)
Copy link
Member

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?

Copy link
Member

@janno42 janno42 left a 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')

evap/staff/log_handler.py Outdated Show resolved Hide resolved
evap/staff/tests/test_json_importer.py Show resolved Hide resolved
evap/staff/tests/test_json_importer.py Outdated Show resolved Hide resolved
evap/staff/importers/json.py Outdated Show resolved Hide resolved
@janno42
Copy link
Member

janno42 commented Jul 29, 2024

If possible, we should remove the debug info text from the log email

@hansegucker
Copy link
Collaborator Author

If possible, we should remove the debug info text from the log email

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

JSON enrollment data importer (v1)
3 participants