3 from g_pypi.ebuild import *
6 def test_get_portage_license():
7 """Convert classifier license to known portage license"""
8 assert get_portage_license("License :: OSI Approved :: Zope Public License") == "ZPL"
10 assert get_portage_license("License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)") == "LGPL-2.1"
12 assert get_portage_license("License :: Public Domain") == "public-domain"
13 assert get_portage_license("") == ""
16 def test_is_valid_license():
17 """Check if license string matches a valid one in ${PORTDIR}/licenses"""
18 assert is_valid_license("GPL") == False
19 assert is_valid_license("GPL-2") == True