コード例 #1
0
 def test_diff_value_diff_id_not_equal(self):
     """
     Test that two SimpleProperty with the same name have the same identifier()
     """
     do = DataObject(ident=R.URIRef("http://example.org"))
     do1 = DataObject(ident=R.URIRef("http://example.org"))
     c = DataObject.DatatypeProperty("boots", do)
     c1 = DataObject.DatatypeProperty("boots", do1)
     do.boots('join')
     do1.boots('partition')
     self.assertNotEqual(c.identifier(), c1.identifier())
コード例 #2
0
 def test_same_value_same_id_not_empty_object_property(self):
     """
     Test that two SimpleProperty with the same name have the same identifier()
     """
     do = DataObject(ident=R.URIRef("http://example.org"))
     do1 = DataObject(ident=R.URIRef("http://example.org"))
     dz = DataObject(ident=R.URIRef("http://example.org/vip"))
     dz1 = DataObject(ident=R.URIRef("http://example.org/vip"))
     c = DataObject.ObjectProperty("boots", do)
     c1 = DataObject.ObjectProperty("boots", do1)
     do.boots(dz)
     do1.boots(dz1)
     self.assertEqual(c.identifier(), c1.identifier())
コード例 #3
0
    def test_object_property_diff_value_insert_order_same_id(self):
        """
        Test that two SimpleProperty with the same name have the same identifier()
        """
        do = DataObject(ident=R.URIRef("http://example.org"))
        do1 = DataObject(ident=R.URIRef("http://example.org"))

        oa = DataObject(ident=R.URIRef("http://example.org/a"))
        ob = DataObject(ident=R.URIRef("http://example.org/b"))
        oc = DataObject(ident=R.URIRef("http://example.org/c"))

        c = DataObject.ObjectProperty("boots", do, multiple=True)
        c1 = DataObject.ObjectProperty("boots", do1, multiple=True)

        do.boots(oa)
        do.boots(ob)
        do.boots(oc)

        do1.boots(oc)
        do1.boots(oa)
        do1.boots(ob)

        self.assertEqual(c.identifier(), c1.identifier())
コード例 #4
0
    def test_diff_value_insert_order_same_id(self):
        """
        Test that two SimpleProperty with the same name have the same identifier()
        """
        do = DataObject(ident=R.URIRef("http://example.org"))
        do1 = DataObject(ident=R.URIRef("http://example.org"))

        c = DataObject.DatatypeProperty("boots", do, multiple=True)
        c1 = DataObject.DatatypeProperty("boots", do1, multiple=True)
        do.boots('join')
        do.boots('simile')
        do.boots('partition')
        do1.boots('partition')
        do1.boots('join')
        do1.boots('simile')
        self.assertEqual(c.identifier(), c1.identifier())