Skip to content

Commit

Permalink
oops we didn't declare a six dependency!!
Browse files Browse the repository at this point in the history
  • Loading branch information
jrabbit committed Jun 27, 2017
1 parent 6c56fa4 commit 73291fe
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
description="A python client library for taskwarrior's taskd",
license="GPL v3+",
zip_safe=False,
install_requires=["six"],
url="https://github.com/jrabbit/taskd-client-py",
keywords=['taskwarrior', 'taskd', 'client'],
classifiers=["License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
Expand Down
2 changes: 1 addition & 1 deletion taskc/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.3b2"
__version__ = "0.0.3"
4 changes: 4 additions & 0 deletions taskc/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ def _connect(self):
context.load_verify_locations(cafile=self.cacert_file)
elif self.cacert:
print(self.cacert) # TODO: Replace prints with logging
if six.PY2:
raise NotImplementedError

logger.info("Got CA cert as data/string type: %s", type(self.cacert))
context.load_verify_locations(cadata=self.cacert)

# enable for non-selfsigned certs
Expand Down
15 changes: 14 additions & 1 deletion taskc/test_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
except ImportError:
import mock

logging.basicConfig(level=logging.DEBUG)
logging.basicConfig(level=logging.INFO)

class TestRCParse(unittest.TestCase):

Expand Down Expand Up @@ -129,6 +129,19 @@ def test_put(self):
resp = self.tc.put(tasks)
self.assertEqual(resp.status_code, 200)
# might not be correct depends on state of taskd

def test_cadata(self):
"This doesn't work in python2.7??"
self.tc.cacert_file = False
with open("taskc/fixture/pki/ca.cert.pem") as ca:
self.tc.cacert = ca.read()
self.tc._connect()
# print self.tc.conn.getpeername()
self.assertEqual(self.tc.conn.getpeername(), ('127.0.0.1', self.tc.port))
# make sure we're on TLS v2 per spec
self.assertEqual(self.tc.conn.context.protocol, 2)
self.tc.conn.close()

def tearDown(self):
print(self.docker.logs(self.container['Id'], stdout=True, stderr=True))
self.docker.remove_container(self.container['Id'], force=True)
Expand Down

0 comments on commit 73291fe

Please sign in to comment.