def test_book_in_list_wrong_id(self): with self.assertRaises(Exception) as ex: check_item_in_list(base_url_book, str(random.randint(4000000000, 9120000001)), book_dict) self.assertEqual("The item is not in the list", str(ex.exception))
def test_book_in_list(self): result = check_item_in_list(base_url_book, self.book_id, book_dict) self.assertIsNone(result)
def test_book_in_list_wrong_id(self, setup_and_teardown): with pytest.raises(Exception) as ex: check_item_in_list(base_url_book, str(random.randint(4000000000, 9120000001)), book_dict) assert "The item is not in the list" == str(ex.value)
def test_book_in_list(self, setup_and_teardown): result = check_item_in_list(base_url_book, self.book_id, book_dict) assert result is None
def test_role_in_list(self): result = check_item_in_list(base_url_role, self.role_id, role_dict) self.assertIsNone(result)
def test_role_in_list_wrong_id(self): with pytest.raises(Exception) as ex: check_item_in_list(base_url_role, str(random.randint(4000000000, 9120000001)), role_dict) assert "The item is not in the list" == str(ex.value)