Itamar Turner-Trauring
9919d2c9a7
Record port status.
2020-07-27 11:46:03 -04:00
Itamar Turner-Trauring
436c2e77e4
Automated port to Python 3.
2020-07-27 11:44:58 -04:00
Itamar Turner-Trauring
fce7221481
Some steps to manually port to Python 3.
2020-07-27 11:42:20 -04:00
Itamar Turner-Trauring
1f34e62987
Port test module to Python 3.
2020-07-27 11:14:01 -04:00
Maciej Fijalkowski
13e292295e
Revert "futurize and make the tests pass back under py2"
...
This reverts commit 361de05980
.
2020-07-25 11:22:03 +02:00
Maciej Fijalkowski
361de05980
futurize and make the tests pass back under py2
2020-07-25 11:12:43 +02:00
Itamar Turner-Trauring
bf13401979
Move SignalMixin to common_py3.py.
2020-07-24 14:58:08 -04:00
Itamar Turner-Trauring
025afc1efe
Merge branch '3357.version_checks-py3' into 3356.iputil-python-3
2020-07-24 14:50:50 -04:00
Itamar Turner-Trauring
11cd30c425
Merge remote-tracking branch 'origin/master' into 3357.version_checks-py3
2020-07-24 14:50:39 -04:00
Itamar Turner-Trauring
e80f138868
Fix indent.
2020-07-24 14:48:56 -04:00
Itamar Turner-Trauring
e0d3e46683
Merge remote-tracking branch 'origin/master' into 3351.spans-python-3
2020-07-24 14:48:33 -04:00
Itamar Turner-Trauring
4c6a9a5610
Merge branch '3357.version_checks-py3' into 3356.iputil-python-3
2020-07-24 14:36:31 -04:00
Itamar Turner-Trauring
337a4381bb
Finish port to Python 3.
2020-07-24 14:31:36 -04:00
Itamar Turner-Trauring
65500de72f
Merge remote-tracking branch 'origin/master' into 3346.abbreviate-and-time_format-py3
2020-07-24 14:13:28 -04:00
Itamar Turner-Trauring
f84d51d795
Port to Python 3.
2020-07-24 14:12:10 -04:00
Itamar Turner-Trauring
04db52b9e4
Some manual tweaks to be more likely to work with Python 3.
...
The Linux distribution porting code was obsolete (using Python APIs not present
in Python 3, /etc/lsb-release isn't a thing on Fedora 31, for example), so
replaced it with maintained third-party library.
2020-07-24 14:06:12 -04:00
Itamar Turner-Trauring
45a891114b
Fix some things that prevent Python 3 imports.
2020-07-24 13:48:11 -04:00
Itamar Turner-Trauring
135ade02b1
Start porting.
2020-07-24 13:47:56 -04:00
Itamar Turner-Trauring
8bcd6dd34b
Merge branch 'master' into 3346.abbreviate-and-time_format-py3
2020-07-24 11:10:38 -04:00
Itamar Turner-Trauring
38648c0f8f
Fix indentation
2020-07-24 11:09:08 -04:00
Itamar Turner-Trauring
dd4737f20c
Merge branch 'master' into 3353.observer-and-pipeline-py3
2020-07-24 11:08:08 -04:00
Itamar Turner-Trauring
d23394b35c
Merge remote-tracking branch 'origin/master' into 3346.abbreviate-and-time_format-py3
2020-07-23 12:27:06 -04:00
Itamar Turner-Trauring
ab4393b50e
Document unicode.
2020-07-23 11:49:02 -04:00
Itamar Turner-Trauring
cab1b02ba2
Use constants, since we have them.
2020-07-23 11:47:12 -04:00
Itamar Turner-Trauring
b0083e342b
Document being ported.
2020-07-23 11:47:06 -04:00
Itamar Turner-Trauring
eb688dfd7e
Fix lint.
2020-07-22 13:22:50 -04:00
Itamar Turner-Trauring
64e4af2d05
Port to Python 3.
2020-07-22 13:17:49 -04:00
Itamar Turner-Trauring
15254d08fc
A few more explicit byte strings.
2020-07-22 13:11:05 -04:00
Itamar Turner-Trauring
85c8ca6d77
Merge branch '3344.netstring-and-hashutil-to-python-3' into 3354.hashtree-to-python-3
2020-07-22 13:09:58 -04:00
Itamar Turner-Trauring
5129e1ef14
Explicitly mark bytestrings.
2020-07-22 13:08:24 -04:00
Itamar Turner-Trauring
e48aecfa1a
Move parsing tests to better location, and fix them.
2020-07-22 12:55:16 -04:00
Itamar Turner-Trauring
0763f9f90b
Port to Python 3.
2020-07-22 10:36:50 -04:00
Itamar Turner-Trauring
e427163ec8
Move pipeline tests into their own module.
2020-07-22 10:33:23 -04:00
Itamar Turner-Trauring
b4e6686211
Port to Python 3.
2020-07-22 10:29:44 -04:00
Itamar Turner-Trauring
2f608e8216
Merge remote-tracking branch 'origin/master' into 3346.abbreviate-and-time_format-py3
2020-07-22 10:11:27 -04:00
Itamar Turner-Trauring
51e9c2183c
Add missing file.
2020-07-22 10:00:15 -04:00
Itamar Turner-Trauring
2391bd9733
Merge remote-tracking branch 'origin/master' into 3351.spans-python-3
2020-07-22 09:57:08 -04:00
Itamar Turner-Trauring
e9eb93468f
Finish port to Python 3.
2020-07-22 09:56:59 -04:00
Itamar Turner-Trauring
3a8bafafc3
Merge remote-tracking branch 'origin/master' into 3344.netstring-and-hashutil-to-python-3
2020-07-22 09:36:34 -04:00
Itamar Turner-Trauring
ab24e9abb1
Manual porting to Python 3.
2020-07-21 15:14:52 -04:00
Itamar Turner-Trauring
d6f24af424
Move span tests into their own module.
2020-07-21 15:14:39 -04:00
Itamar Turner-Trauring
fa567841b5
Merge remote-tracking branch 'origin/master' into 3342-base32-and-base62-to-python-3
2020-07-21 14:40:33 -04:00
Itamar Turner-Trauring
6de05941b9
Remove unnecessary imports.
2020-07-21 14:27:08 -04:00
Itamar Turner-Trauring
4018b772a3
Port abbreviate.py. As far as I can tell, all division is already float division.
2020-07-21 14:15:39 -04:00
Itamar Turner-Trauring
116f232e80
Port time_format to Python 3.
2020-07-21 14:08:31 -04:00
Itamar Turner-Trauring
7e8de10ea3
Merge branch '3342-base32-and-base62-to-python-3' into 3344.netstring-and-hashutil-to-python-3
2020-07-21 14:00:53 -04:00
Itamar Turner-Trauring
c229ba7196
Workaround future/pypy incompatibility.
2020-07-21 13:55:53 -04:00
meejah
30a91a1106
public RSA exponent 17 -> 65537
2020-07-21 00:29:35 -06:00
Sajith Sasidharan
e145c7b00d
Merge pull request #722 from sajith/3254.status-status-nevow-to-twisted-web
...
Replace nevow with twisted.web.template in status.Status
Fixes: ticket:3254
2020-07-20 11:28:18 -04:00
Sajith Sasidharan
26ca9ae724
Merge pull request #726 from sajith/3313.operations-ophandle-table-nevow-to-twisted
...
Replace nevow with twisted.web in operations.OphandleTable
Fixes: ticket:3313
2020-07-19 08:14:32 -04:00
Sajith Sasidharan
c58cf56e83
Remove unused imports
2020-07-18 08:34:25 -04:00
Sajith Sasidharan
0f835e94f5
Merge 'origin/master' into 3254.status-status-nevow-to-twisted-web
2020-07-18 07:53:36 -04:00
Sajith Sasidharan
6dec821271
Merge pull request #720 from sajith/3288.status-download-nevow-to-twisted-web
...
Replace nevow with twisted.web.template in status.DownloadStatusPage
Fixes: ticket:3288
2020-07-18 07:22:37 -04:00
Sajith Sasidharan
879a8012a0
Remove unused import
2020-07-18 06:48:36 -04:00
Sajith Sasidharan
c198c006e3
Avoid over-long lines
2020-07-17 21:02:24 -04:00
Sajith Sasidharan
fe07ab39da
Use docstrings
2020-07-17 16:22:23 -04:00
Sajith Sasidharan
c14197e1bc
Make FakeDownloadStatus an instance of DownloadStatus
...
The real DownloadStatus is easy enough to instantiate. Might as well
use that, cutting some crufty code here.
2020-07-17 16:13:07 -04:00
Sajith Sasidharan
293efd7c9f
Use actual status counter number when testing
2020-07-17 13:50:06 -04:00
Sajith Sasidharan
8fd0cf7eb6
Add a test for checking status page links
2020-07-17 13:21:53 -04:00
Sajith Sasidharan
828ec53e24
Update status page test case
...
Link to upload status 0 should contain `/status/` prefix, or it will
navigate to `/up-0` instead of `/status/up-0`, resulting in a 404 not
found message. Same with other statuses too.
2020-07-17 13:21:53 -04:00
Sajith Sasidharan
5c886b1b2d
Format link to status page child node correctly
...
Some Nevow-ism accidentally escaped earlier: link to `/status/up-0`
and so on were actually rendered as `/up-0` and so on.
2020-07-17 13:21:53 -04:00
Sajith Sasidharan
2d19c383ca
Rename a variable for clarity
2020-07-17 13:21:53 -04:00
Sajith Sasidharan
02d8bd061a
Test for trailing slashes after /status/
...
Both `/status` and `/status/` are treated alike; any additional
trailing slashes will be rejected.
2020-07-17 13:21:53 -04:00
Sajith Sasidharan
372cc00a25
Reject non-existent child nodes of /status
...
Requests on both `/status` and `/status/` will be served with the same
status page, but `/status//`, `/status///` and so on will be processed
further down, resulting in a 40x response.
2020-07-17 09:46:21 -04:00
Sajith Sasidharan
fe165cc99d
Do the right thing, not the simple thing
...
Seems that NixOS CI is saying that the simple thing is not the right
thing: "GET /status/down-0" etc all resulted in 404 responses on
NixOS. So we perhaps should use the actual counter value.
2020-07-16 19:07:51 -04:00
Sajith Sasidharan
06c8bbfb19
Use clearer names for tests
2020-07-16 17:25:25 -04:00
Sajith Sasidharan
66dd2d3658
Use docstrings
2020-07-16 17:19:50 -04:00
Sajith Sasidharan
8db60e3486
Do the simple thing when testing status subpaths
2020-07-16 17:16:18 -04:00
Sajith Sasidharan
95642ae02c
Use a helper to check status subpath results
2020-07-16 17:13:36 -04:00
Sajith Sasidharan
e48d930621
Clarify intention of a test case
2020-07-16 16:56:41 -04:00
Sajith Sasidharan
6a2ce9efc6
Use docstrings
2020-07-16 16:55:12 -04:00
Itamar Turner-Trauring
a4620bf176
Automated port of the test module.
2020-07-16 15:58:39 -04:00
Itamar Turner-Trauring
4c047b90e5
Manual steps of port to Python 3.
2020-07-16 15:46:23 -04:00
Itamar Turner-Trauring
e90d1f38d2
Make TimezoneMixin importable on Python 3.
2020-07-16 15:44:41 -04:00
Itamar Turner-Trauring
554be90b7e
Unnecessary code, and was triggering flake8.
2020-07-16 15:27:36 -04:00
Itamar Turner-Trauring
72272cbf0b
Move out tests for time_format.
2020-07-16 15:15:26 -04:00
Itamar Turner-Trauring
545848f164
Move abbreviate tests into their own module.
2020-07-16 14:57:09 -04:00
Itamar Turner-Trauring
4da8e2ddee
Merge branch '3342-base32-and-base62-to-python-3' into 3344.netstring-and-hashutil-to-python-3
2020-07-16 14:42:09 -04:00
Itamar Turner-Trauring
8d143af43e
Another assertion.
2020-07-16 14:40:30 -04:00
Itamar Turner-Trauring
2f693c47f9
Don't leak variable on Python 2.
2020-07-16 14:37:26 -04:00
Itamar Turner-Trauring
efbae9b3e3
Hard code some known values, generated on the master branch preceding these
...
changes.
2020-07-16 14:33:53 -04:00
Itamar Turner-Trauring
7abc54c429
Merge remote-tracking branch 'origin/master' into 3342-base32-and-base62-to-python-3
2020-07-16 14:21:42 -04:00
Jean-Paul Calderone
0ce6e562cb
Merge pull request #742 from chadwhitacre/3325.add-py36-to-ci
...
Add py36 to CI
Fixes: ticket:3325
2020-07-15 20:11:39 -04:00
Jean-Paul Calderone
c493396148
Merge pull request #740 from tahoe-lafs/3340-unused-code-in-util
...
Delete some dead code.
Fixes: ticket:3340
2020-07-15 20:08:41 -04:00
Sajith Sasidharan
80bf5f0a53
Remove an unused import
2020-07-15 19:19:51 -04:00
Sajith Sasidharan
7f93e28a7c
Parameterize classes used in check/repair tests
2020-07-15 18:43:52 -04:00
Sajith Sasidharan
2d7095866a
Expand "deep check and repair results" page test
2020-07-15 17:10:48 -04:00
Sajith Sasidharan
a13ec344b9
Correct usage of SlotsSequenceElement
2020-07-15 17:10:41 -04:00
Sajith Sasidharan
8fedbd52c2
Expand "deep check and repair" test
2020-07-15 16:58:39 -04:00
Sajith Sasidharan
6969366370
Document, use, and test "join pathstring" method
2020-07-15 16:40:05 -04:00
Sajith Sasidharan
589e143a4a
Add an empty renderer
2020-07-15 16:24:11 -04:00
Sajith Sasidharan
e6eb866cef
Add missing "header" renderer
...
It does not do much here, but it is good to be consistent
2020-07-15 16:21:46 -04:00
Sajith Sasidharan
b5a465cc8d
Format "all objects" table correctly
2020-07-15 16:20:36 -04:00
Sajith Sasidharan
07c24dbe59
Add a missing super() call
2020-07-15 16:14:10 -04:00
Itamar Turner-Trauring
6af32fdfa7
Make sure the public API exposes native bytes, not Future bytes.
2020-07-15 15:59:46 -04:00
Itamar Turner-Trauring
ed6e1cb7ef
Fix formatting.
2020-07-15 15:51:09 -04:00
Itamar Turner-Trauring
ed8b10c12f
Finish porting to Python 3.
2020-07-15 15:00:29 -04:00
Itamar Turner-Trauring
4800992de6
Type check assertions.
2020-07-15 14:58:58 -04:00
Itamar Turner-Trauring
fa5b5fa436
Manual part of port to Python 3.
2020-07-15 14:55:56 -04:00
Sajith Sasidharan
69afd292c2
Use a different format for path
...
Seems that _join_pathstring() is the wrong thing to use here.
2020-07-15 13:43:50 -04:00
Sajith Sasidharan
3c079bef73
Expand "deep check results" test
2020-07-15 13:35:22 -04:00
Sajith Sasidharan
f547509332
Use table headers correctly
2020-07-15 13:24:32 -04:00
Sajith Sasidharan
ddfe20c8ab
Use SlotsSequenceElement correctly
2020-07-15 13:24:20 -04:00
Itamar Turner-Trauring
bb7d31c5e4
Futurize part of port to Python 3.
2020-07-15 11:19:57 -04:00
Itamar Turner-Trauring
60a1a24423
Manual portion of port to Python 3.
2020-07-15 11:13:59 -04:00
Itamar Turner-Trauring
e3e29598e4
A couple of missing explicit byte strings.
2020-07-15 11:13:52 -04:00
Itamar Turner-Trauring
cfb11f7f4c
More explicit testing of types.
2020-07-15 11:08:06 -04:00
Itamar Turner-Trauring
093125ca43
Port to Python 3.
2020-07-15 11:05:23 -04:00
Itamar Turner-Trauring
d316ad3ebd
A more explicit test.
2020-07-15 11:02:49 -04:00
Itamar Turner-Trauring
2b89674052
Everything must be bytes.
2020-07-15 11:01:45 -04:00
Itamar Turner-Trauring
9ed91eabb3
Split out hashutil tests into their own module.
2020-07-15 10:58:05 -04:00
Sajith Sasidharan
1ed722494c
Add a FakeServer class for testing
2020-07-15 10:35:56 -04:00
Sajith Sasidharan
6322404b1e
Update "deep check results renderer" test
2020-07-14 21:44:41 -04:00
Sajith Sasidharan
99ce9ff198
Correct argument to SlotsSequenceElement
2020-07-14 21:42:28 -04:00
Sajith Sasidharan
ef26d66e79
Use correct twisted web template directives
2020-07-14 20:50:12 -04:00
Sajith Sasidharan
b4b820ed7b
Use a helper method to get monitor counter
2020-07-14 20:47:23 -04:00
Itamar Turner-Trauring
3688291df2
Handy way to run Python 3 tests, until the ratchet is going.
2020-07-14 13:53:26 -04:00
Itamar Turner-Trauring
5fd01523cf
This module is not a thing.
2020-07-14 13:53:13 -04:00
Itamar Turner-Trauring
21a9ffef7a
Not strings.
2020-07-14 13:46:12 -04:00
Itamar Turner-Trauring
a81e859b82
Fix flake error.
2020-07-14 13:44:56 -04:00
Itamar Turner-Trauring
27d8eb47fc
Test improvements.
2020-07-14 13:44:00 -04:00
Itamar Turner-Trauring
db41d5af6f
Merge pull request #743 from tahoe-lafs/3342-more-tests-for-base32-base62
...
Fixes https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3343
2020-07-14 13:41:20 -04:00
Itamar Turner-Trauring
e0adb3b37d
Port to Python 3.
2020-07-14 13:35:46 -04:00
Itamar Turner-Trauring
b5db85afbe
Initial, manual steps of Python 3 port.
2020-07-14 11:53:40 -04:00
Itamar Turner-Trauring
3abb9e9db4
Rip out a whole bunch of code, either deleting or replacing with stdlib's base32 implementation.
2020-07-14 11:45:05 -04:00
Itamar Turner-Trauring
f3db64ad74
Port to Python 3.
2020-07-14 11:29:09 -04:00
Itamar Turner-Trauring
ab3737d686
Note this module has been ported to Python 3.
2020-07-14 11:28:51 -04:00
Itamar Turner-Trauring
9c428be0e2
Port base62 to Python 3.
2020-07-14 11:24:45 -04:00
Itamar Turner-Trauring
b1e732fb9a
Port test_base62 to Python 3.
2020-07-14 10:34:53 -04:00
Itamar Turner-Trauring
e34a01d547
A couple more asserts.
2020-07-14 10:28:22 -04:00
Itamar Turner-Trauring
459d68118c
Merge branch '3342-more-tests-for-base32-base62' into 3342-base32-and-base62-to-python-3
2020-07-14 10:26:46 -04:00
Itamar Turner-Trauring
f378edd9d8
Fix missing import.
2020-07-14 10:20:51 -04:00
Sajith Sasidharan
54e952ceda
Test for 404 responses from status page subpaths
2020-07-14 09:01:31 -04:00
Chad Whitacre
329bfe05f9
Make a crucial relative import explicit
2020-07-13 22:27:59 -04:00
Sajith Sasidharan
abd539588f
Rename nested functions for clarity
...
... and also to remove embarrassing copy-pasta mistakes.
2020-07-13 20:52:12 -04:00
Sajith Sasidharan
b48556c2cb
Add tests for status subpages
...
Coverage tests for the coverage gods
2020-07-13 20:44:30 -04:00
Itamar Turner-Trauring
ead2a79cf7
Everything should be bytes.
2020-07-13 16:21:15 -04:00
Itamar Turner-Trauring
6464e226c6
Hypothesis-based roundtrip test.
2020-07-13 16:19:48 -04:00
Itamar Turner-Trauring
828e6bc28a
Minimal tests for could_be_base32_encoded().
2020-07-13 16:18:13 -04:00
Itamar Turner-Trauring
77ae087c77
Remove a2b_l and b2a_l from public API, to ease likely future switch to stdlib
...
base64's implementation.
2020-07-13 16:12:53 -04:00
Itamar Turner-Trauring
e23dbcdf56
Document current public API.
2020-07-13 15:41:01 -04:00
Itamar Turner-Trauring
bbfd39e6c0
Test larger variety of inputs using hypothesis.
2020-07-13 15:30:11 -04:00
Itamar Turner-Trauring
a8a7d48c12
Everything must be bytes.
2020-07-13 15:25:07 -04:00
Itamar Turner-Trauring
f27cba181e
Move existing base32 tests out of test_util.py.
2020-07-13 15:22:03 -04:00
Itamar Turner-Trauring
1a3a1ffcaa
Restore eliot code.
2020-07-13 14:33:13 -04:00
Itamar Turner-Trauring
af916c3968
Merge branch 'master' into 3341-more-python-3-utils
2020-07-13 14:30:11 -04:00
Sajith Sasidharan
144001f380
Use a better assert in status subpath test
2020-07-11 08:30:39 -04:00
Sajith Sasidharan
6eba2fb2e6
Test "deep check results" page
...
These are some basic tests -- let's see if this improves test
coverage, and by how much.
2020-07-11 07:59:28 -04:00
Sajith Sasidharan
b49a3eaf3a
Check for a non-standard property on request
2020-07-10 21:46:23 -04:00
Sajith Sasidharan
267b89ae5b
Remove unused import
2020-07-10 16:34:16 -04:00
Sajith Sasidharan
69ae9e6d32
Merge 'origin/master' into 3316.check-results-nevow-to-twisted-web
2020-07-10 16:33:06 -04:00
Sajith Sasidharan
f9dc2509de
Test "deep check and repair" page
2020-07-10 08:00:04 -04:00
Sajith Sasidharan
427f99621f
Do more null checks
2020-07-10 06:56:29 -04:00
Sajith Sasidharan
d4a02aa1cd
Remove a print statement
2020-07-09 17:14:55 -04:00
Sajith Sasidharan
5276ea5b37
Merge branch 'master' into 3254.status-status-nevow-to-twisted-web
2020-07-09 17:09:50 -04:00
Sajith Sasidharan
956c2c535d
Remove unused import
2020-07-09 17:09:12 -04:00
Sajith Sasidharan
a56d077d3d
Test HTML document generated by web.status.Status
2020-07-09 16:59:04 -04:00
Sajith Sasidharan
8331e7d8ec
Remove now-unnecessary UploadResultsPage.render_UPLOAD
2020-07-09 16:05:31 -04:00
Sajith Sasidharan
44ecfdad09
Make UploadResultsPage a Resource
2020-07-09 16:05:31 -04:00
Sajith Sasidharan
62e803db25
Make UploadStatusPage a Resource
2020-07-09 16:05:31 -04:00
Sajith Sasidharan
38fe7dd3f5
Remove unused import
2020-07-09 16:05:31 -04:00
Sajith Sasidharan
f30dcc7ec6
Make Element the superclass of UploadResultsRendererMixin
2020-07-09 16:05:31 -04:00
Sajith Sasidharan
4b560d10cc
Move time formatter tests
...
UploadResultsRendererMixin no longer has render_time(); moving tests
for render_time() as tests for abbreviate_time() to a more appropriate
place.
2020-07-09 16:05:31 -04:00
Sajith Sasidharan
9c14eec1e0
Avoid use of RateAndTimeMixin in UploadResultsRendererMixin
2020-07-09 16:05:31 -04:00
Sajith Sasidharan
118ea4267c
Render abbreviated rate and time values
2020-07-09 16:05:31 -04:00
Sajith Sasidharan
c0d83def22
Document UploadResultsPage parameter
2020-07-09 16:05:31 -04:00
Sajith Sasidharan
0af8df7203
Document UploadStatusPage
2020-07-09 16:05:31 -04:00
Sajith Sasidharan
855668b188
Remove unused imports
2020-07-09 16:05:31 -04:00
Sajith Sasidharan
a0655c18d6
Handle "t=upload" in UploadResultsPage POST handling
2020-07-09 16:05:31 -04:00
Sajith Sasidharan
6b4d27bec1
Use twisted web template in UploadResultsRendererMixin
2020-07-09 16:05:31 -04:00
Sajith Sasidharan
2ab7b15f8b
Make UploadResultsPage a MultiFormatResource
2020-07-09 16:05:31 -04:00
Sajith Sasidharan
71fd4f5d10
Use twisted template tags in upload results page template
2020-07-09 16:05:31 -04:00
Sajith Sasidharan
e6f0f9d038
Make UploadStatusPage a MultiFormatResource
2020-07-09 16:05:31 -04:00
Sajith Sasidharan
d24babe873
Use twisted template tags in upload status page template
2020-07-09 16:05:30 -04:00
Sajith Sasidharan
96fbff684f
Use an inner JSONRequest class with renderJSON
...
Once nevow is removed from web/common.py, we can simplify
renderJSON(), like so:
def renderJSON():
req = Request()
req.args = {"t": ["json"]}
req.fields = {}
return resource.render(req)
But for now we have to live with an inner class that implements the
nevow.inevow.IRequest interface.
2020-07-09 16:05:30 -04:00
Sajith Sasidharan
92e83f268b
Declare JSON request interface using @implementer
...
"zope.interface.implements(IRequest)" is deprectated in favor of
"@zope.interface.implementer(IRequest)" decorator.
2020-07-09 16:05:30 -04:00
Sajith Sasidharan
d449306b19
Use DummyRequest in storage tests
...
Using twisted.web.server.Request causes test_new_style_classes to
fail like so:
Traceback (most recent call last):
Failure: testtools.testresult.real._StringException: Traceback (most recent call last):
File ".tox/coverage/lib/python2.7/site-packages/allmydata/test/test_python2_regressions.py", line 69, in test_new_style_classes
"Expected to find no classic classes.",
File ".tox/coverage/lib/python2.7/site-packages/testtools/testcase.py", line 502, in assertThat
raise mismatch_error
testtools.matchers._impl.MismatchError: !=:
reference = set([])
actual = set([<class allmydata.test.test_storage.JSONRequest at 0x7fd938040bb0>])
: Expected to find no classic classes.
Seems that `DummyRequest` is an acceptable new style class.
2020-07-09 16:05:30 -04:00
Sajith Sasidharan
6b61b75658
Refactor storage test helpers
...
Rewrite `renderSynchronously()` to use `renderDeferred()`
2020-07-09 16:05:30 -04:00
Sajith Sasidharan
bdfa667a22
Add docstrings to storage test helpers
2020-07-09 16:05:30 -04:00
Sajith Sasidharan
7e26dd42e9
Remove redundant render_json() method
2020-07-09 16:05:30 -04:00
Sajith Sasidharan
6379601722
Wrap renderer results in tags
2020-07-09 16:05:30 -04:00
Sajith Sasidharan
0af744610f
Avoid using nevow FakeRequest in storage test.
...
Use twisted.web.server.Request instead, with a DummyChannel.
There's still one line of inevitable nevow now, because of code in
web/common.py; but that should be easily replaceable once we switch
that over.
2020-07-09 16:05:30 -04:00
Sajith Sasidharan
de5d04ab79
Remove an extraneous directive
...
`t:data` is not really a Twisted template directive. Added my
mistake, removing now.
2020-07-09 16:05:30 -04:00
Sajith Sasidharan
a056f18ca9
Remove StorageStatus.renderHTTP
...
This was added to please the test suite. Pleased to remove it!
2020-07-09 16:05:30 -04:00
Sajith Sasidharan
a6e6c5cee0
Get rid of WebRenderingMixin in storage test
2020-07-09 16:05:30 -04:00
Sajith Sasidharan
8d31791940
Use a helper to exercise render() in storage test cases
2020-07-09 16:05:30 -04:00
Sajith Sasidharan
7126d3247c
Prefix member variable with "_"
2020-07-09 16:05:30 -04:00
Sajith Sasidharan
0d9ec2b206
Use slots to render storage stats table
2020-07-09 16:05:30 -04:00
Sajith Sasidharan
9dd9d98b8c
Give the suite the precise string it wants
2020-07-09 16:05:30 -04:00
Sajith Sasidharan
1469af0f3b
Use BeautifulSoup to check favicon in storage page
2020-07-09 16:05:30 -04:00
Sajith Sasidharan
56e2fa3f24
Use <t:transparent> to render node nickname and id
...
CI did not like the old way, but it passed in my system. Odd.
2020-07-09 16:05:30 -04:00
Sajith Sasidharan
0bd386384e
Mark format_recovered
as static method
2020-07-09 16:05:30 -04:00
Sajith Sasidharan
bc8a86e106
Use Unicode strings to render space
2020-07-09 16:05:30 -04:00
Sajith Sasidharan
0b4c235fbd
Remove redundant None
-checks on self.storage
...
When no storage is up, `storage_running()` renderer will return a big
honking `no storage server running` message, and no further renderers
will be invoked. Therefore the extra defense is probably not
required.
(I tested this hypothesis. The extra defense is not required, unless
there's something I have not seen.)
2020-07-09 16:05:30 -04:00
Sajith Sasidharan
db0e6407dc
Use successResultOf
in renderSynchronously
...
Get rid of [].append trick when dealing with the deferred.
2020-07-09 16:05:30 -04:00
Sajith Sasidharan
ee8e730727
Move renderSynchronously
to test suite
2020-07-09 16:05:30 -04:00
Sajith Sasidharan
92f6e4bfe5
Use explicit None
-check on self.storage
2020-07-09 16:05:30 -04:00
Sajith Sasidharan
affe10b3e9
Return result from renderHTTP
...
Bogus renderHTTP, but test failures are now down to three. We just
need to handle requests for JSON now.
2020-07-09 16:05:30 -04:00
Sajith Sasidharan
6b5e530cb3
Add a docstring
2020-07-09 16:05:30 -04:00
Sajith Sasidharan
abb8834be1
Rename function for clarity
2020-07-09 16:05:30 -04:00