コード例 #1
0
 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))
コード例 #2
0
 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))
コード例 #3
0
 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))
コード例 #4
0
 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))
コード例 #5
0
 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))
コード例 #6
0
 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))
コード例 #7
0
 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))
コード例 #8
0
ファイル: test_conductor.py プロジェクト: numvc/LuxoftBot
 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))
コード例 #9
0
 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))
コード例 #10
0
 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))
コード例 #11
0
ファイル: test_conductor.py プロジェクト: numvc/LuxoftBot
 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))
コード例 #12
0
 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))
コード例 #13
0
 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))
コード例 #14
0
 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))
コード例 #15
0
 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))
コード例 #16
0
ファイル: test_conductor.py プロジェクト: numvc/LuxoftBot
 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))
コード例 #17
0
ファイル: test_conductor.py プロジェクト: numvc/LuxoftBot
 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))
コード例 #18
0
 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)
コード例 #19
0
 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)
コード例 #20
0
 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)
コード例 #21
0
 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)
コード例 #22
0
 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))
コード例 #23
0
 def setUp(self):
     super(NodeManagerTest, self).setUp()
     self.api = utils.FakeAPI(fake_responses)
     self.mgr = node.NodeManager(self.api)
コード例 #24
0
 def setUp(self):
     super(DriverManagerTest, self).setUp()
     self.api = utils.FakeAPI(fake_responses)
     self.mgr = driver.DriverManager(self.api)
コード例 #25
0
 def setUp(self):
     super(AllocationManagerSortingTest, self).setUp()
     self.api = utils.FakeAPI(fake_responses_sorting)
     self.mgr = ironicclient.v1.allocation.AllocationManager(self.api)
コード例 #26
0
ファイル: test_conductor.py プロジェクト: numvc/LuxoftBot
 def setUp(self):
     super(ConductorManagerTest, self).setUp()
     self.api = utils.FakeAPI(fake_responses)
     self.mgr = conductor.ConductorManager(self.api)
コード例 #27
0
 def setUp(self):
     super(ManagerTestCase, self).setUp()
     self.api = utils.FakeAPI(fake_responses)
     self.manager = TestableManager(self.api)
コード例 #28
0
 def setUp(self):
     super(ChassisManagerTest, self).setUp()
     self.api = utils.FakeAPI(fake_responses)
     self.mgr = ironicclient.v1.chassis.ChassisManager(self.api)
コード例 #29
0
 def setUp(self):
     super(VolumeConnectorManagerSortingTest, self).setUp()
     self.api = utils.FakeAPI(fake_responses_sorting)
     self.mgr = ironicclient.v1.volume_connector.VolumeConnectorManager(
         self.api)
コード例 #30
0
 def setUp(self):
     super(VolumeConnectorManagerPaginationTest, self).setUp()
     self.api = utils.FakeAPI(fake_responses_pagination)
     self.mgr = ironicclient.v1.volume_connector.VolumeConnectorManager(
         self.api)