def test_validate_fetched_record_with_invalid_author_name_number(self): """ Tests if the author's name is not a number.""" hn_data_obj = initialize_hn_obj_invalid_author_name_number() result = hf.validate_fetched_record(hn_data_obj) self.assertEqual(result, False, msg="The author's name can't be a number.")
def test_validate_fetched_record_with_invalid_points_negative_number(self): """ Tests if the points are a negative number.""" hn_data_obj = initialize_hn_obj_invalid_points_negative_number() result = hf.validate_fetched_record(hn_data_obj) self.assertEqual(result, False, msg="The points can't be a negative number.")
def test_validate_fetched_record_with_invalid_author_name_empty(self): """ Tests if the author's name is an empty string.""" hn_data_obj = initialize_hn_obj_invalid_author_name_empty() result = hf.validate_fetched_record(hn_data_obj) self.assertEqual(result, False, msg="The author's name can't be empty.")
def test_validate_fetched_record_with_invalid_title_too_long(self): """ Tests if the title is too long.""" hn_data_obj = initialize_hn_obj_invalid_title_too_long() result = hf.validate_fetched_record(hn_data_obj) self.assertEqual(result, False, msg="The title can't be more then 256 characters.")
def test_validate_fetched_record_with_valid_data(self): """ Tests if all the data are correctly fetched.""" hn_data_obj = initialize_hn_valid_object() result = hf.validate_fetched_record(hn_data_obj) self.assertEqual(result, True, msg="One or more data haven't fetched correctly.")
def test_validate_fetched_record_with_invalid_comments_characters(self): """ Tests if the numbers of comments are characters.""" hn_data_obj = initialize_hn_obj_invalid_comments_character() result = hf.validate_fetched_record(hn_data_obj) self.assertEqual(result, False, msg="The points can't be characters.")
def test_validate_fetched_record_with_invalid_rank_not_integer(self): """ Tests if the rank are an integer number.""" hn_data_obj = initialize_hn_obj_invalid_rank_not_integer() result = hf.validate_fetched_record(hn_data_obj) self.assertEqual(result, False, msg="The rank must be an integer.")
def test_validate_fetched_record_with_invalid_rank_character(self): """ Tests if the rank is characters.""" hn_data_obj = initialize_hn_obj_invalid_rank_character() result = hf.validate_fetched_record(hn_data_obj) self.assertEqual(result, False, msg="The rank can't be characters.")