Ejemplo n.º 1
0
    def test__RDAPEntity(self):

        self.assertRaises(InvalidEntityObject, _RDAPEntity, 'abc')

        ent = _RDAPEntity({'abc': 'def'})
        self.assertRaises(InvalidEntityObject, ent.parse)

        data_dir = path.dirname(__file__)

        with io.open(str(data_dir) + '/entity.json', 'r') as data_file:
            data = json.load(data_file)

        ent = _RDAPEntity(data)
        ent.parse()
Ejemplo n.º 2
0
    def test__RDAPEntity(self):

        self.assertRaises(InvalidEntityObject, _RDAPEntity, 'abc')

        ent = _RDAPEntity({'abc': 'def'})
        self.assertRaises(InvalidEntityObject, ent.parse)

        data_dir = path.dirname(__file__)

        with io.open(str(data_dir) + '/entity.json', 'r') as data_file:
            data = json.load(data_file)

        ent = _RDAPEntity(data)
        ent.parse()

        tmp = data
        del tmp['vcardArray']
        ent = _RDAPEntity(tmp)
        ent.parse()

        tmp = data
        del tmp['notices'][0]['description']
        ent = _RDAPEntity(tmp)
        ent.parse()
Ejemplo n.º 3
0
    def test__RDAPEntity(self):

        self.assertRaises(InvalidEntityObject, _RDAPEntity, 'abc')

        ent = _RDAPEntity({'abc': 'def'})
        self.assertRaises(InvalidEntityObject, ent.parse)

        data_dir = path.dirname(__file__)

        with io.open(str(data_dir) + '/entity.json', 'r') as data_file:
            data = json.load(data_file)

        ent = _RDAPEntity(data)
        ent.parse()

        tmp = data
        del tmp['vcardArray']
        ent = _RDAPEntity(tmp)
        ent.parse()

        tmp = data
        del tmp['notices'][0]['description']
        ent = _RDAPEntity(tmp)
        ent.parse()