Commit Graph

5631 Commits

Author SHA1 Message Date
Sajith Sasidharan
e121cc0a84 Use the right names
Missed this in testing because this code was not reached in testing.
2020-06-17 22:09:50 -04:00
Sajith Sasidharan
4f213e93be Remove an unused variable 2020-06-17 22:04:08 -04:00
Sajith Sasidharan
0483fc91c1 Remove unused import 2020-06-17 22:04:08 -04:00
Sajith Sasidharan
c3440ce213 Use a helper to query monitor counters 2020-06-17 21:53:11 -04:00
Sajith Sasidharan
47f9147e16 Rename a class for consistency's sake 2020-06-17 21:46:40 -04:00
Sajith Sasidharan
fe1b0cb7ed Rename class variables 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
22977352bb Document parameters of ResultsRenderer classes 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
79be795566 Remove unused want_json() 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
23a51117d2 Rename r to check_results 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
fae4f44404 Prefer req to ctx 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
cdb3747470 Remove nevow imports 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
de99912641 Replace ctx references with req references 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
1ee756c8df Use Beautiful Soup to check for favicon 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
2e60408bf6 Wrap counters in <span> tags
Unless the rendered page contains strings of the form "Objects
Checked: <span>n</span>" etc, test_POST_DIRURL_deepcheck will not
pass.
2020-06-17 21:18:14 -04:00
Sajith Sasidharan
33ddac879c Remove unused code 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
8094b3144d Use SlotsSequenceElement to render all objects 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
4e594b09bf Use SlotsSequenceElement to render corrupt shares 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
46cb3b6bc3 Use SlotsSequenceElement to render servers with corrupt shares 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
c41bca24f5 Use SlotsSequenceElement to render deep check results problems 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
bbd6bde478 Use SlotsSequenceElement to render remaining corrupt shares
This was previously not implemented; leaving it as such.
2020-06-17 21:18:14 -04:00
Sajith Sasidharan
19f6ec7102 Use SlotsSequenceElement to render servers with corrupt shares
This was previously not implemented; leaving it as such.
2020-06-17 21:18:14 -04:00
Sajith Sasidharan
e0c686bb92 Use SlotsSequenceElement to render post-repair problems 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
f168dcd19c Use SlotsSequenceElement to render pre-repair problems 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
c7aa789a22 Fix "class has no children attribute" error 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
cfb1560d15 Render "all objects" table using SlotsSequenceElement 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
3783349ea7 Add span tags to "deep check and repair results" template
Tests expect <span> tags around these numbers, let us add those.
2020-06-17 21:18:14 -04:00
Sajith Sasidharan
c4be4b566c Make TestRequest an object
Wouldn't pass PythonTwoRegressions.test_new_style_classes without
this.
2020-06-17 21:18:14 -04:00
Sajith Sasidharan
048840ac99 Stringify numbers 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
c44a167a66 Remove WebRenderingMixin from WebResultsRendering 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
02cd42c130 Simplify WebResultsRendering.test_literal 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
77120ba70c Update tests for ResultsRenderer classes 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
0d1269264a Stringify numbers in DeepCheckResultsRenderer 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
7237fef630 Add property client to CheckAndRepairResultsRendererElement 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
19db5fb312 Update "deep check and repair results" template 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
e4efcdd925 Make DeepCheckAndRepairResultsRenderer a MultiFormatResource 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
842b2b6be5 Use twisted tags in "deep check and repair results" template 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
27e5ce090a Update deep check results template 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
c33c0a884d Make DeepCheckResultsRenderer a MultiFormatResource 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
9dcaa104c5 Use twisted tags in deep check results template 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
0eea108123 Make CheckAndRepairResultsRenderer a MultiFormatResource 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
d9005fcccc Use twisted tags in check and repair results template 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
80e9f48551 Add line breaks in a comment 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
6f1601aeeb Stringify numbers before wrapping them up in tags 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
d2540b89d3 Use twisted web tags in ResultsBase 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
8e37bb1ebb Make ResultsBase a base class of CheckResultsRendererElement 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
fea4e516f3 Make CheckResultsRenderer a MultiFormatResource 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
9d104f5893 Use twisted tags in check results template file 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
cbc414725c Use "output" as format argument
Nearly everywhere else the query argument for output format is "t";
but here "t" is used for operations, and "output" is used for output
format.

The test suite will fail without this.
2020-06-17 21:18:14 -04:00
Sajith Sasidharan
c15001269f Avoid using a Python keyword as a renderer name 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
3901559e34 Make LiteralCheckResultsRenderer a MultiFormatResource 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
ebf23a4f0e Use twisted web tags in literal check results template 2020-06-17 21:18:14 -04:00
Sajith Sasidharan
950d111793 Use POST target paths without pre-existing query arguments
`action="."` on `/uri/URI:DIR2:$DIRCAP` will render as `/uri/`, which
is not the result we want.
2020-06-17 21:16:38 -04:00
Sajith Sasidharan
55170dcd2b Rearrange imports 2020-06-17 15:45:08 -04:00
Sajith Sasidharan
7a23c8ed6c
Merge pull request #724 from sajith/3312.webui-directory-fix
Fix for "the webapi does not allow empty pathname components"

