def test_equals(self): metadata = Metadata() for key, value in self._DEFAULT_DATA: metadata.add(key, value) metadata2 = Metadata(*self._DEFAULT_DATA) self.assertEqual(metadata, metadata2) self.assertNotEqual(metadata, "foo")
def test_add_value(self): metadata = Metadata() metadata.add("key", "value") metadata.add("key", "second value") metadata.add("key2", "value2") self.assertEqual(metadata["key"], "value") self.assertEqual(metadata["key2"], "value2")