Пример #1
0
 def test_find_by_function_lower_endswith(self, text, res):
     results = licenraptor.find_by_function(
         lambda x: x.name.lower().endswith(text), multiple=True)
     assert (MITLicense in results) == res
Пример #2
0
 def test_find_by_function_is_equal(self):
     result = licenraptor.find_by_function(lambda x: x == MITLicense,
                                           multiple=False)
     assert result == MITLicense
Пример #3
0
 def test_find_by_false_multiple(self):
     results = licenraptor.find_by_function(lambda x: False, multiple=True)
     assert results == []
Пример #4
0
 def test_find_by_false_single(self):
     with pytest.raises(KeyError):
         result = licenraptor.find_by_function(lambda x: False,
                                               multiple=False)
Пример #5
0
 def test_find_by_true(self, multiple):
     result = licenraptor.find_by_function(lambda x: True, multiple)
     assert result