def test_copy(self): mock_map = mapping.DictionaryCollection({"foo": "bar", "crash": "balloon"}) result = mock_map.copy() assert result == {"foo": "bar", "crash": "balloon"} assert isinstance(result, mapping.DictionaryCollection) assert result is not mock_map
def test___setitem__(self): mock_map = mapping.DictionaryCollection({"hmm": "forearm", "cat": "bag", "ok": "bye"}) mock_map["bye"] = 4 assert mock_map == {"hmm": "forearm", "cat": "bag", "ok": "bye", "bye": 4}
def test___len__(self): mock_map = mapping.DictionaryCollection({"hmm": "blam", "cat": "bag", "ok": "bye"}) assert len(mock_map) == 3
def test____iter__(self): mock_map = mapping.DictionaryCollection({"curiosity": "rover", "cat": "bag", "ok": "bye"}) assert list(mock_map) == ["curiosity", "cat", "ok"]
def test___getitem__(self): mock_map = mapping.DictionaryCollection({"curiosity": "rover", "ok": "bye"}) assert mock_map["ok"] == "bye"
def test___delitem__(self): mock_map = mapping.DictionaryCollection({"hikari": "shinji", "gendo": "san", "screwed": "up"}) del mock_map["hikari"] assert mock_map == {"gendo": "san", "screwed": "up"}
def test_freeze(self): mock_map = mapping.DictionaryCollection({"hikari": "shinji", "gendo": "san"}) result = mock_map.freeze() assert result == {"hikari": "shinji", "gendo": "san"} assert isinstance(result, dict)
def test___init___with_source(self): mock_map = mapping.DictionaryCollection({"o": "NO", "bye": "blam", "foo": "bar"}) assert mock_map == {"o": "NO", "bye": "blam", "foo": "bar"}