lists.arthurdejong.org
RSS feed

python-pskc branch master updated. 1.0-3-g2698657

[Date Prev][Date Next] [Thread Prev][Thread Next]

python-pskc branch master updated. 1.0-3-g2698657



This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "python-pskc".

The branch, master has been updated
       via  269865713b7761366e501787b0a552d76590c396 (commit)
       via  82fa3bdcf202ab66cc6bb7790807ad5d0f0b56fe (commit)
       via  2693495ad3c2ab8d4078d96610295acc9280db7e (commit)
      from  fe63c4221abb55610a5348b89341f36be8ca4ff9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://arthurdejong.org/git/python-pskc/commit/?id=269865713b7761366e501787b0a552d76590c396

commit 269865713b7761366e501787b0a552d76590c396
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Thu Feb 8 20:34:11 2018 +0100

    Add a Travis configuration file

diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..e59b66f
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,23 @@
+language: python
+cache: pip
+sudo: false
+python:
+  - 2.7
+  - 3.4
+  - 3.5
+  - 3.6
+  - pypy
+env:
+  - FLAVOUR=signxml
+  - FLAVOUR=legacy
+  - FLAVOUR=legacy-defusedxml
+  - FLAVOUR=lxml
+  - FLAVOUR=lxml-defusedxml
+matrix:
+  include:
+  - python: 3.5
+    env: TOXENV=flake8
+  - python: 3.5
+    env: TOXENV=docs
+install: pip install tox
+script: tox -e "${TOXENV:-$(echo py${TRAVIS_PYTHON_VERSION}-${FLAVOUR} | tr -d 
. | sed -e 's/pypypy/pypy/')}"

https://arthurdejong.org/git/python-pskc/commit/?id=82fa3bdcf202ab66cc6bb7790807ad5d0f0b56fe

commit 82fa3bdcf202ab66cc6bb7790807ad5d0f0b56fe
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Sun Feb 4 14:04:09 2018 +0100

    Fix code style issues
    
    Fixes 1ff3237f, 84bfb8a6 and 20bf9c5

diff --git a/pskc/encryption.py b/pskc/encryption.py
index 6a1358f..77d43c1 100644
--- a/pskc/encryption.py
+++ b/pskc/encryption.py
@@ -340,7 +340,7 @@ class Encryption(object):
             self.algorithm = 'aes128-cbc'
         # default to encrypting the secret only
         if not self.fields:
-            self.fields = ['secret', ]
+            self.fields = ['secret']
         # if we're using a CBC mode of encryption, add a MAC
         if self.algorithm.endswith('-cbc'):
             self.pskc.mac.setup()
diff --git a/pskc/serialiser.py b/pskc/serialiser.py
index 99019c8..51dcd70 100644
--- a/pskc/serialiser.py
+++ b/pskc/serialiser.py
@@ -135,7 +135,7 @@ class PSKCSerialiser(object):
     @classmethod
     def serialise_key(cls, key, key_package):
         key_elm = mk_elem(key_package, 'pskc:Key', empty=True, Id=key.id,
-                          Algorithm=key.algorithm, )
+                          Algorithm=key.algorithm)
         mk_elem(key_elm, 'pskc:Issuer', key.issuer)
         if any((key.algorithm_suite, key.challenge_encoding,
                 key.response_encoding, key.response_length)):
diff --git a/pskc2csv.py b/pskc2csv.py
index 6bff0e4..57dee1c 100755
--- a/pskc2csv.py
+++ b/pskc2csv.py
@@ -31,7 +31,6 @@ import sys
 from binascii import a2b_hex, b2a_hex
 
 import pskc
-from pskc.exceptions import DecryptionError
 
 
 version_string = '''

https://arthurdejong.org/git/python-pskc/commit/?id=2693495ad3c2ab8d4078d96610295acc9280db7e

commit 2693495ad3c2ab8d4078d96610295acc9280db7e
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Fri Dec 29 22:01:38 2017 +0100

    Fixes to test suite
    
    This ensures that the tests also work without a TTY and work regardless
    of the PYTHONWARNINGS and TZ environment variables
    
    Fixes cd33833

diff --git a/tests/test_misc.doctest b/tests/test_misc.doctest
index 320982b..246ece1 100644
--- a/tests/test_misc.doctest
+++ b/tests/test_misc.doctest
@@ -273,12 +273,14 @@ property.
 >>> pskc = PSKC()
 >>> key = pskc.add_key()
 >>> with warnings.catch_warnings(record=True) as w:
+...     warnings.simplefilter('always')
 ...     key.policy.pin_max_failed_attemtps = 10
 ...     assert len(w) == 1
 ...     assert issubclass(w[0].category, DeprecationWarning)
 >>> key.policy.pin_max_failed_attempts
 10
 >>> with warnings.catch_warnings(record=True) as w:
+...     warnings.simplefilter('always')
 ...     key.policy.pin_max_failed_attemtps
 ...     assert len(w) == 1
 ...     assert issubclass(w[0].category, DeprecationWarning)
diff --git a/tests/test_pskc2csv.doctest b/tests/test_pskc2csv.doctest
index 38396d9..a97e297 100644
--- a/tests/test_pskc2csv.doctest
+++ b/tests/test_pskc2csv.doctest
@@ -43,6 +43,23 @@ Traceback (most recent call last):
 SystemExit: 0
 
 
+We hack stdin to lie about being a TTY to ensure the password propmpt are
+always presented.
+
+>>> class TTYFile(object):
+...     def __init__(self, f):
+...         self.f = f
+...
+...     def isatty(self):
+...         return True
+...
+...     def __getattr__(self, attr):
+...          return getattr(self.f, attr)
+>>> sys.stdin = TTYFile(sys.stdin)
+>>> sys.stdin.isatty()
+True
+
+
 We can output a CSV file with some columns with the just default arguments.
 
 >>> sys.argv = shlex.split('pskc2csv tests/rfc6030/figure5.pskcxml')
diff --git a/tox.ini b/tox.ini
index b33a31c..7a3e049 100644
--- a/tox.ini
+++ b/tox.ini
@@ -13,6 +13,7 @@ commands = signxml: nosetests
            lxml: nosetests --exclude=test_signature.doctest 
--cover-min-percentage 95
 setenv=
     PYTHONWARNINGS=all
+    TZ=Europe/Amsterdam
 
 [testenv:flake8]
 skip_install = true

-----------------------------------------------------------------------

Summary of changes:
 .travis.yml                 | 23 +++++++++++++++++++++++
 pskc/encryption.py          |  2 +-
 pskc/serialiser.py          |  2 +-
 pskc2csv.py                 |  1 -
 tests/test_misc.doctest     |  2 ++
 tests/test_pskc2csv.doctest | 17 +++++++++++++++++
 tox.ini                     |  1 +
 7 files changed, 45 insertions(+), 3 deletions(-)
 create mode 100644 .travis.yml


hooks/post-receive
-- 
python-pskc
-- 
To unsubscribe send an email to
python-pskc-commits-unsubscribe@lists.arthurdejong.org or see
https://lists.arthurdejong.org/python-pskc-commits/