Ejemplo n.º 1
0
    def test_create_pool(self):
        fixture = self.useFixture(PoolFixture())
        post_model = fixture.post_model
        created_pool = fixture.created_pool

        self.assertEqual(post_model.name, created_pool.name)
        self.assertEqual(post_model.ns_records, created_pool.ns_records)
Ejemplo n.º 2
0
    def test_update_pool(self):
        old_model = self.useFixture(PoolFixture()).created_pool

        patch_model = datagen.random_pool_data()
        resp, new_model = PoolClient.as_user('admin').patch_pool(
            old_model.id, patch_model)
        self.assertEqual(resp.status, 202)

        resp, model = PoolClient.as_user('admin').get_pool(new_model.id)
        self.assertEqual(resp.status, 200)
        self.assertEqual(new_model.id, old_model.id)
        self.assertEqual(new_model.name, patch_model.name)
Ejemplo n.º 3
0
 def test_delete_pool(self):
     pool = self.useFixture(PoolFixture()).created_pool
     resp, model = PoolClient.as_user('admin').delete_pool(pool.id)
     self.assertEqual(resp.status, 204)
Ejemplo n.º 4
0
 def test_list_pools(self):
     self.useFixture(PoolFixture())
     resp, model = PoolClient.as_user('admin').list_pools()
     self.assertEqual(resp.status, 200)
     self.assertGreater(len(model.pools), 0)
Ejemplo n.º 5
0
 def setUp(self):
     super(PoolTest, self).setUp()
     self.increase_quotas(user='******')
     self.client = PoolClient.as_user('admin', with_token=False)
     self.fixture = self.useFixture(PoolFixture(user='******'))