Skip to content

Commit

Permalink
test: Fix CLI error expectations
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Apr 20, 2024
1 parent 6b5bae7 commit 1d1222f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
10 changes: 5 additions & 5 deletions process/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,11 @@ def destroy(self, request, pk=None):
200: {
"type": "object",
"properties": {
"ocid_prefix": {},
"published_from": {},
"published_to": {},
"license": {},
"publication_policy": {},
"ocid_prefix": {"type": "string"},
"published_from": {"type": "string"},
"published_to": {"type": "string"},
"license": {"type": "string"},
"publication_policy": {"type": "string"},
},
}
}
Expand Down
5 changes: 2 additions & 3 deletions tests/commands/test_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@ def test_missing_args(self):
with self.assertRaises(CommandError) as e:
call_command("load", path("file.json"))

message = "Please indicate collection source (using --source and --note and, optionally, --time and --sample)"
self.assertEqual(str(e.exception), message)
self.assertEqual(str(e.exception), "Error: the following arguments are required: -s/--source, -n/--note")

def test_missing_note(self):
with self.assertRaises(CommandError) as e:
call_command("load", "--source", "france", path("file.json"))

self.assertEqual(str(e.exception), "You must add a note (using --note) when loading into a new collection")
self.assertEqual(str(e.exception), "Error: the following arguments are required: -n/--note")

def test_collection_deleted_at(self):
source = collection(deleted_at="2001-01-01 00:00:00")
Expand Down

0 comments on commit 1d1222f

Please sign in to comment.