def test_create_folder_negative(self): response = str(create_folder(self.header, self.param)) self.assertEqual(response, '<Response [409]>') list_of_folder = [] response_folder = check_folder(self.header, self.param) for element in response_folder['items']: list_of_folder.append(element['name']) self.assertIn(self.folder, list_of_folder)
def test_create_folder_positive(self): list_before_creation = [] response_folder = check_folder(self.header, self.param) for element in response_folder['items']: list_before_creation.append(element['name']) self.assertNotIn(self.folder, list_before_creation) response = str(create_folder(self.header, self.param)) self.assertEqual(response, '<Response [200]>') list_after_creation = [] response_folder = check_folder(self.header, self.param) for element in response_folder['items']: list_after_creation.append(element['name']) self.assertIn(self.folder, list_before_creation)
def test_3_wrong_authorization(self): assert create_folder('Новая папка').status_code != 401
def test_2_double_create_folder(self): assert create_folder('Папка').status_code == 409
def test_1_create_folder(self): assert create_folder('Папка').status_code == 201
def test_3_wrong_authorization(self): self.assertNotEqual(create_folder('Новая папка').status_code, 401)
def test_2_double_create_folder(self): self.assertEqual(create_folder('Папка').status_code, 409)
def test_1_create_folder(self): self.assertEqual(create_folder('Папка').status_code, 201)
def test_create_folder(self): assert create_folder('fff') == '<Response [201]>'