def test_keygen_with_mismatching_year(self):
     scorer = IssueScorer(metadata=mock_metadata('Dogville', 2.0,
                                                 mock_date(2010)),
                          title='Dogville #2 (2014)',
                          tokenizer=mock_tokens_function(
                              ['dogville']))
     self.assertEqual(12, scorer.score())
 def test_keygen_generic_comments(self):
     scorer = IssueScorer(metadata=mock_metadata(series='Dogville',
                                                 series_index=2.0,
                                                 comments='the barkening continues'),
                          title='Dogville #2',
                          tokenizer=mock_tokens_function(
                              ['dogville']))
     self.assertEqual(0, scorer.score())
Beispiel #3
0
 def test_keygen_comments_indicating_collection(self):
     scorer = IssueScorer(metadata=mock_metadata(
         series='Dogville',
         series_index=2.0,
         comments='this collects issues #1-10'),
                          title='Dogville #2',
                          tokenizer=mock_tokens_function(['dogville']))
     self.assertEqual(20, scorer.score())
 def test_keygen_comments_indicating_translated_collection(self):
     scorer = IssueScorer(metadata=mock_metadata(series='Dogville',
                                                 series_index=2.0,
                                                 comments='Translates #1-10'),
                          title='Dogville #2',
                          tokenizer=mock_tokens_function(
                              ['dogville']))
     self.assertEqual(15, scorer.score())
Beispiel #5
0
 def test_keygen_generic_comments(self):
     scorer = IssueScorer(metadata=mock_metadata(
         series='Dogville',
         series_index=2.0,
         comments='the barkening continues'),
                          title='Dogville #2',
                          tokenizer=mock_tokens_function(['dogville']))
     self.assertEqual(0, scorer.score())
 def test_keygen_issue_number_does_not_match_series_index(self):
     scorer = IssueScorer(metadata=mock_metadata('Dogville', 2.0),
                          title='Dogville #5',
                          tokenizer=mock_tokens_function(
                              ['dogville']))
     self.assertEqual(50, scorer.score())
 def test_keygen_with_extra_tokens(self):
     scorer = IssueScorer(metadata=mock_metadata('Dogville', 2.0),
                          title='Dogville Awakening #2',
                          tokenizer=mock_tokens_function(
                              ['dogville', 'awakening']))
     self.assertEqual(21, scorer.score())
 def test_keygen_with_missing_publish_date(self):
     scorer = IssueScorer(metadata=mock_metadata('Dogville', 2.0, None),
                          title='Dogville #2 (2014)',
                          tokenizer=mock_tokens_function(
                              ['dogville']))
     self.assertEqual(10, scorer.score())
Beispiel #9
0
 def test_keygen_float_index_mismatch_int_title(self):
     scorer = IssueScorer(metadata=mock_metadata('Dogville', 2.1),
                          title='Dogville #2',
                          tokenizer=mock_tokens_function(['dogville']))
     self.assertEqual(50, scorer.score())
 def test_keygen_float_index_mismatch_int_title(self):
     scorer = IssueScorer(metadata=mock_metadata('Dogville', 2.1),
                          title='Dogville #2',
                          tokenizer=mock_tokens_function(
                              ['dogville']))
     self.assertEqual(50, scorer.score())
 def test_keygen_float_series_index(self):
     scorer = IssueScorer(metadata=mock_metadata('Dogville', 2.1),
                          title='Dogville #2.1',
                          tokenizer=mock_tokens_function(
                              ['dogville']))
     self.assertEqual(0, scorer.score())
Beispiel #12
0
 def test_keygen_with_missing_publish_date(self):
     scorer = IssueScorer(metadata=mock_metadata('Dogville', 2.0, None),
                          title='Dogville #2 (2014)',
                          tokenizer=mock_tokens_function(['dogville']))
     self.assertEqual(10, scorer.score())
Beispiel #13
0
 def test_keygen_float_series_index(self):
     scorer = IssueScorer(metadata=mock_metadata('Dogville', 2.1),
                          title='Dogville #2.1',
                          tokenizer=mock_tokens_function(['dogville']))
     self.assertEqual(0, scorer.score())
Beispiel #14
0
 def test_keygen_no_title(self):
     scorer = IssueScorer(metadata=mock_metadata('Dogville', 2.0),
                          title=None,
                          tokenizer=mock_tokens_function([]))
     self.assertEqual(0, scorer.score())
Beispiel #15
0
 def test_keygen_series_index_not_in_title(self):
     scorer = IssueScorer(metadata=mock_metadata('Dogville', 2.0),
                          title='Dogville',
                          tokenizer=mock_tokens_function(['dogville']))
     self.assertEqual(10, scorer.score())
Beispiel #16
0
 def test_keygen_issue_number_does_not_match_series_index(self):
     scorer = IssueScorer(metadata=mock_metadata('Dogville', 2.0),
                          title='Dogville #5',
                          tokenizer=mock_tokens_function(['dogville']))
     self.assertEqual(50, scorer.score())
Beispiel #17
0
 def test_keygen_with_extra_tokens(self):
     scorer = IssueScorer(metadata=mock_metadata('Dogville', 2.0),
                          title='Dogville Awakening #2',
                          tokenizer=mock_tokens_function(
                              ['dogville', 'awakening']))
     self.assertEqual(21, scorer.score())
 def test_keygen_no_title(self):
     scorer = IssueScorer(metadata=mock_metadata('Dogville', 2.0),
                          title=None,
                          tokenizer=mock_tokens_function([]))
     self.assertEqual(0, scorer.score())
 def test_keygen_series_index_not_in_title(self):
     scorer = IssueScorer(metadata=mock_metadata('Dogville', 2.0),
                          title='Dogville',
                          tokenizer=mock_tokens_function(
                              ['dogville']))
     self.assertEqual(10, scorer.score())
Beispiel #20
0
 def test_keygen_with_mismatching_year(self):
     scorer = IssueScorer(metadata=mock_metadata('Dogville', 2.0,
                                                 mock_date(2010)),
                          title='Dogville #2 (2014)',
                          tokenizer=mock_tokens_function(['dogville']))
     self.assertEqual(12, scorer.score())