def test_proxy_delete(self, data): """@Test: Proxy deletion with the home proxy @Feature: Smart Proxy @Assert: Proxy is deleted """ try: proxy = make_proxy({u'name': data['name']}) except CLIFactoryError as err: self.fail(err) self.assertEquals(proxy['name'], data['name'], "Input and output name should be consistent") result = Proxy.info({u'id': proxy['id']}) self.assertEqual(result.return_code, 0, "Proxy should be found") self.assertEqual(len(result.stderr), 0, "No error excepted") result = Proxy.delete({u'id': proxy['id']}) self.assertEqual(result.return_code, 0, "Proxy should be deleted") self.assertEqual(len(result.stderr), 0, "No error excepted") result = Proxy.info({u'id': proxy['id']}) self.assertNotEqual(result.return_code, 0, "Proxy should not be found") self.assertGreater(len(result.stderr), 0, "Expected an error here")
def test_positive_delete_by_id(self): """Proxy deletion with the home proxy @id: 1b6973b1-259d-4866-b36f-c2d5fb154035 @Assert: Proxy is deleted """ for name in valid_data_list(): with self.subTest(name): proxy = make_proxy({u'name': name}) Proxy.delete({'id': proxy['id']}) with self.assertRaises(CLIReturnCodeError): Proxy.info({u'id': proxy['id']})
def test_positive_delete_by_id(self): """Proxy deletion with the home proxy @id: 1b6973b1-259d-4866-b36f-c2d5fb154035 @Assert: Proxy is deleted """ for name in valid_data_list(): with self.subTest(name): proxy = make_proxy({u'name': name}) Proxy.delete({u'id': proxy['id']}) with self.assertRaises(CLIReturnCodeError): Proxy.info({u'id': proxy['id']})
def test_positive_delete_by_id(self): """Proxy deletion with the home proxy @Feature: Smart Proxy @Assert: Proxy is deleted """ for name in valid_data_list(): with self.subTest(name): proxy = make_proxy({u'name': name}) Proxy.delete({u'id': proxy['id']}) with self.assertRaises(CLIReturnCodeError): Proxy.info({u'id': proxy['id']})
def test_proxy_delete(self, data): """@Test: Proxy deletion with the home proxy @Feature: Smart Proxy @Assert: Proxy is deleted """ try: proxy = make_proxy({u'name': data['name']}) except CLIFactoryError as err: self.fail(err) self.assertEquals( proxy['name'], data['name'], "Input and output name should be consistent") result = Proxy.info({u'id': proxy['id']}) self.assertEqual( result.return_code, 0, "Proxy should be found" ) self.assertEqual( len(result.stderr), 0, "No error excepted" ) result = Proxy.delete({u'id': proxy['id']}) self.assertEqual( result.return_code, 0, "Proxy should be deleted" ) self.assertEqual( len(result.stderr), 0, "No error excepted" ) result = Proxy.info({u'id': proxy['id']}) self.assertNotEqual( result.return_code, 0, "Proxy should not be found" ) self.assertGreater( len(result.stderr), 0, "Expected an error here" )
def test_positive_delete_by_id(self): """Proxy deletion with the home proxy :id: 1b6973b1-259d-4866-b36f-c2d5fb154035 :expectedresults: Proxy is deleted :CaseImportance: Critical """ for name in valid_data_list(): with self.subTest(name): proxy = make_proxy({u'name': name}) Proxy.delete({'id': proxy['id']}) with self.assertRaises(CLIReturnCodeError): Proxy.info({u'id': proxy['id']})
def test_proxy_update(self, data): """@Test: Proxy name update with the home proxy @Feature: Smart Proxy @Assert: Proxy has the name updated """ try: proxy = make_proxy({u'name': data['name']}) except CLIFactoryError as err: self.fail(err) self.assertEquals(proxy['name'], data['name'], "Input and output name should be consistent") with default_url_on_new_port(9090, random.randint(9091, 49090)) as url: result = Proxy.update({ u'id': proxy['id'], u'name': data['update'], u'url': url }) self.assertEqual(result.return_code, 0, "Proxy should be updated") result = Proxy.info({u'id': proxy['id']}) self.assertEqual(result.return_code, 0, "Proxy should be found") self.assertEqual(result.stdout['name'], data['update'], "Proxy name should be updated")
def test_positive_delete_by_id(name): """Proxy deletion with the home proxy :id: 1b6973b1-259d-4866-b36f-c2d5fb154035 :expectedresults: Proxy is deleted :CaseLevel: Component :Parametrized: Yes :BZ: 1398695 """ proxy = make_proxy({'name': name}) Proxy.delete({'id': proxy['id']}) with pytest.raises(CLIReturnCodeError): Proxy.info({'id': proxy['id']})
def test_positive_update_name(request): """Proxy name update with the home proxy :id: 1a02a06b-e9ab-4b9b-bcb0-ac7060188316 :expectedresults: Proxy has the name updated :CaseLevel: Component :BZ: 1398695 """ proxy = _make_proxy(request, {'name': gen_alphanumeric()}) for new_name in valid_data_list().values(): newport = get_available_capsule_port() with default_url_on_new_port(9090, newport) as url: Proxy.update({'id': proxy['id'], 'name': new_name, 'url': url}) proxy = Proxy.info({'id': proxy['id']}) assert proxy['name'] == new_name
def test_positive_update_name(self): """Proxy name update with the home proxy @Feature: Smart Proxy @Assert: Proxy has the name updated """ proxy = make_proxy({u'name': gen_alphanumeric()}) newport = random.randint(9091, 49090) for new_name in valid_data_list(): with self.subTest(new_name): with default_url_on_new_port(9090, newport) as url: Proxy.update({ u'id': proxy['id'], u'name': new_name, u'url': url, }) proxy = Proxy.info({u'id': proxy['id']}) self.assertEqual(proxy['name'], new_name)
def test_positive_update_name(self): """Proxy name update with the home proxy @id: 1a02a06b-e9ab-4b9b-bcb0-ac7060188316 @Assert: Proxy has the name updated """ proxy = make_proxy({u'name': gen_alphanumeric()}) for new_name in valid_data_list(): with self.subTest(new_name): newport = get_available_capsule_port() with default_url_on_new_port(9090, newport) as url: Proxy.update({ u'id': proxy['id'], u'name': new_name, u'url': url, }) proxy = Proxy.info({u'id': proxy['id']}) self.assertEqual(proxy['name'], new_name) # Add capsule id to cleanup list self.addCleanup(capsule_cleanup, proxy['id'])
def test_positive_update_name(self): """Proxy name update with the home proxy :id: 1a02a06b-e9ab-4b9b-bcb0-ac7060188316 :expectedresults: Proxy has the name updated :CaseImportance: Critical """ proxy = self._make_proxy({u'name': gen_alphanumeric()}) for new_name in valid_data_list(): with self.subTest(new_name): newport = get_available_capsule_port() with default_url_on_new_port(9090, newport) as url: Proxy.update({ u'id': proxy['id'], u'name': new_name, u'url': url, }) proxy = Proxy.info({u'id': proxy['id']}) self.assertEqual(proxy['name'], new_name)
def test_proxy_update(self, data): """@Test: Proxy name update with the home proxy @Feature: Smart Proxy @Assert: Proxy has the name updated """ try: proxy = make_proxy({u'name': data['name']}) except CLIFactoryError as err: self.fail(err) self.assertEquals( proxy['name'], data['name'], "Input and output name should be consistent") with default_url_on_new_port(9090, random.randint(9091, 49090)) as url: result = Proxy.update({ u'id': proxy['id'], u'name': data['update'], u'url': url}) self.assertEqual( result.return_code, 0, "Proxy should be updated" ) result = Proxy.info({u'id': proxy['id']}) self.assertEqual( result.return_code, 0, "Proxy should be found" ) self.assertEqual( result.stdout['name'], data['update'], "Proxy name should be updated" )