File: test_ws_filters.py

package info (click to toggle)
python-musicbrainz2 0.3.1-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 428 kB
  • ctags: 527
  • sloc: python: 2,301; xml: 724; makefile: 10
file content (23 lines) | stat: -rw-r--r-- 652 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"""Tests for subclasses of IFilter."""
import unittest
from musicbrainz2.model import Release
from musicbrainz2.webservice import ReleaseFilter


class ReleaseFilterTest(unittest.TestCase):
	def testBasic(self):
		f = ReleaseFilter(title='Under the Pink')
		params = f.createParameters()
		self.assert_( ('title', 'Under the Pink') in params )

	def testReleaseTypes(self):
		f = ReleaseFilter(artistName='Tori Amos', releaseTypes=(
			Release.TYPE_ALBUM, Release.TYPE_OFFICIAL))
		params = f.createParameters()

		self.assertEquals(len(params), 2)
		self.assert_( ('artist', 'Tori Amos') )
		self.assert_( ('releasetypes', 'Album Official') )


# EOF