def test_check_with_wrong_id(self): with self.assertRaises(Exception) as ex: check_new_item(base_url_book, str(random.randint(4000000000, 9120000001)), book_dict) self.assertEqual("Wrong request", str(ex.exception))
def test_check_correct_data(self): result = check_new_item(base_url_book, self.book_id, book_dict) self.assertIsNone(result)
def test_check_with_wrong_id(self, setup_and_teardown): with pytest.raises(Exception) as ex: check_new_item(base_url_book, str(random.randint(4000000000, 9120000001)), book_dict) assert "Wrong request" == str(ex.value)
def test_check_correct_data(self, setup_and_teardown): result = check_new_item(base_url_book, self.book_id, book_dict) assert result is None
def test_check_correct_data(self): result = check_new_item(base_url_role, self.role_id, role_dict) self.assertIsNone(result)
def test_check_with_wrong_id(self): with pytest.raises(Exception) as ex: check_new_item(base_url_role, str(random.randint(4000000000, 9120000001)), role_dict) assert "Wrong request" == str(ex.value)