def test_preprocess_tags_with_scores(self): tags = { 'a': 1, 'ABC': 1, 'abcdefabcdefabcdefabcdefabcdefabcdef' + 'abcdefabcdefabcdefabcdefabcde': 1, } preprocessed_tags = whatlastgenre.preprocess_tags(tags) for key, val in preprocessed_tags.items(): self.assertEqual(key, key.strip().lower()) self.assertGreater(val, 0) self.assertEqual(len(preprocessed_tags), 1)
def test_preprocess_tags_with_scores(self): tags = { 'a': 1, 'ABC': 1, 'abcdefabcdefabcdefabcdefabcdefabcdef' + 'abcdefabcdefabcdefabcdefabcde': 1, } preprocessed_tags = whatlastgenre.preprocess_tags(tags) for key, val in preprocessed_tags.iteritems(): self.assertEquals(key, key.strip().lower()) self.assertGreater(val, 0) self.assertEquals(len(preprocessed_tags), 1)
def test_preprocess_tags_many_without_scores(self): tags = {'tag%s' % i: 0 for i in range(100)} preprocessed_tags = whatlastgenre.preprocess_tags(tags) self.assertEqual(len(preprocessed_tags), 42)
def test_preprocess_tags_many_without_scores(self): tags = {'tag%s' % i: 0 for i in range(100)} preprocessed_tags = whatlastgenre.preprocess_tags(tags) self.assertEquals(len(preprocessed_tags), 42)