Example #1
0
    def test_property_real_name(self):
        obj = AnyAttribute()
        self.assertEqual("any_attributes", obj.real_name)

        obj.namespace = "foo"
        self.assertEqual("foo_attributes", obj.real_name)

        obj.namespace = None
        with self.assertRaises(SchemaValueError):
            obj.real_name
Example #2
0
    def test_property_real_name(self):
        obj = AnyAttribute()
        self.assertEqual("any_attributes", obj.real_name)

        obj.namespace = "foo"
        self.assertEqual("foo_attributes", obj.real_name)

        obj.namespace = "http://www.xsdata.com/somewhere.xsd"
        self.assertEqual("xsdata_com/somewhere_attributes", obj.real_name)

        obj.namespace = "http://foo http://bar"
        self.assertEqual("foo_bar_attributes", obj.real_name)
Example #3
0
    def test_property_raw_namespace(self):
        obj = AnyAttribute()
        self.assertEqual(NamespaceType.ANY.value, obj.raw_namespace)

        obj.namespace = "foo"
        self.assertEqual("foo", obj.raw_namespace)

        obj = AnyAttribute(namespace="    foo  \n    \t  \r  bar foo ")
        self.assertEqual("foo bar", obj.raw_namespace)