Beispiel #1
0
 def test_find_by_key_single(self, key):
     '''
     Test that it is possible to find the license by various keys
     '''
     value = getattr(MITLicense, key)
     result = license.find_by_key(key, value, multiple=False)
     assert result == MITLicense
Beispiel #2
0
 def test_find_by_key_single_wrong(self, key):
     '''
     Test that when finding single result, KeyError is risen when nothing found
     '''
     value = 'nonexistent value'
     with pytest.raises(KeyError):
             result = license.find_by_key(key, value, multiple=False)
Beispiel #3
0
 def test_find_by_key_multiple_wrong(self, key):
     '''
     Test that when finding multiple results, empty list is returned when nothing found
     '''
     value = 'nonexistent value'
     results = license.find_by_key(key, value)
     assert results == []
Beispiel #4
0
 def test_find_by_key_single(self, key):
     '''
     Test that it is possible to find the license by various keys
     '''
     value = getattr(MITLicense, key)
     result = license.find_by_key(key, value, multiple=False)
     assert result == MITLicense
Beispiel #5
0
 def test_find_by_key_single_wrong(self, key):
     '''
     Test that when finding single result, KeyError is risen when nothing found
     '''
     value = 'nonexistent value'
     with pytest.raises(KeyError):
         result = license.find_by_key(key, value, multiple=False)
Beispiel #6
0
 def test_find_by_key_multiple_wrong(self, key):
     '''
     Test that when finding multiple results, empty list is returned when nothing found
     '''
     value = 'nonexistent value'
     results = license.find_by_key(key, value)
     assert results == []
Beispiel #7
0
 def test_bsd_finds_multiple(self):
     '''
     Test that searching for BSD in rpm key return at least two results
     '''
     results = license.find_by_key('rpm', 'BSD')
     assert len(results) >= 2
Beispiel #8
0
 def test_bsd_finds_multiple(self):
     '''
     Test that searching for BSD in rpm key return at least two results
     '''
     results = license.find_by_key('rpm', 'BSD')
     assert len(results) >= 2