From 994f783adf7992adb36fdf0dc7783816ef66cff0 Mon Sep 17 00:00:00 2001 From: Abhay Kadam Date: Mon, 23 Dec 2019 18:25:34 +0530 Subject: [PATCH] fix the automation testing --- .eggs/README.txt | 6 ++++++ .github/workflows/pythonpackage.yml | 6 +++--- example.py | 11 ++++++----- pypodio2/areas.py | 4 ++++ setup.py | 10 +++++++++- tox.ini | 17 +++++++++++------ 6 files changed, 39 insertions(+), 15 deletions(-) create mode 100644 .eggs/README.txt diff --git a/.eggs/README.txt b/.eggs/README.txt new file mode 100644 index 0000000..5d01668 --- /dev/null +++ b/.eggs/README.txt @@ -0,0 +1,6 @@ +This directory contains eggs that were downloaded by setuptools to build, test, and run plug-ins. + +This directory caches those eggs to prevent repeated downloads. + +However, it is safe to delete this directory. + diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index e2ce2bd..10b7ab2 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -9,7 +9,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: [2.7, 3.5, 3.6, 3.7] + python-version: [2.7, 3.5, 3.6, 3.7, 3.8] steps: - uses: actions/checkout@v1 @@ -26,5 +26,5 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with Nose run: | - python setup.py test - + pip install tox tox-gh-actions + tox diff --git a/example.py b/example.py index d6f1358..6cc9c08 100644 --- a/example.py +++ b/example.py @@ -21,13 +21,14 @@ #To create an item item = { - "fields":[ - {"external_id":"org-name", "values":[{"value":"The Items API sucks"}]} - ] + "fields":[ + {"external_id":"org-name", "values":[{"value":"The Items API sucks"}]} + ] } -#print c.Application.find(179652) + +app_id = c.Application.find(179652) c.Item.create(app_id, item) - + #Undefined and created at runtime example #print c.transport.GET.user.status() diff --git a/pypodio2/areas.py b/pypodio2/areas.py index f4ce6c9..55c6fb9 100644 --- a/pypodio2/areas.py +++ b/pypodio2/areas.py @@ -11,6 +11,10 @@ from urllib.parse import urlencode +class ApiErrorException(Exception): + pass + + class Area(object): """Represents a Podio Area""" def __init__(self, transport): diff --git a/setup.py b/setup.py index 0a818a7..f59959c 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,13 @@ from setuptools import setup +extras = { + 'test': [ + 'mock', + 'nose', + 'tox', + ] +} + setup( name="pypodio2", version="1.0.0b0", @@ -13,7 +21,7 @@ "httplib2", "future", ], - tests_require=["nose", "mock", "tox"], + extras_require=extras, test_suite="nose.collector", classifiers=[ "Development Status :: 4 - Beta", diff --git a/tox.ini b/tox.ini index 93db941..8f8eb14 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,14 @@ [tox] -envlist = py27,py35 +envlist = py27,py35,py36,py37,py38 + +[gh-actions] +python = + 2.7: py27 + 3.5: py35 + 3.6: py36 + 3.7: py37 + 3.8: py38 [testenv] -commands = {envpython} setup.py nosetests -deps = - nose - mock - httplib2 +extras = test +commands = {posargs:nosetests}