def test_to_dict(self): meta = Mock() meta.to_dict = Mock(return_value={"test_meta": "dict"}) expected = OrderedDict() expected["value"] = "test_value" expected["meta"] = {"test_meta": "dict"} a = Attribute("test", meta) a.set_value("test_value") self.assertEquals(expected, a.to_dict())
def test_to_dict(self): meta = Mock() meta.to_dict = Mock(return_value = {"test_meta":"dict"}) expected = OrderedDict() expected["value"] = "test_value" expected["meta"] = {"test_meta":"dict"} a = Attribute("test", meta) a.set_value("test_value") self.assertEquals(expected, a.to_dict())
def test_to_dict(self): a = Attribute(StringMeta("desc")) a.set_value("some string") self.assertEqual(a.to_dict(), self.serialized)