diff --git a/.gitignore b/.gitignore index b147166..0900e28 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ dist .ropeproject .eggs __pycache__ +coverage.xml diff --git a/.travis.yml b/.travis.yml index 27191ce..92507a9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,6 @@ language: python python: - "2.7" - - "3.2" - - "3.3" - "3.4" - "3.5" - "3.5-dev" # 3.5 development branch @@ -12,5 +10,9 @@ install: # command to run tests script: - paver lint - - paver nosetests + - paver coverage - PATH=$PWD/bin:$PATH paver bats + +addons: + code_climate: + repo_token: f12006bd2fc1828b90e76ba38458b741fbf1f6ec67b46d4653a40814b17d23e0 diff --git a/README.rst b/README.rst index 89febcf..6dff45c 100644 --- a/README.rst +++ b/README.rst @@ -1,6 +1,18 @@ Serverauditor ssh config utility ================================ +.. image:: https://travis-ci.org/Crystalnix/serverauditor-sshconfig.svg?branch=master + :target: https://travis-ci.org/Crystalnix/serverauditor-sshconfig + +.. image:: https://codeclimate.com/github/Crystalnix/serverauditor-sshconfig/badges/gpa.svg + :target: https://codeclimate.com/github/Crystalnix/serverauditor-sshconfig + :alt: Code Climate + +.. image:: https://codeclimate.com/github/Crystalnix/serverauditor-sshconfig/badges/coverage.svg + :target: https://codeclimate.com/github/Crystalnix/serverauditor-sshconfig/coverage + :alt: Test Coverage + + Installation ------------ diff --git a/dev-requirements.txt b/dev-requirements.txt index 3c6ac9d..63dafda 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -3,6 +3,3 @@ nose coverage prospector[with_pyroma] paver -ptpython -pudb -pre-commit diff --git a/pavement.py b/pavement.py index e429d89..15fc47c 100644 --- a/pavement.py +++ b/pavement.py @@ -21,7 +21,14 @@ def bats(): @task def nosetests(): """Run unit tests.""" - sh('python setup.py test') + sh('nosetests') + + +@task +def coverage(): + """Run test and collect coverage.""" + sh('nosetests --with-coverage') + sh('coverage xml') @task diff --git a/serverauditor_sshconfig/cloud/client/cryptor.py b/serverauditor_sshconfig/cloud/client/cryptor.py index 4dd80ba..4c35c8b 100644 --- a/serverauditor_sshconfig/cloud/client/cryptor.py +++ b/serverauditor_sshconfig/cloud/client/cryptor.py @@ -63,7 +63,7 @@ def hmac_salt(self, value): @property def initialization_vector(self): """Generate random bytes.""" - return os.urandom(self.AES_BLOCK_SIZE / 8) + return os.urandom(int(self.AES_BLOCK_SIZE / 8)) @property def encryption_key(self): diff --git a/tox.ini b/tox.ini index be42d42..fc12799 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ # and then run "tox" from this directory. [tox] -envlist = py27,py34 +envlist = py27,py35 skipsdist = True [testenv]