예제 #1
0
파일: test_db.py 프로젝트: hroncok/license
 def test_find_by_function_lower_endswith(self, text, res):
     results = license.find_by_function(lambda x: x.name.lower().endswith(text), multiple=True)
     assert (MITLicense in results) == res
예제 #2
0
파일: test_db.py 프로젝트: hroncok/license
 def test_find_by_false_single(self):
     with pytest.raises(KeyError):
         result = license.find_by_function(lambda x: False, multiple=False)
예제 #3
0
파일: test_db.py 프로젝트: hroncok/license
 def test_find_by_function_is_equal(self):
     result = license.find_by_function(lambda x: x == MITLicense, multiple=False)
     assert result == MITLicense
예제 #4
0
파일: test_db.py 프로젝트: hroncok/license
 def test_find_by_true(self, multiple):
     result = license.find_by_function(lambda x: True, multiple)
     assert result
예제 #5
0
파일: test_db.py 프로젝트: hroncok/license
 def test_find_by_false_multiple(self):
     results = license.find_by_function(lambda x: False, multiple=True)
     assert results == []
예제 #6
0
 def test_find_by_function_lower_endswith(self, text, res):
     results = license.find_by_function(
         lambda x: x.name.lower().endswith(text), multiple=True)
     assert (MITLicense in results) == res
예제 #7
0
 def test_find_by_function_is_equal(self):
     result = license.find_by_function(lambda x: x == MITLicense,
                                       multiple=False)
     assert result == MITLicense
예제 #8
0
 def test_find_by_false_single(self):
     with pytest.raises(KeyError):
         result = license.find_by_function(lambda x: False, multiple=False)
예제 #9
0
 def test_find_by_false_multiple(self):
     results = license.find_by_function(lambda x: False, multiple=True)
     assert results == []
예제 #10
0
 def test_find_by_true(self, multiple):
     result = license.find_by_function(lambda x: True, multiple)
     assert result