Exemplo n.º 1
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
Exemplo n.º 2
0
 def test_find_by_false_single(self):
     with pytest.raises(KeyError):
         result = license.find_by_function(lambda x: False, multiple=False)
Exemplo n.º 3
0
 def test_find_by_function_is_equal(self):
     result = license.find_by_function(lambda x: x == MITLicense, multiple=False)
     assert result == MITLicense
Exemplo n.º 4
0
 def test_find_by_true(self, multiple):
     result = license.find_by_function(lambda x: True, multiple)
     assert result
Exemplo n.º 5
0
 def test_find_by_false_multiple(self):
     results = license.find_by_function(lambda x: False, multiple=True)
     assert results == []
Exemplo n.º 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
Exemplo n.º 7
0
 def test_find_by_function_is_equal(self):
     result = license.find_by_function(lambda x: x == MITLicense,
                                       multiple=False)
     assert result == MITLicense
Exemplo n.º 8
0
 def test_find_by_false_single(self):
     with pytest.raises(KeyError):
         result = license.find_by_function(lambda x: False, multiple=False)
Exemplo n.º 9
0
 def test_find_by_false_multiple(self):
     results = license.find_by_function(lambda x: False, multiple=True)
     assert results == []
Exemplo n.º 10
0
 def test_find_by_true(self, multiple):
     result = license.find_by_function(lambda x: True, multiple)
     assert result