示例#1
0
 def test_parse_release_with_year(self):
     release = self._make_release('1984')
     d = mb.release_dict(release)
     self.assertEqual(d['album'], 'ALBUM TITLE')
     self.assertEqual(d['album_id'], 'ALBUM ID')
     self.assertEqual(d['artist'], 'ARTIST NAME')
     self.assertEqual(d['artist_id'], 'ARTIST ID')
     self.assertEqual(d['year'], 1984)
示例#2
0
文件: test_mb.py 项目: mdecker/beets
 def test_parse_release_with_year(self):
     release = self._make_release('1984')
     d = mb.release_dict(release)
     self.assertEqual(d['album'], 'ALBUM TITLE')
     self.assertEqual(d['album_id'], 'ALBUM ID')
     self.assertEqual(d['artist'], 'ARTIST NAME')
     self.assertEqual(d['artist_id'], 'ARTIST ID')
     self.assertEqual(d['year'], 1984)
示例#3
0
 def test_parse_tracks(self):
     release = self._make_release()
     tracks = [self._make_track('TITLE ONE', 'dom/ID ONE', 100.0 * 1000.0),
               self._make_track('TITLE TWO', 'dom/ID TWO', 200.0 * 1000.0)]
     d = mb.release_dict(release, tracks)
     t = d['tracks']
     self.assertEqual(len(t), 2)
     self.assertEqual(t[0]['title'], 'TITLE ONE')
     self.assertEqual(t[0]['id'], 'ID ONE')
     self.assertEqual(t[0]['length'], 100.0)
     self.assertEqual(t[1]['title'], 'TITLE TWO')
     self.assertEqual(t[1]['id'], 'ID TWO')
     self.assertEqual(t[1]['length'], 200.0)
示例#4
0
文件: test_mb.py 项目: mdecker/beets
 def test_parse_tracks(self):
     release = self._make_release()
     tracks = [
         self._make_track('TITLE ONE', 'dom/ID ONE', 100.0 * 1000.0),
         self._make_track('TITLE TWO', 'dom/ID TWO', 200.0 * 1000.0)
     ]
     d = mb.release_dict(release, tracks)
     t = d['tracks']
     self.assertEqual(len(t), 2)
     self.assertEqual(t[0]['title'], 'TITLE ONE')
     self.assertEqual(t[0]['id'], 'ID ONE')
     self.assertEqual(t[0]['length'], 100.0)
     self.assertEqual(t[1]['title'], 'TITLE TWO')
     self.assertEqual(t[1]['id'], 'ID TWO')
     self.assertEqual(t[1]['length'], 200.0)
示例#5
0
文件: test_mb.py 项目: mdecker/beets
 def test_detect_various_artists(self):
     release = self._make_release(None)
     release.artist.id = musicbrainz2.model.VARIOUS_ARTISTS_ID
     d = mb.release_dict(release)
     self.assertTrue(d['va'])
示例#6
0
文件: test_mb.py 项目: mdecker/beets
 def test_various_artists_defaults_false(self):
     release = self._make_release(None)
     d = mb.release_dict(release)
     self.assertFalse(d['va'])
示例#7
0
文件: test_mb.py 项目: mdecker/beets
 def test_no_release_date(self):
     release = self._make_release(None)
     d = mb.release_dict(release)
     self.assertFalse('year' in d)
     self.assertFalse('month' in d)
     self.assertFalse('day' in d)
示例#8
0
文件: test_mb.py 项目: mdecker/beets
 def test_no_durations(self):
     release = self._make_release()
     tracks = [self._make_track('TITLE', 'dom/ID', None)]
     d = mb.release_dict(release, tracks)
     self.assertFalse('length' in d['tracks'][0])
示例#9
0
文件: test_mb.py 项目: mdecker/beets
 def test_parse_release_year_month_only(self):
     release = self._make_release('1987-03')
     d = mb.release_dict(release)
     self.assertEqual(d['year'], 1987)
     self.assertEqual(d['month'], 3)
示例#10
0
文件: test_mb.py 项目: mdecker/beets
 def test_parse_release_type(self):
     release = self._make_release('1984')
     d = mb.release_dict(release)
     self.assertEqual(d['albumtype'], 'album')
示例#11
0
文件: test_mb.py 项目: mdecker/beets
 def test_parse_release_full_date(self):
     release = self._make_release('1987-03-31')
     d = mb.release_dict(release)
     self.assertEqual(d['year'], 1987)
     self.assertEqual(d['month'], 3)
     self.assertEqual(d['day'], 31)
示例#12
0
 def test_parse_release_full_date(self):
     release = self._make_release('1987-03-31')
     d = mb.release_dict(release)
     self.assertEqual(d['year'], 1987)
     self.assertEqual(d['month'], 3)
     self.assertEqual(d['day'], 31)
示例#13
0
 def test_parse_release_year_month_only(self):
     release = self._make_release('1987-03')
     d = mb.release_dict(release)
     self.assertEqual(d['year'], 1987)
     self.assertEqual(d['month'], 3)
示例#14
0
 def test_parse_release_type(self):
     release = self._make_release('1984')
     d = mb.release_dict(release)
     self.assertEqual(d['albumtype'], 'album')
示例#15
0
 def test_no_durations(self):
     release = self._make_release()
     tracks = [self._make_track('TITLE', 'dom/ID', None)]
     d = mb.release_dict(release, tracks)
     self.assertFalse('length' in d['tracks'][0])
示例#16
0
 def test_detect_various_artists(self):
     release = self._make_release(None)
     release.artist.id = musicbrainz2.model.VARIOUS_ARTISTS_ID
     d = mb.release_dict(release)
     self.assertTrue(d['va'])
示例#17
0
 def test_various_artists_defaults_false(self):
     release = self._make_release(None)
     d = mb.release_dict(release)
     self.assertFalse(d['va'])
示例#18
0
 def test_no_release_date(self):
     release = self._make_release(None)
     d = mb.release_dict(release)
     self.assertFalse('year' in d)
     self.assertFalse('month' in d)
     self.assertFalse('day' in d)