Skip to content

Commit

Permalink
Add tests for the parse function #253
Browse files Browse the repository at this point in the history
Signed-off-by: Li <[email protected]>
  • Loading branch information
Li committed Jun 5, 2019
1 parent d7ebe5a commit 04c74ae
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/packagedcode/test_pypi.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,21 @@ def test_pkginfo_parse_with_unpackaged_source(self):
expected_loc = self.get_test_loc('pypi/unpackage_source_parser-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.parse2(test_file)
expected_loc = self.get_test_loc('pypi/unpackage_source_parser-expected.json')
self.check_package(package, expected_loc, regen=False)

def test_pkginfo_parse_with_wheelfile(self):
test_file = self.get_test_loc('pypi/wheel/atomicwrites-1.2.1-py2.py3-none-any.whl')
package = pypi.parse_wheel(test_file)
expected_loc = self.get_test_loc('pypi/wheel/parse-wheel-expected.json')
self.check_package(package, expected_loc, regen=False)


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.parse2(test_file)
expected_loc = self.get_test_loc('pypi/wheel/parse-wheel-expected.json')
self.check_package(package, expected_loc, regen=False)

0 comments on commit 04c74ae

Please sign in to comment.