예제 #1
0
 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.")
예제 #2
0
 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.")
예제 #3
0
 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.")
예제 #4
0
 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.")
예제 #5
0
 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.")
예제 #6
0
 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.")
예제 #7
0
 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.")
예제 #8
0
 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.")