Skip to content

Commit

Permalink
Merge pull request #8 from Grokzen/master
Browse files Browse the repository at this point in the history
Tox & pep8
  • Loading branch information
konomae committed Aug 24, 2014
2 parents 6cd0cc0 + 7efb41c commit 65b7f2b
Show file tree
Hide file tree
Showing 11 changed files with 941 additions and 891 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ example/credentials.json

*.egg-info/
dist/

.tox
11 changes: 9 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ python:
install:
- "pip install -r requirements.txt"
- "pip install coveralls"
- "if [[ $TEST_PEP8 == '1' ]]; then pip install pep8; fi"
script:
- "nosetests --with-coverage --cover-package=."
- "if [[ $TEST_PEP8 == '1' ]]; then pep8 --repeat --show-source --exclude=.venv,.tox,dist,docs,build,lastpass_python.egg-info,.git --ignore=E501 .; else nosetests --with-coverage --cover-package=lastpass; fi"
after_success:
- "coveralls"
- "if [[ $TEST_PEP8 == '1' ]]; then echo 'No coverage report when running pep8' ; else coveralls ; fi"
matrix:
include:
- python: "2.7"
env: TEST_PEP8=1
- python: "3.4"
env: TEST_PEP8=1
24 changes: 24 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,30 @@ Example
print(i.id, i.username, i.password, i.url)
Testing
-------

Install test dependencies

.. code-block:: bash
$ pip install -r requirements.txt
Run tests with

.. code-block:: bash
$ nosetests
or test all environments and pep8 with tox

.. code-block:: bash
$ tox
License
-------

Expand Down
2 changes: 1 addition & 1 deletion lastpass/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
__version__ = '0.1.0'

# lastpass-ruby's version
VERSION = '1.2.0'
VERSION = '1.2.0'
5 changes: 4 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
requests>=1.2.1,<=3.0.0
pycrypto==2.6.1
mock==1.0.1
mock==1.0.1
tox==1.7.2
nose==1.3.4
coverage==3.7.1
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ def get_version():
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: Implementation :: CPython',
],
)
)
2 changes: 1 addition & 1 deletion tests/test_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ def test_url_returns_the_correct_value(self):
self.assertEqual(self.account.url, self.url)

def test_group_returns_the_correct_value(self):
self.assertEqual(self.account.group, self.group)
self.assertEqual(self.account.group, self.group)
2 changes: 1 addition & 1 deletion tests/test_blob.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ def test_key_iteration_count_returns_the_correct_value(self):
self.assertEqual(self.blob.key_iteration_count, self.key_iteration_count)

def test_encryption_key_returns_the_correct_value(self):
self.assertEqual(self.blob.encryption_key(self.username, self.password), self.encryption_key)
self.assertEqual(self.blob.encryption_key(self.username, self.password), self.encryption_key)
1,765 changes: 883 additions & 882 deletions tests/test_data.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/test_vault.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ def test_accounts_type_is_collect(self):
self.assertIsInstance(self.vault.accounts, list)

def test_accounts_have_correct_ids(self):
self.assertListEqual([a.id for a in self.vault.accounts], [a.id for a in TEST_ACCOUNTS])
self.assertListEqual([a.id for a in self.vault.accounts], [a.id for a in TEST_ACCOUNTS])
15 changes: 15 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Tox (http://tox.testrun.org/) is a tool for running tests in
# multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip
# install tox" and then run "tox" from this directory.

[tox]
envlist = py27, py33, py34, pep8

[testenv]
commands = pip install -r requirements.txt
nosetests --with-coverage --cover-package=lastpass

[testenv:pep8]
deps = pep8
commands = pep8 --repeat --show-source --exclude=.venv,.tox,dist,docs,build,*.egg,.git --ignore=E501 .

0 comments on commit 65b7f2b

Please sign in to comment.