Fixes: ticket:3312
2020-06-17 10:55:21 -04:00
meejah
6a37f32eef use attr.s 2020-06-13 17:28:28 -06:00
meejah
939f60f620 embetter docstring 2020-06-13 17:22:17 -06:00
meejah
d221787541 better docstring 2020-06-13 02:03:19 -06:00
meejah
02a543515f replciate Tahoe's behavior for replace=true/false 2020-06-13 01:55:14 -06:00
meejah
0cbdbd9ebe symbols, not magic-numbers 2020-06-13 01:14:45 -06:00
meejah
b952ef066c match query args 2020-06-13 00:46:55 -06:00
meejah
24899dae8e assert -> ValueError 2020-06-13 00:41:22 -06:00
meejah
76040b53f5 assert -> raise 2020-06-13 00:39:57 -06:00
meejah
9f6fcde2f1 more docstring 2020-06-13 00:39:12 -06:00
meejah
a38188164f comment 2020-06-12 23:08:04 -06:00
meejah
c64e78634d docstring 2020-06-12 23:06:33 -06:00
meejah
23b17ca02e cleanup, docstrings 2020-06-12 23:05:32 -06:00
meejah
e79534abe8 housekeeping 2020-06-12 23:01:02 -06:00
meejah
fa597e1735 use real parser 2020-06-12 22:57:38 -06:00
meejah
949b09ce27 actually returns CREATED for new data 2020-06-12 22:08:36 -06:00
meejah
776ee5f91c use hypothesis -- which doesn't know about Deferred, so need testtools too 2020-06-12 22:04:12 -06:00
meejah
05ea0a2fe9 copyright, header 2020-06-12 22:04:03 -06:00
meejah
318dc5092d key -> kind 2020-06-11 19:57:21 -06:00
meejah
0e5422c24b handle more inputs in test body-producer 2020-06-11 19:57:11 -06:00
meejah
36d9bf5d09 new-style classes only 2020-06-11 15:34:47 -06:00
meejah
00e7d01a1a unused imports 2020-06-11 15:34:40 -06:00
meejah
86a90084bb simple test of testing/web 2020-06-11 14:14:42 -06:00
meejah
fc2203e421 simplify tahoe web fakes 2020-06-11 13:26:09 -06:00
meejah
3e973197ac synchronous-only up/download tahoe code to keep treq.testing happy 2020-06-03 11:32:22 -06:00
Sajith Sasidharan
4fa2e6ad97 Use twisted web directives in web.operations.ReloadMixin 2020-06-02 11:56:59 -04:00
meejah
1faa81c7c4 actual usable agent 2020-06-01 09:06:46 -06:00
Sajith Sasidharan
dd14da4a55 Decode name before null check
Make the diff against master a tad bit smaller.
2020-05-29 21:48:04 -04:00
Sajith Sasidharan
dce73f7c2f Make "Refresh" link work
This seems to be a subtle difference from nevow: with `href="."`,
rendered link target will be `/uri/`, so clicking "Refresh" will
result in an error message like so: "GET /uri requires uri=".

With `href=""`, the rendered link target will be `/uri/URI:...`, which
is what we need.
2020-05-29 21:44:10 -04:00
Sajith Sasidharan
31eba00d0f Reject trailing empty path piece in URIs 2020-05-29 21:38:43 -04:00
Sajith Sasidharan
0633623ecc Reject URIs that contain empty segments 2020-05-29 21:38:43 -04:00
Sajith Sasidharan
b6e00d09f9 Render self in DirectoryNodeHandler.getChild()
We need self.render_POST() etc. to be invoked when we have a request
such as "POST /uri/URI:DIR:..."; throwing an error here is probably
not the right thing to do.
2020-05-29 09:22:15 -04:00
Sajith Sasidharan
cf4b3ba008 Correct arguments to super()
This was incidentally found when looking at some test failures:
super(type, object) is the right invocation, and not the other way
around.
2020-05-29 09:20:18 -04:00
meejah
d50ca9af55 proof-of-concept verified-fake for testing 2020-05-26 18:33:04 -06:00
Sajith Sasidharan
03d529c22a Remove unused import 2020-05-22 21:33:30 -04:00
Sajith Sasidharan
f8562530be Make Element the superclass of UploadResultsRendererMixin 2020-05-22 21:11:42 -04:00
Sajith Sasidharan
b0e3325d03 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-05-22 20:49:34 -04:00
Sajith Sasidharan
91f8d939f8 Avoid use of RateAndTimeMixin in UploadResultsRendererMixin 2020-05-22 20:22:59 -04:00
Sajith Sasidharan
aecd90858a Render abbreviated rate and time values 2020-05-22 19:39:32 -04:00
Sajith Sasidharan
7be1883910 Document UploadResultsPage parameter 2020-05-22 19:39:32 -04:00
Sajith Sasidharan
5fdd61b146 Document UploadStatusPage 2020-05-22 19:39:32 -04:00
Sajith Sasidharan
54ac2d224a Remove unused imports 2020-05-22 19:39:32 -04:00
Sajith Sasidharan
7a82fd671f Handle "t=upload" in UploadResultsPage POST handling 2020-05-22 19:39:32 -04:00
Sajith Sasidharan
3bfa5a5c29 Use twisted web template in UploadResultsRendererMixin 2020-05-22 19:39:32 -04:00
Sajith Sasidharan
57b1203d17 Make UploadResultsPage a MultiFormatResource 2020-05-22 19:39:32 -04:00
Sajith Sasidharan
6470718691 Use twisted template tags in upload results page template 2020-05-22 19:39:32 -04:00
Sajith Sasidharan
41300097c8 Make UploadStatusPage a MultiFormatResource 2020-05-22 19:39:32 -04:00