예제 #1
0
    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)
예제 #2
0
    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)
예제 #3
0
 def test_3_wrong_authorization(self):
     assert create_folder('Новая папка').status_code != 401
예제 #4
0
 def test_2_double_create_folder(self):
     assert create_folder('Папка').status_code == 409
예제 #5
0
 def test_1_create_folder(self):
     assert create_folder('Папка').status_code == 201
예제 #6
0
 def test_3_wrong_authorization(self):
     self.assertNotEqual(create_folder('Новая папка').status_code, 401)
예제 #7
0
 def test_2_double_create_folder(self):
     self.assertEqual(create_folder('Папка').status_code, 409)
예제 #8
0
 def test_1_create_folder(self):
     self.assertEqual(create_folder('Папка').status_code, 201)
예제 #9
0
 def test_create_folder(self):
     assert create_folder('fff') == '<Response [201]>'