akamai / AkamaiOPEN-edgegrid-python

This library implements an Authentication handler for the Akamai OPEN EdgeGrid Authentication scheme
Apache License 2.0
88 stars 52 forks source link

Releases to pypi contain unusable test suite #36

Closed rohanpm closed 3 years ago

rohanpm commented 5 years ago

The releases of edgegrid-python to PyPI contain the sources for the test suite; however, test data is not installed. That means the tests can't actually work.

Example:

Create a virtualenv and install edgegrid-python:

$ virtualenv-3 ~/edgegrid-env
$ . ~/edgegrid-env/bin/activate
$ pip3 install edgegrid-python

Installation included akamai.edgegrid.test package:

$ find /home/rmcgover/edgegrid-env/lib/python3.6/site-packages/akamai/
/home/rmcgover/edgegrid-env/lib/python3.6/site-packages/akamai/
/home/rmcgover/edgegrid-env/lib/python3.6/site-packages/akamai/edgegrid
/home/rmcgover/edgegrid-env/lib/python3.6/site-packages/akamai/edgegrid/edgerc.py
/home/rmcgover/edgegrid-env/lib/python3.6/site-packages/akamai/edgegrid/test
/home/rmcgover/edgegrid-env/lib/python3.6/site-packages/akamai/edgegrid/test/test_edgegrid.py
/home/rmcgover/edgegrid-env/lib/python3.6/site-packages/akamai/edgegrid/test/__pycache__
/home/rmcgover/edgegrid-env/lib/python3.6/site-packages/akamai/edgegrid/test/__pycache__/__init__.cpython-36.pyc
/home/rmcgover/edgegrid-env/lib/python3.6/site-packages/akamai/edgegrid/test/__pycache__/test_edgegrid.cpython-36.pyc
/home/rmcgover/edgegrid-env/lib/python3.6/site-packages/akamai/edgegrid/test/__init__.py
/home/rmcgover/edgegrid-env/lib/python3.6/site-packages/akamai/edgegrid/edgegrid.py
/home/rmcgover/edgegrid-env/lib/python3.6/site-packages/akamai/edgegrid/__pycache__
/home/rmcgover/edgegrid-env/lib/python3.6/site-packages/akamai/edgegrid/__pycache__/__init__.cpython-36.pyc
/home/rmcgover/edgegrid-env/lib/python3.6/site-packages/akamai/edgegrid/__pycache__/edgegrid.cpython-36.pyc
/home/rmcgover/edgegrid-env/lib/python3.6/site-packages/akamai/edgegrid/__pycache__/edgerc.cpython-36.pyc
/home/rmcgover/edgegrid-env/lib/python3.6/site-packages/akamai/edgegrid/__init__.py

But it did not include testdata.json, so the tests aren't actually usable:

$ python3 -munittest akamai.edgegrid.test.test_edgegrid
E
======================================================================
ERROR: akamai.edgegrid.test.test_edgegrid (unittest.loader._FailedTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/rmcgover/edgegrid-env/lib/python3.6/site-packages/akamai/edgegrid/test/test_edgegrid.py", line 222, in load_tests
    return suite()
  File "/home/rmcgover/edgegrid-env/lib/python3.6/site-packages/akamai/edgegrid/test/test_edgegrid.py", line 199, in suite
    with open("%s/testdata.json" % mydir) as testdata:
FileNotFoundError: [Errno 2] No such file or directory: '/home/rmcgover/edgegrid-env/lib/python3.6/site-packages/akamai/edgegrid/test/testdata.json'

----------------------------------------------------------------------
Ran 1 test in 0.000s

FAILED (errors=1)

Steps to reproduce:

Actual behavior:

Expected behavior:

robertolopezlopez commented 3 years ago

Thank you @rohanpm ,

We have fixed this issue in our internal repository and we will publish a new version as soon as we can.

Regards

robertolopezlopez commented 3 years ago

hi @rohanpm ,

Thank you once again. In previous release (1.2.0) we tried to solve this issue by including those resource files in MANIFEST.in. Unfortunately, due to not putting each of them in a separate line, they were not properly included in the release. This has been finally fixed in our latest release.

Regards,

Roberto