示例#1
0
 def test_parse_with_eggfile(self):
     test_file = self.get_test_loc(
         'pypi/archive/commoncode-21.5.12-py3.9.egg')
     package = pypi.parse(test_file)
     expected_loc = self.get_test_loc(
         'pypi/archive/commoncode-21.5.12-py3.9.egg-expected.json')
     self.check_package(package, expected_loc, regen=False)
示例#2
0
 def test_develop_with_parse(self):
     test_file = self.get_test_loc(
         'pypi/develop/scancode_toolkit.egg-info/PKG-INFO')
     package = pypi.parse(test_file)
     expected_loc = self.get_test_loc(
         'pypi/develop/scancode_toolkit.egg-info-expected.json')
     self.check_package(package, expected_loc, regen=False)
示例#3
0
 def test_pkginfo_parse_with_wheelfile_with_parse_function(self):
     test_file = self.get_test_loc(
         'pypi/wheel/atomicwrites-1.2.1-py2.py3-none-any.whl')
     package = pypi.parse(test_file)
     expected_loc = self.get_test_loc(
         'pypi/wheel/parse-wheel-expected.json')
     self.check_package(package, expected_loc, regen=False)
示例#4
0
 def test_parse(self):
     test_file = self.get_test_loc('pypi/setup.py')
     package = pypi.parse(test_file)
     assert 'scancode-toolkit' == package.name
     assert '1.5.0' == package.version
     assert 'ScanCode' == package.authors[0].name
     assert 'ScanCode is a tool to scan code for license, copyright and other interesting facts.' == package.description
     assert 'https://github.com/nexB/scancode-toolkit' == package.homepage_url
示例#5
0
 def test_parse_with_unpacked_wheel_meta_v21_2(self):
     test_file = self.get_test_loc(
         'pypi/unpacked_wheel/metadata-2.1/pip-20.2.2.dist-info/METADATA')
     package = pypi.parse(test_file)
     expected_loc = self.get_test_loc(
         'pypi/unpacked_wheel/metadata-2.1/pip-20.2.2.dist-info-expected.json'
     )
     self.check_package(package, expected_loc, regen=False)
示例#6
0
 def test_parse_with_wheelfile(self):
     test_file = self.get_test_loc(
         'pypi/archive/atomicwrites-1.2.1-py2.py3-none-any.whl')
     package = pypi.parse(test_file)
     expected_loc = self.get_test_loc(
         'pypi/archive/atomicwrites-1.2.1-py2.py3-none-any.whl-expected.json'
     )
     self.check_package(package, expected_loc, regen=False)
示例#7
0
 def test_parse(self):
     test_file = self.get_test_loc('pypi/setup.py')
     package = pypi.parse(test_file)
     assert 'scancode-toolkit' == package.name
     assert '1.5.0' == package.version
     assert 'ScanCode' == package.authors[0].name
     assert 'ScanCode is a tool to scan code for license, copyright and other interesting facts.' == package.description
     assert 'https://github.com/nexB/scancode-toolkit' == package.homepage_url
示例#8
0
 def test_parse_with_unpacked_wheel_meta_v21__with_sources(self):
     test_file = self.get_test_loc(
         'pypi/unpacked_wheel/metadata-2.1/with_sources/anonapi-0.0.19.dist-info/METADATA'
     )
     package = pypi.parse(test_file)
     expected_loc = self.get_test_loc(
         'pypi/unpacked_wheel/metadata-2.1/with_sources/anonapi-0.0.19.dist-info-expected.json'
     )
     self.check_package(package, expected_loc, regen=False)
示例#9
0
 def test_parse_with_unpacked_wheel_meta_v20_2(self):
     test_file = self.get_test_loc(
         'pypi/unpacked_wheel/metadata-2.0/python_mimeparse-1.6.0.dist-info/METADATA'
     )
     package = pypi.parse(test_file)
     expected_loc = self.get_test_loc(
         'pypi/unpacked_wheel/metadata-2.0/python_mimeparse-1.6.0.dist-info-expected.json'
     )
     self.check_package(package, expected_loc, regen=False)
示例#10
0
 def test_parse(self):
     test_file = self.get_test_loc('pypi/setup.py/setup.py')
     package = pypi.parse(test_file)
     assert package.name == 'scancode-toolkit'
     assert package.version == '1.5.0'
     assert package.parties[0].name == 'ScanCode'
     assert package.description == ('ScanCode is a tool to scan code for license, '
             'copyright and other interesting facts.')
     assert package.homepage_url == 'https://github.com/nexB/scancode-toolkit'
示例#11
0
 def test_parse_setup_py_basic(self):
     test_file = self.get_test_loc('pypi/setup.py/simple-setup.py')
     package = pypi.parse(test_file)
     expected_loc = self.get_test_loc('pypi/setup.py/setup.py-expected.json')
     self.check_package(package, expected_loc, regen=False)
 def test_pkginfo_parse_with_unpackaged_source_with_parse_function(self):
     test_file = self.get_test_loc('pypi')
     package = pypi.parse(test_file)
     expected_loc = self.get_test_loc('pypi/unpackage_source_parser-expected.json')
     self.check_package(package, expected_loc, regen=False)