def main(): v = AnyURI("http://www.example.com/index1.html") u = URI() u.value = v u.type_ = URI.TYPE_URL print(Observables(u).to_xml())
def main(): v = AnyURI("http://www.example.com/index1.html") v.condition = "Equals" u = URI() u.value = v u.type_ = URI.TYPE_URL print(Observables(u).to_xml(encoding=None))
def test_round_trip(self): uri_str = "http://www.example.com" t = URI.TYPE_URL uri = URI(AnyURI(uri_str), t) uri2 = cybox.test.round_trip(uri) self.assertEqual(uri.to_dict(), uri2.to_dict()) self.assertEqual(uri_str, str(uri2)) self.assertEqual(t, uri2.type_)
def main(): NS = cybox.utils.Namespace("http://example.com/", "example") cybox.utils.set_id_namespace(NS) v = AnyURI("http://www.example.com/index1.html") u = URI() u.value = v u.type_ = URI.TYPE_URL print Observables(u).to_xml()