def test_node_list_sort_dir(self): self.api = utils.FakeAPI(fake_responses_sorting) self.mgr = node.NodeManager(self.api) nodes = self.mgr.list(sort_dir='desc') expect = [('GET', '/v1/nodes/?sort_dir=desc', {}, None)] self.assertEqual(expect, self.api.calls) self.assertEqual(2, len(nodes))
def test_node_list_limit(self): self.api = utils.FakeAPI(fake_responses_pagination) self.mgr = node.NodeManager(self.api) nodes = self.mgr.list(limit=1) expect = [('GET', '/v1/nodes/?limit=1', {}, None)] self.assertEqual(expect, self.api.calls) self.assertThat(nodes, HasLength(1))
def test_ports_list_sort_dir(self): self.api = utils.FakeAPI(fake_responses_sorting) self.mgr = ironicclient.v1.port.PortManager(self.api) ports = self.mgr.list(sort_dir='desc') expect = [('GET', '/v1/ports/?sort_dir=desc', {}, None)] self.assertEqual(expect, self.api.calls) self.assertEqual(2, len(ports))
def test_node_list_marker(self): self.api = utils.FakeAPI(fake_responses_pagination) self.mgr = node.NodeManager(self.api) nodes = self.mgr.list(marker=NODE1['uuid']) expect = [('GET', '/v1/nodes/?marker=%s' % NODE1['uuid'], {}, None)] self.assertEqual(expect, self.api.calls) self.assertThat(nodes, HasLength(1))
def test_deploy_templates_list_sort_dir(self): self.api = utils.FakeAPI(fake_responses_sorting) self.mgr = ironicclient.v1.deploy_template.DeployTemplateManager( self.api) deploy_templates = self.mgr.list(sort_dir='desc') expect = [('GET', '/v1/deploy_templates/?sort_dir=desc', {}, None)] self.assertEqual(expect, self.api.calls) self.assertEqual(2, len(deploy_templates))
def test_chassis_list_pagination_no_limit(self): self.api = utils.FakeAPI(fake_responses_pagination) self.mgr = ironicclient.v1.chassis.ChassisManager(self.api) chassis = self.mgr.list(limit=0) expect = [('GET', '/v1/chassis', {}, None), ('GET', '/v1/chassis/?limit=1', {}, None)] self.assertEqual(expect, self.api.calls) self.assertThat(chassis, HasLength(2))
def test_node_list_pagination_no_limit(self): self.api = utils.FakeAPI(fake_responses_pagination) self.mgr = node.NodeManager(self.api) nodes = self.mgr.list(limit=0) expect = [('GET', '/v1/nodes', {}, None), ('GET', '/v1/nodes/?limit=1', {}, None)] self.assertEqual(expect, self.api.calls) self.assertEqual(2, len(nodes))
def test_conductor_list_limit(self): self.api = utils.FakeAPI(fake_responses_pagination) self.mgr = conductor.ConductorManager(self.api) conductors = self.mgr.list(limit=1) expect = [ ('GET', '/v1/conductors/?limit=1', {}, None) ] self.assertEqual(expect, self.api.calls) self.assertThat(conductors, HasLength(1))
def test_deploy_templates_list_pagination_no_limit(self): self.api = utils.FakeAPI(fake_responses_pagination) self.mgr = ironicclient.v1.deploy_template.DeployTemplateManager( self.api) deploy_templates = self.mgr.list(limit=0) expect = [('GET', '/v1/deploy_templates', {}, None), ('GET', '/v1/deploy_templates/?limit=1', {}, None)] self.assertEqual(expect, self.api.calls) self.assertThat(deploy_templates, HasLength(2))
def test_chassis_list_marker(self): self.api = utils.FakeAPI(fake_responses_pagination) self.mgr = ironicclient.v1.chassis.ChassisManager(self.api) chassis = self.mgr.list(marker=CHASSIS['uuid']) expect = [ ('GET', '/v1/chassis/?marker=%s' % CHASSIS['uuid'], {}, None), ] self.assertEqual(expect, self.api.calls) self.assertThat(chassis, HasLength(1))
def test_conductor_list_sort_dir(self): self.api = utils.FakeAPI(fake_responses_sorting) self.mgr = conductor.ConductorManager(self.api) conductors = self.mgr.list(sort_dir='desc') expect = [ ('GET', '/v1/conductors/?sort_dir=desc', {}, None) ] self.assertEqual(expect, self.api.calls) self.assertEqual(2, len(conductors))
def test_ports_list_limit(self): self.api = utils.FakeAPI(fake_responses_pagination) self.mgr = ironicclient.v1.port.PortManager(self.api) ports = self.mgr.list(limit=1) expect = [ ('GET', '/v1/ports/?limit=1', {}, None), ] self.assertEqual(expect, self.api.calls) self.assertThat(ports, HasLength(1))
def test_chassis_list_sort_dir(self): self.api = utils.FakeAPI(fake_responses_sorting) self.mgr = ironicclient.v1.chassis.ChassisManager(self.api) chassis = self.mgr.list(sort_dir='desc') expect = [ ('GET', '/v1/chassis/?sort_dir=desc', {}, None), ] self.assertEqual(expect, self.api.calls) self.assertThat(chassis, HasLength(1))
def test_ports_list_marker(self): self.api = utils.FakeAPI(fake_responses_pagination) self.mgr = ironicclient.v1.port.PortManager(self.api) ports = self.mgr.list(marker=PORT['uuid']) expect = [ ('GET', '/v1/ports/?marker=%s' % PORT['uuid'], {}, None), ] self.assertEqual(expect, self.api.calls) self.assertThat(ports, HasLength(1))
def test_node_port_list_marker(self): self.api = utils.FakeAPI(fake_responses_pagination) self.mgr = node.NodeManager(self.api) ports = self.mgr.list_ports(NODE1['uuid'], marker=PORT['uuid']) expect = [ ('GET', '/v1/nodes/%s/ports?marker=%s' % (NODE1['uuid'], PORT['uuid']), {}, None), ] self.assertEqual(expect, self.api.calls) self.assertThat(ports, HasLength(1))
def test_conductor_list_pagination_no_limit(self): self.api = utils.FakeAPI(fake_responses_pagination) self.mgr = conductor.ConductorManager(self.api) conductors = self.mgr.list(limit=0) expect = [ ('GET', '/v1/conductors', {}, None), ('GET', '/v1/conductors/?limit=1', {}, None) ] self.assertEqual(expect, self.api.calls) self.assertEqual(2, len(conductors))
def test_conductor_list_marker(self): self.api = utils.FakeAPI(fake_responses_pagination) self.mgr = conductor.ConductorManager(self.api) conductors = self.mgr.list(marker=CONDUCTOR1['hostname']) expect = [ ('GET', '/v1/conductors/?marker=%s' % CONDUCTOR1['hostname'], {}, None) ] self.assertEqual(expect, self.api.calls) self.assertThat(conductors, HasLength(1))
def test_chassis_node_list_sort_dir(self): self.api = utils.FakeAPI(fake_responses_sorting) self.mgr = ironicclient.v1.chassis.ChassisManager(self.api) nodes = self.mgr.list_nodes(CHASSIS['uuid'], sort_dir='desc') expect = [ ('GET', '/v1/chassis/%s/nodes?sort_dir=desc' % CHASSIS['uuid'], {}, None), ] self.assertEqual(expect, self.api.calls) self.assertThat(nodes, HasLength(1)) self.assertEqual(NODE['uuid'], nodes[0].uuid)
def test_node_port_list_limit(self): self.api = utils.FakeAPI(fake_responses_pagination) self.mgr = node.NodeManager(self.api) ports = self.mgr.list_ports(NODE1['uuid'], limit=1) expect = [ ('GET', '/v1/nodes/%s/ports?limit=1' % NODE1['uuid'], {}, None), ] self.assertEqual(expect, self.api.calls) self.assertThat(ports, HasLength(1)) self.assertEqual(PORT['uuid'], ports[0].uuid) self.assertEqual(PORT['address'], ports[0].address)
def test_chassis_node_list_marker(self): self.api = utils.FakeAPI(fake_responses_pagination) self.mgr = ironicclient.v1.chassis.ChassisManager(self.api) nodes = self.mgr.list_nodes(CHASSIS['uuid'], marker=NODE['uuid']) expect = [ ('GET', '/v1/chassis/%s/nodes?marker=%s' % (CHASSIS['uuid'], NODE['uuid']), {}, None), ] self.assertEqual(expect, self.api.calls) self.assertThat(nodes, HasLength(1)) self.assertEqual(NODE['uuid'], nodes[0].uuid)
def test_node_port_list_sort_key(self): self.api = utils.FakeAPI(fake_responses_sorting) self.mgr = node.NodeManager(self.api) ports = self.mgr.list_ports(NODE1['uuid'], sort_key='updated_at') expect = [ ('GET', '/v1/nodes/%s/ports?sort_key=updated_at' % NODE1['uuid'], {}, None), ] self.assertEqual(expect, self.api.calls) self.assertThat(ports, HasLength(1)) self.assertEqual(PORT['uuid'], ports[0].uuid) self.assertEqual(PORT['address'], ports[0].address)
def test_deploy_templates_list_marker(self): self.api = utils.FakeAPI(fake_responses_pagination) self.mgr = ironicclient.v1.deploy_template.DeployTemplateManager( self.api) deploy_templates = self.mgr.list(marker=DEPLOY_TEMPLATE['uuid']) expect = [ ('GET', '/v1/deploy_templates/?marker=%s' % DEPLOY_TEMPLATE['uuid'], {}, None), ] self.assertEqual(expect, self.api.calls) self.assertThat(deploy_templates, HasLength(1))
def setUp(self): super(NodeManagerTest, self).setUp() self.api = utils.FakeAPI(fake_responses) self.mgr = node.NodeManager(self.api)
def setUp(self): super(DriverManagerTest, self).setUp() self.api = utils.FakeAPI(fake_responses) self.mgr = driver.DriverManager(self.api)
def setUp(self): super(AllocationManagerSortingTest, self).setUp() self.api = utils.FakeAPI(fake_responses_sorting) self.mgr = ironicclient.v1.allocation.AllocationManager(self.api)
def setUp(self): super(ConductorManagerTest, self).setUp() self.api = utils.FakeAPI(fake_responses) self.mgr = conductor.ConductorManager(self.api)
def setUp(self): super(ManagerTestCase, self).setUp() self.api = utils.FakeAPI(fake_responses) self.manager = TestableManager(self.api)
def setUp(self): super(ChassisManagerTest, self).setUp() self.api = utils.FakeAPI(fake_responses) self.mgr = ironicclient.v1.chassis.ChassisManager(self.api)
def setUp(self): super(VolumeConnectorManagerSortingTest, self).setUp() self.api = utils.FakeAPI(fake_responses_sorting) self.mgr = ironicclient.v1.volume_connector.VolumeConnectorManager( self.api)
def setUp(self): super(VolumeConnectorManagerPaginationTest, self).setUp() self.api = utils.FakeAPI(fake_responses_pagination) self.mgr = ironicclient.v1.volume_connector.VolumeConnectorManager( self.api)