コード例 #1
0
 def test_remove_properties(self):
     """Tests whether properties are appropriately
     kept or removed according to the remove_properties
     attribute"""
     rel = Relationship('related')
     x = dict(related=dict(name='name'))
     ret = rel._map_pks(x)
     self.assertDictEqual(ret, dict(name='name'))
     self.assertDictEqual(x, dict())
     rel.remove_properties = False
     x = dict(related=dict(name='name'))
     ret = rel._map_pks(x)
     self.assertDictEqual(ret, dict(name='name'))
     self.assertDictEqual(x, dict(related=dict(name='name')))
コード例 #2
0
ファイル: relationship.py プロジェクト: ootwch/ripozo
 def test_remove_properties(self):
     """Tests whether properties are appropriately
     kept or removed according to the remove_properties
     attribute"""
     rel = Relationship('related')
     x = dict(related=dict(name='name'))
     ret = rel._map_pks(x)
     self.assertDictEqual(ret, dict(name='name'))
     self.assertDictEqual(x, dict())
     rel.remove_properties = False
     x = dict(related=dict(name='name'))
     ret = rel._map_pks(x)
     self.assertDictEqual(ret, dict(name='name'))
     self.assertDictEqual(x, dict(related=dict(name='name')))
コード例 #3
0
    def test_remove_properties_property_map(self):
        """Tests whether removing properties according
        to the property_map adheres to the remove_properties
        attribute"""

        rel = Relationship('related', property_map=dict(name='name'))
        x = dict(name='name')
        ret = rel._map_pks(x)
        self.assertDictEqual(ret, dict(name='name'))
        self.assertDictEqual(x, dict())
        rel.remove_properties = False
        x = dict(name='name')
        ret = rel._map_pks(x)
        self.assertDictEqual(ret, dict(name='name'))
        self.assertDictEqual(x, dict(name='name'))
コード例 #4
0
ファイル: relationship.py プロジェクト: ootwch/ripozo
    def test_remove_properties_property_map(self):
        """Tests whether removing properties according
        to the property_map adheres to the remove_properties
        attribute"""

        rel = Relationship('related', property_map=dict(name='name'))
        x = dict(name='name')
        ret = rel._map_pks(x)
        self.assertDictEqual(ret, dict(name='name'))
        self.assertDictEqual(x, dict())
        rel.remove_properties = False
        x = dict(name='name')
        ret = rel._map_pks(x)
        self.assertDictEqual(ret, dict(name='name'))
        self.assertDictEqual(x, dict(name='name'))