コード例 #1
0
 def test_match_list_none(self):
     self.mox.StubOutWithMock(search._Matcher, '_matches')
     search._Matcher._matches(None).AndReturn(True)
     self.mox.ReplayAll()
     matcher = search._Matcher('album', None, lambda x: x)
     self.assertTrue(matcher.match(self.str))
     self.mox.VerifyAll()
コード例 #2
0
 def test_match_list_true(self):
     self.mox.StubOutWithMock(search._Matcher, '_matches')
     search._Matcher._matches(mox.IsA(basestring)).AndReturn(True)
     self.mox.ReplayAll()
     matcher = search._Matcher('artist', u'bar', lambda x: x)
     self.assertTrue(matcher.match(self.str))
     self.mox.VerifyAll()
コード例 #3
0
ファイル: test_search.py プロジェクト: hayate891/exaile
 def test_match_list_false(self):
     self.mox.StubOutWithMock(search._Matcher, '_matches')
     # ensure that both tags are checked
     search._Matcher._matches(mox.IsA(basestring)).AndReturn(False)
     search._Matcher._matches(mox.IsA(basestring)).AndReturn(False)
     self.mox.ReplayAll()
     matcher = search._Matcher('artist', u'bar', lambda x: x)
     assert not matcher.match(self.strack)
     self.mox.VerifyAll()
コード例 #4
0
ファイル: test_search.py プロジェクト: exaile/exaile
 def test_match_list_false(self):
     self.mox.StubOutWithMock(search._Matcher, '_matches')
     # ensure that both tags are checked
     search._Matcher._matches(mox.IsA(basestring)).AndReturn(False)
     search._Matcher._matches(mox.IsA(basestring)).AndReturn(False)
     self.mox.ReplayAll()
     matcher = search._Matcher('artist', u'bar', lambda x: x)
     assert not matcher.match(self.strack)
     self.mox.VerifyAll()
コード例 #5
0
 def test_matches(self):
     matcher = search._Matcher('album', None, lambda x: x)
     self.assertRaises(NotImplementedError, matcher._matches, 'foo')
コード例 #6
0
ファイル: test_search.py プロジェクト: hayate891/exaile
 def test_matches(self):
     matcher = search._Matcher('album', None, lambda x: x)
     with pytest.raises(NotImplementedError):
         matcher._matches('foo')
コード例 #7
0
ファイル: test_search.py プロジェクト: exaile/exaile
 def test_matches(self):
     matcher = search._Matcher('album', None, lambda x: x)
     with pytest.raises(NotImplementedError):
         matcher._matches('foo')