def test_compute_normalized_license_with_url_invalid(self):
     declared_license = [
         {'name': 'MIT', 'url': 'LICENSE.txt'},
     ]
     result = maven.compute_normalized_license(declared_license)
     expected = 'mit'
     assert result == expected
 def test_compute_normalized_license_with_duplicated_license(self):
     declared_license = [
         {'name': 'LGPL'},
         {'name': 'GNU Lesser General Public License', 'url': 'http://www.gnu.org/licenses/lgpl.html'},
     ]
     result = maven.compute_normalized_license(declared_license)
     expected = 'lgpl-2.0-plus'
     assert result == expected
 def test_compute_normalized_license_same_name_url_comments(self):
     declared_license = [
         {'name': 'apache-2.0', 'url': 'apache-2.0', 'comments': 'apache-2.0'},
         {'name': 'mit'}
     ]
     result = maven.compute_normalized_license(declared_license)
     expected = 'apache-2.0 AND mit'
     assert result == expected
 def test_compute_normalized_license_unknown_name(self):
     declared_license = [
         {'name': 'unknown', 'url': 'apache-2.0'},
         {'name': 'mit'}
     ]
     result = maven.compute_normalized_license(declared_license)
     expected = '(unknown AND apache-2.0) AND mit'
     assert result == expected
 def test_compute_normalized_license_tree_nodes(self):
     declared_license = [
         {'name': 'apache-2.0'},
         {'name': 'mit'}
     ]
     result = maven.compute_normalized_license(declared_license)
     expected = 'apache-2.0 AND mit'
     assert result == expected
Exemple #6
0
 def test_compute_normalized_license_with_unknown_url_unknown_comments(self):
     declared_license = [
         {'name': 'apache-2.0', 'url': 'unknown', 'comments': 'unknown'},
         {'name': 'mit'}
     ]
     result = maven.compute_normalized_license(declared_license)
     expected = 'apache-2.0 AND mit'
     assert expected == result
Exemple #7
0
 def test_compute_normalized_license_two_names_only(self):
     declared_license = [
         {'name': 'apache-2.0'},
         {'name': 'mit'}
     ]
     result = maven.compute_normalized_license(declared_license)
     expected = 'apache-2.0 AND mit'
     assert expected == result