Merge lp:~cjwatson/txpkgupload/twisted-18.4.0 into lp:~lazr-developers/txpkgupload/trunk

Proposed by Colin Watson
Status: Merged
Merged at revision: 43
Proposed branch: lp:~cjwatson/txpkgupload/twisted-18.4.0
Merge into: lp:~lazr-developers/txpkgupload/trunk
Diff against target: 132 lines (+19/-20)
4 files modified
requirements.txt (+4/-4)
src/txpkgupload/tests/test_plugin.py (+7/-10)
src/txpkgupload/tests/test_twistedsftp.py (+5/-5)
src/txpkgupload/twistedsftp.py (+3/-1)
To merge this branch: bzr merge lp:~cjwatson/txpkgupload/twisted-18.4.0
Reviewer Review Type Date Requested Status
Adam Collard (community) Approve
LAZR Developers Pending
Review via email: mp+348938@code.launchpad.net

Commit message

Upgrade to Twisted 18.4.0.

Description of the change

I also upgraded testtools and fixtures while I was here.

To post a comment you must log in.
Revision history for this message
Adam Collard (adam-collard) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'requirements.txt'
2--- requirements.txt 2018-07-02 12:43:42 +0000
3+++ requirements.txt 2018-07-04 10:41:54 +0000
4@@ -7,8 +7,8 @@
5 constantly==15.1.0
6 cryptography==2.1.4
7 enum34==1.1.6
8-extras==0.0.3
9-fixtures==0.3.12
10+extras==1.0.0
11+fixtures==3.0.0
12 FormEncode==1.2.4
13 gmpy==1.17
14 httplib2==0.8
15@@ -37,9 +37,9 @@
16 PyYAML==3.10
17 six==1.9.0
18 testresources==0.2.7
19-testtools==1.8.1
20+testtools==2.3.0
21 traceback2==1.4.0
22-Twisted[conch]==17.9.0
23+Twisted[conch]==18.4.0
24 unittest2==1.0.1
25 wadllib==1.3.2
26 wsgi-intercept==0.5.1
27
28=== modified file 'src/txpkgupload/tests/test_plugin.py'
29--- src/txpkgupload/tests/test_plugin.py 2018-07-04 09:58:55 +0000
30+++ src/txpkgupload/tests/test_plugin.py 2018-07-04 10:41:54 +0000
31@@ -23,11 +23,11 @@
32 from lazr.sshserver.auth import NoSuchPersonWithName
33 from testtools import TestCase
34 from testtools.compat import reraise
35-from testtools.deferredruntest import AsynchronousDeferredRunTest
36 from testtools.matchers import (
37 MatchesException,
38 Raises,
39 )
40+from testtools.twistedsupport import AsynchronousDeferredRunTest
41 from twisted.application.service import (
42 Application,
43 IService,
44@@ -129,7 +129,7 @@
45
46 def test_load(self):
47 # Configuration can be loaded and parsed from a file.
48- filename = os.path.join(self.useFixture(TempDir()).path, "config.yaml")
49+ filename = self.useFixture(TempDir()).join("config.yaml")
50 with open(filename, "w") as stream:
51 stream.write('access_log: "/some/where.log"')
52 observed = Config.load(filename)
53@@ -195,8 +195,7 @@
54 def logfile(self):
55 return os.path.join(self.root, "txpkgupload.log")
56
57- def setUp(self):
58- super(PkgUploadFixture, self).setUp()
59+ def _setUp(self):
60 self.root = self.useFixture(TempDir()).path
61 top = os.path.join(
62 os.path.dirname(__file__), os.pardir, os.pardir, os.pardir)
63@@ -273,8 +272,7 @@
64 config = yaml.load(stream)
65 self.port = config["ftp"]["port"]
66
67- def setUp(self):
68- super(FTPServer, self).setUp()
69+ def _setUp(self):
70 os.mkdir(self.fsroot)
71 os.mkdir(self.temp_dir)
72 self.pkgupload = self.useFixture(PkgUploadFixture(dedent("""\
73@@ -402,8 +400,7 @@
74 self.useFixture(EnvironmentVariableFixture('SSH_AUTH_SOCK', None))
75 self.useFixture(EnvironmentVariableFixture('BZR_SSH', 'paramiko'))
76
77- def setUp(self):
78- super(SFTPServer, self).setUp()
79+ def _setUp(self):
80 self.authserver = FakeAuthServerService()
81 self.authserver_listener = reactor.listenTCP(
82 0, server.Site(self.authserver))
83@@ -712,9 +709,9 @@
84 yield self.server.createFile(client, "foo/bar/baz", "fake contents")
85 directory = yield client.openDirectory(".")
86 try:
87- entry = yield directory.next()
88+ entry = yield next(directory)
89 raise AssertionError("Directory not empty")
90- except EOFError:
91+ except StopIteration:
92 pass
93 yield directory.close()
94
95
96=== modified file 'src/txpkgupload/tests/test_twistedsftp.py'
97--- src/txpkgupload/tests/test_twistedsftp.py 2018-07-04 09:58:55 +0000
98+++ src/txpkgupload/tests/test_twistedsftp.py 2018-07-04 10:41:54 +0000
99@@ -24,12 +24,12 @@
100 class TestSFTPServer(testtools.TestCase):
101
102 def setUp(self):
103- temp_dir = self.useFixture(fixtures.TempDir()).path
104- fs_root = os.path.join(temp_dir, "incoming")
105- temp_dir = os.path.join(temp_dir, "tmp-incoming")
106+ temp_dir = self.useFixture(fixtures.TempDir())
107+ fs_root = temp_dir.join("incoming")
108+ temp_incoming = temp_dir.join("tmp-incoming")
109 os.mkdir(fs_root)
110- os.mkdir(temp_dir)
111- self.sftp_server = SFTPServer(MockAvatar(fs_root, temp_dir))
112+ os.mkdir(temp_incoming)
113+ self.sftp_server = SFTPServer(MockAvatar(fs_root, temp_incoming))
114 super(TestSFTPServer, self).setUp()
115
116 def assertPermissions(self, expected, file_name):
117
118=== modified file 'src/txpkgupload/twistedsftp.py'
119--- src/txpkgupload/twistedsftp.py 2018-07-04 10:04:49 +0000
120+++ src/txpkgupload/twistedsftp.py 2018-07-04 10:41:54 +0000
121@@ -132,9 +132,11 @@
122 def __iter__(self):
123 return self
124
125- def next(self):
126+ def __next__(self):
127 raise StopIteration
128
129+ next = __next__
130+
131 def close(self):
132 pass
133

Subscribers

People subscribed via source and target branches

to all changes: