コード例 #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
ファイル: test_db.py プロジェクト: nucleoosystem/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
コード例 #7
0
ファイル: test_db.py プロジェクト: nucleoosystem/license
 def test_find_by_function_is_equal(self):
     result = license.find_by_function(lambda x: x == MITLicense,
                                       multiple=False)
     assert result == MITLicense
コード例 #8
0
ファイル: test_db.py プロジェクト: nucleoosystem/license
 def test_find_by_false_single(self):
     with pytest.raises(KeyError):
         result = license.find_by_function(lambda x: False, multiple=False)
コード例 #9
0
ファイル: test_db.py プロジェクト: nucleoosystem/license
 def test_find_by_false_multiple(self):
     results = license.find_by_function(lambda x: False, multiple=True)
     assert results == []
コード例 #10
0
ファイル: test_db.py プロジェクト: nucleoosystem/license
 def test_find_by_true(self, multiple):
     result = license.find_by_function(lambda x: True, multiple)
     assert result