示例#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]>'