Skip to content

Commit

Permalink
add no key errors test
Browse files Browse the repository at this point in the history
  • Loading branch information
JJ11teen committed May 16, 2021
1 parent 67f4e0f commit 478d583
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/tests/2_singlecloudmapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ def test_non_byte_values_error(self, storage_provider: StorageProvider, test_id:
with pytest.raises(ValueError, match="must be bytes like"):
cm[key] = {"or": "something more", "elaborate": True}

def test_no_key_errors(self, storage_provider: StorageProvider, test_id: str):
cm = CloudMapping(storageprovider=storage_provider)
key = test_id + "/no-key-errors-test"

with pytest.raises(KeyError):
cm[key]
with pytest.raises(KeyError):
del cm[key]
assert key not in cm

def test_basic_setting_and_getting(self, storage_provider: StorageProvider, test_id: str):
cm = CloudMapping(storageprovider=storage_provider)

Expand Down

0 comments on commit 478d583

Please sign in to comment.