def test_case_del_nonexistent_character(self):
     print("\ndelete nonexistent character")
     commands = APICommands()
     result, status_code = commands.delete_character("Vasya0")
     assert str(status_code) == "200" and "is deleted" in str(
         result["result"])
     result, status_code = commands.delete_character("Vasya0")
     assert str(status_code) == "200" and str(
         result["result"][0]) == "No such name"
Beispiel #2
0
 def setup_class(self):
     print("\ntest suite setup ")
     commands = APICommands()
     character_dict = APICommands.generate_character(commands,
                                                     character_name="Vasya")
     result, status_code = commands.get_certain_character("Vasya")
     if str(result['result']) == "No such name":
         commands.add_character(character_dict)
     else:
         commands.delete_character("Vasya")
         commands.add_character(character_dict)
 def test_case_del_character_by_invalid_user(self):
     print("\ndelete character that exists by INVALID user and password")
     commands = APICommands()
     error, status_code = commands.delete_character("Vasya0", "some_login",
                                                    "some_password")
     assert str(status_code) == "401" and str(
         error['error']) == "You have to login with proper credentials"
 def test_case_del_character(self):
     print("\ndelete character that exists")
     commands = APICommands()
     result, status_code = commands.delete_character("Vasya0")
     assert str(status_code) == "200" and "is deleted" in str(
         result["result"])
Beispiel #5
0
 def teardown_class(self):
     print("\ntest suite teardown")
     commands = APICommands()
     result, status_code = commands.get_certain_character("Vasya")
     if str(result['result']) != "No such name":
         commands.delete_character("Vasya")