diff --git a/tests/unit/db_annotations/test_collection.py b/tests/unit/db_annotations/test_collection.py index 9d32f42af..3e15150e1 100644 --- a/tests/unit/db_annotations/test_collection.py +++ b/tests/unit/db_annotations/test_collection.py @@ -9,6 +9,10 @@ def test_add_update_delete_collection(firestore_emulator, collections_db): old_user = "john_doe" old_name = "test_collection0" _id = collection.add_collection(old_name, old_user, "this is a test") + + with pytest.raises(KeyError): + collection.add_collection(old_name, old_user, "this is a test") + _collection = collection.read_collection(_id) assert _collection["name"] == old_name assert _collection["created_by"] == old_user diff --git a/tests/unit/db_annotations/test_layer_group.py b/tests/unit/db_annotations/test_layer_group.py index 6d96c1e77..abf366a29 100644 --- a/tests/unit/db_annotations/test_layer_group.py +++ b/tests/unit/db_annotations/test_layer_group.py @@ -24,6 +24,16 @@ def test_add_update_delete_layer_group(firestore_emulator, layer_groups_db): layers=layers_ids, comment="this is a test", ) + + with pytest.raises(KeyError): + layer_group.add_layer_group( + name=old_name, + collection_id=collection_id, + user=user, + layers=layers_ids, + comment="this is a test", + ) + _layer_group = layer_group.read_layer_group(_id) assert _layer_group["name"] == old_name assert len(cast(list, _layer_group["layers"])) == 2