Fixed g-pypi to replace dots in package name.
[g-pypi.git] / tests / test_ebuild.py
1
2
3 from g_pypi.ebuild import *
4
5
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"
9     
10     assert get_portage_license("License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)") ==  "LGPL-2.1"
11
12     assert get_portage_license("License :: Public Domain") == "public-domain"
13     assert get_portage_license("") == ""
14
15
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
20