def test_make_it(self): sot = zone.Zone(**EXAMPLE) self.assertEqual(IDENTIFIER, sot.id) self.assertEqual(EXAMPLE['email'], sot.email) self.assertEqual(EXAMPLE['description'], sot.description) self.assertEqual(EXAMPLE['ttl'], sot.ttl) self.assertEqual(EXAMPLE['type'], sot.type) self.assertEqual(EXAMPLE['name'], sot.name) self.assertEqual(EXAMPLE['status'], sot.status)
def test_basic(self): obj = zone.Zone() self.assertEqual("/zones", obj.base_path) self.assertEqual("zone", obj.resource_key) self.assertEqual("zones", obj.resources_key) self.assertTrue(obj.allow_get) self.assertTrue(obj.allow_list) self.assertTrue(obj.allow_delete) self.assertTrue(obj.allow_create) self.assertEqual("dns", obj.service.service_type)
def test_make_it(self): obj = zone.Zone(**DATA) self.assertEqual(DATA["name"], obj.name) self.assertEqual(DATA["id"], obj.id) self.assertEqual(DATA["description"], obj.description) self.assertEqual(DATA["email"], obj.email) self.assertEqual(DATA["ttl"], obj.ttl) self.assertEqual(DATA["serial"], obj.serial) self.assertEqual(DATA["masters"], obj.masters) self.assertEqual(DATA["status"], obj.status) self.assertEqual(DATA["links"], obj.links) self.assertEqual(DATA["pool_id"], obj.pool_id) self.assertEqual(DATA["project_id"], obj.project_id) self.assertEqual(DATA["updated_at"], obj.updated_at) self.assertEqual(DATA["created_at"], obj.created_at) self.assertEqual(DATA["zone_type"], obj.zone_type) self.assertEqual(DATA["tags"], obj.tags) self.assertEqual(DATA["record_num"], obj.record_num) self.assertEqual(DATA["tags"], obj.tags)
def test_basic(self): sot = zone.Zone() self.assertEqual(None, sot.resource_key) self.assertEqual('zones', sot.resources_key) self.assertEqual('/zones', sot.base_path) self.assertTrue(sot.allow_list) self.assertTrue(sot.allow_create) self.assertTrue(sot.allow_fetch) self.assertTrue(sot.allow_commit) self.assertTrue(sot.allow_delete) self.assertEqual('PATCH', sot.commit_method) self.assertDictEqual( { 'description': 'description', 'email': 'email', 'limit': 'limit', 'marker': 'marker', 'name': 'name', 'status': 'status', 'ttl': 'ttl', 'type': 'type' }, sot._query_mapping._mapping)
def test_delete_recordset_with_instance2(self): self.proxy.delete_recordset(_zone.Zone(id="zone-id"), _recordset.Recordset(id="recordset-id")) self.assert_session_delete("zones/zone-id/recordsets/recordset-id")
def test_delete_zone_with_instance(self): self.proxy.delete_zone(_zone.Zone(id="zone-id")) self.assert_session_delete("zones/zone-id")
def test_abandon(self): sot = zone.Zone(**EXAMPLE) self.assertIsNone(sot.abandon(self.sess)) self.sess.post.assert_called_with('zones/NAME/tasks/abandon', json=None)