[lxc-devel] [pylxd/master] Integration cleanup
rockstar on Github
lxc-bot at linuxcontainers.org
Thu Jun 23 23:05:20 UTC 2016
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 614 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160623/e21542f3/attachment.bin>
-------------- next part --------------
From 8a37d59fa643eeb6f660c5162866c79ae7553fe5 Mon Sep 17 00:00:00 2001
From: Paul Hummer <paul.hummer at canonical.com>
Date: Thu, 23 Jun 2016 16:33:03 -0600
Subject: [PATCH 1/3] Pin ws4py to not use 0.3.5
---
requirements.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index 66e56a2..62882d4 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,7 +1,7 @@
pbr>=1.6
python-dateutil>=2.4.2
six>=1.9.0
-ws4py>=0.3.4
+ws4py!=0.3.5,>=0.3.4 # 0.3.5 is broken for websocket support
requests!=2.8.0,>=2.5.2
requests-unixsocket>=0.1.5
cryptography>=1.4
From 4cb91bc7574c0d1bd5e72463a8ca803a23147bb1 Mon Sep 17 00:00:00 2001
From: Paul Hummer <paul.hummer at canonical.com>
Date: Thu, 23 Jun 2016 16:52:04 -0600
Subject: [PATCH 2/3] Remove deprecated codepaths from the integration tests
---
integration/test_containers.py | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/integration/test_containers.py b/integration/test_containers.py
index cc9053e..1470b7e 100644
--- a/integration/test_containers.py
+++ b/integration/test_containers.py
@@ -116,29 +116,29 @@ def test_snapshot(self):
# NOTE: rockstar (15 Feb 2016) - Once again, multiple things
# asserted in the same test.
name = 'an-snapshot'
- self.container.snapshot(name, wait=True)
+ snapshot = self.container.snapshots.create(name, wait=True)
- self.assertEqual([name], self.container.list_snapshots())
+ self.assertEqual([name], [s.name for s in self.container.snapshots.all()])
new_name = 'an-other-snapshot'
- self.container.rename_snapshot(name, new_name, wait=True)
+ snapshot.rename(new_name, wait=True)
- self.assertEqual([new_name], self.container.list_snapshots())
+ self.assertEqual([new_name], [s.name for s in self.container.snapshots.all()])
- self.container.delete_snapshot(new_name, wait=True)
+ snapshot.delete(wait=True)
- self.assertEqual([], self.container.list_snapshots())
+ self.assertEqual([], self.container.snapshots.all())
def test_put_get_file(self):
"""A file is written to the container and then read."""
filepath = '/tmp/an_file'
data = b'abcdef'
- retval = self.container.put_file(filepath, data)
+ retval = self.container.files.put(filepath, data)
self.assertTrue(retval)
- contents = self.container.get_file(filepath)
+ contents = self.container.files.get(filepath)
self.assertEqual(data, contents)
From 5c96f29a1b1704dd14ca45481b5bcb0708994fff Mon Sep 17 00:00:00 2001
From: Paul Hummer <paul.hummer at canonical.com>
Date: Thu, 23 Jun 2016 16:54:39 -0600
Subject: [PATCH 3/3] Fix lint
---
integration/test_containers.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/integration/test_containers.py b/integration/test_containers.py
index 1470b7e..4e1f552 100644
--- a/integration/test_containers.py
+++ b/integration/test_containers.py
@@ -118,12 +118,14 @@ def test_snapshot(self):
name = 'an-snapshot'
snapshot = self.container.snapshots.create(name, wait=True)
- self.assertEqual([name], [s.name for s in self.container.snapshots.all()])
+ self.assertEqual(
+ [name], [s.name for s in self.container.snapshots.all()])
new_name = 'an-other-snapshot'
snapshot.rename(new_name, wait=True)
- self.assertEqual([new_name], [s.name for s in self.container.snapshots.all()])
+ self.assertEqual(
+ [new_name], [s.name for s in self.container.snapshots.all()])
snapshot.delete(wait=True)
More information about the lxc-devel
mailing list