def test_spaces_are_trimmed(self): """Spaces at the beggining or end of the XRI are removed""" validator = XRI() self.assertEqual(validator.to_python(' =Gustavo '), '=Gustavo')
def test_schema_is_added_if_asked(self): """The schema must be added to an XRI if explicitly asked""" validator = XRI(True) self.assertEqual(validator.to_python('=Gustavo'), 'xri://=Gustavo')
def test_schema_not_added_if_not_asked(self): """The schema must not be added to an XRI unless explicitly asked""" validator = XRI() self.assertEqual(validator.to_python('=Gustavo'), '=Gustavo')
def test_valid_iname_with_schema(self): """XRIs may have their schema in the beggining""" validator = XRI() self.assertEqual(validator.to_python('xri://=Gustavo'), 'xri://=Gustavo')