Commit Graph

6770 Commits

Author SHA1 Message Date
Jean-Paul Calderone
72744c9464 more docstrings and properly support (and use) encoding=None throughout 2020-12-07 09:47:48 -05:00
Jean-Paul Calderone
05d271c7c8 a little more exposition 2020-12-07 09:26:58 -05:00
Jean-Paul Calderone
7b3a5aceb8 These tests can't reach any of the codepaths where quote_output matters
So simplify
2020-12-07 09:21:56 -05:00
Jean-Paul Calderone
f4432d3f23 Respect the provided encoding
UTF-8 is great but if we're claiming the encoding is something else everywhere
else we can't just make it UTF-8 here.
2020-12-07 09:12:38 -05:00
Jean-Paul Calderone
56f141e170 decode instead of encoding in maybe_decode
legacy from when the bytes/unicode tower was upsidedown compared to how it is now
2020-12-07 09:12:04 -05:00
Jean-Paul Calderone
72a5b571ca Only test the cases we can make work everywhere
These tests previously (in this branch) tried to exercise more ``show_output``
logic than they can actually reach due to the requirement that argv be
interpretable.  Shrink the test suite down to just what we can squeeze through
argv and deal with fully testing ``show_output`` elsewhere.
2020-12-07 09:10:59 -05:00
Jean-Paul Calderone
93b30d0dde The implementation can't reliably see the encoding we're faking without this 2020-12-07 09:06:21 -05:00
Jean-Paul Calderone
8ca98bb8ca using run_cli_unicode, better expect unicode result 2020-12-07 09:06:00 -05:00
Jean-Paul Calderone
c12b082fa7 Put run_cli back largely how it was
Also deal with StringIO better in show_output
2020-12-06 20:37:28 -05:00
Jean-Paul Calderone
613777d166 Make sure this one is bytes too 2020-12-06 19:23:13 -05:00
Jean-Paul Calderone
5aee8b422d Oops there's another case 2020-12-06 18:39:09 -05:00
Jean-Paul Calderone
2955d22f72 note a problem with test_system 2020-12-06 18:38:51 -05:00
Jean-Paul Calderone
b464fa6483 docstring 2020-12-06 18:28:11 -05:00
Jean-Paul Calderone
77bebb9916 [wip] remove mock from test_alias, along with a bunch of encoding-related changes :/ 2020-12-06 17:00:34 -05:00
Jean-Paul Calderone
c4b58fe00b unused import 2020-12-06 11:04:19 -05:00
Jean-Paul Calderone
d29210a140 unused import 2020-12-06 11:04:05 -05:00
Jean-Paul Calderone
238590d7fd Remove mock by removing a bunch of unicode shenanigans 2020-12-06 11:03:44 -05:00
Jean-Paul Calderone
8278fa9c62 Name the pem so it gets installed
Also use the new_tub helper that reads the pem so we don't have to generate a
new cert in this test
2020-12-06 10:39:25 -05:00
Jean-Paul Calderone
386f30fa79 Remove Mock from test_threshold_reached 2020-12-06 10:30:08 -05:00
Jean-Paul Calderone
24709fa758
Merge branch 'master' into 3547.furl-py36-regression 2020-12-05 13:29:27 -05:00
Jean-Paul Calderone
d7f005badd
Merge branch 'master' into 3520.test_client-no-mock 2020-12-05 12:55:25 -05:00
Jean-Paul Calderone
ac7491680b fix unicode/bytes stuff in the affected tests 2020-12-05 09:06:45 -05:00
Jean-Paul Calderone
bdc75c3361 Merge remote-tracking branch 'origin/master' into 3539.nodemaker-weakrefdict 2020-12-05 07:23:54 -05:00
Itamar Turner-Trauring
c1a699dede Flake. 2020-12-04 11:39:57 -05:00
Itamar Turner-Trauring
22dcd726e6 Port to Python 3. 2020-12-04 11:36:17 -05:00
Itamar Turner-Trauring
15735e70bc Port to Python 3. 2020-12-04 11:35:59 -05:00
Jean-Paul Calderone
15d0207f89
Merge pull request #897 from tahoe-lafs/3504.private-introducer-furl
Deprecate tahoe.cfg [client]introducer.furl

Fixes: ticket:3504
2020-12-04 09:44:19 -05:00
Itamar Turner-Trauring
0386924d00 Fix flake. 2020-12-02 15:26:25 -05:00
Itamar Turner-Trauring
b716456019 Merge remote-tracking branch 'origin/master' into 3544.furls-not-bytes-maybe 2020-12-02 15:24:31 -05:00
Itamar Turner-Trauring
71d287c1c1
Merge pull request #905 from tahoe-lafs/3514.test-introducer-python-3
Port test_introducer.py to Python 3

Fixes ticket:3514
2020-12-02 15:24:17 -05:00
Jean-Paul Calderone
a0d46c6f09 Merge remote-tracking branch 'origin/master' into 3504.private-introducer-furl 2020-12-02 09:22:09 -05:00
Itamar Turner-Trauring
587222033d Fix bad merge. 2020-12-01 11:58:56 -05:00
Itamar Turner-Trauring
d5ba1be5bc Passing tests. 2020-11-30 17:56:50 -05:00
Itamar Turner-Trauring
17ec22ab84 Even more debytification of furls. 2020-11-30 17:55:37 -05:00
Itamar Turner-Trauring
22c328d6d3 More debytification. 2020-11-30 17:41:15 -05:00
Itamar Turner-Trauring
67694889da Some progress towards ripping out furls-as-bytes. 2020-11-30 17:20:39 -05:00
Itamar Turner-Trauring
27102c0d89 Merge remote-tracking branch 'origin/master' into 3514.test-introducer-python-3 2020-11-30 16:47:21 -05:00
Itamar Turner-Trauring
8615c1ade8 Try to fix sorting on Python 3. 2020-11-30 16:45:14 -05:00
Itamar Turner-Trauring
eaca639b6f Undo changes that should probably be in a different branch. 2020-11-30 16:28:26 -05:00
Itamar Turner-Trauring
413cf75d54 Uses clearer issuperset(). 2020-11-30 16:25:24 -05:00
Itamar Turner-Trauring
9f7ae56a82 Make the explanation less nonsensical. 2020-11-30 16:24:27 -05:00
Jean-Paul Calderone
17ed8afd2f Make the new test data files installable
There's an existing rule that matches *.txt
2020-11-30 13:37:21 -05:00
Jean-Paul Calderone
ef2f7e6136 unused import 2020-11-30 13:27:46 -05:00
Jean-Paul Calderone
2ac4af7fb4 Add some direct tests for NodeMaker.create_from_uri 2020-11-30 13:26:32 -05:00
Jean-Paul Calderone
4ca45aaa93 Catch basedir type errors earlier 2020-11-30 13:23:18 -05:00
Jean-Paul Calderone
01ab8d3ee9 Don't look before you leap 2020-11-30 08:56:45 -05:00
Jean-Paul Calderone
84088e4f41 unused import 2020-11-26 21:18:58 -05:00
Jean-Paul Calderone
805378ef11 Do more path stuff with FilePath 2020-11-26 20:53:57 -05:00
Jean-Paul Calderone
a978fcf433 Replace asserts with explicit checks and TypeError 2020-11-26 19:35:39 -05:00
Jean-Paul Calderone
c82501e0dc Merge remote-tracking branch 'origin/master' into 3511.config-set-config 2020-11-26 11:01:18 -05:00
Jean-Paul Calderone
df53fdcf9b add missing docs to new set_config method 2020-11-26 10:53:42 -05:00
Jean-Paul Calderone
d81fe54faf typo fix 2020-11-26 10:50:36 -05:00
Jean-Paul Calderone
152c04e48c
Merge pull request #902 from tahoe-lafs/3512.localized-tempdir
Per-node web temp directory

Fixes: ticket:3512
2020-11-25 18:18:36 -05:00
Jean-Paul Calderone
520f4d15bf Rename _get_request to more accurate _create_request 2020-11-25 16:09:53 -05:00
Jean-Paul Calderone
8e6773c690
Merge pull request #907 from tahoe-lafs/3518.pypy-versions-None
Get rid of version_checks

Fixes: ticket:3518
2020-11-25 10:54:46 -05:00
Jean-Paul Calderone
bd9a91abf6
Merge pull request #901 from tahoe-lafs/3513.raiseException
Fix exception re-raising in no_network.py

Fixes: ticket:3513
2020-11-25 10:41:15 -05:00
Jean-Paul Calderone
a78c8056fb Get rid of the first mock use in test_threshold_reached 2020-11-24 14:51:51 -05:00
Jean-Paul Calderone
9f4be1fbf0 Speed the tests back up 2020-11-24 14:23:20 -05:00
Jean-Paul Calderone
34b5068f5c Just use a real Tub for this case 2020-11-24 14:18:04 -05:00
Jean-Paul Calderone
c3aff634a0 Add missing attribute docs 2020-11-24 14:17:52 -05:00
Jean-Paul Calderone
1a5efa5ec9 Just let the test use the real SFTPServer service 2020-11-24 14:05:00 -05:00
Jean-Paul Calderone
3321058a33 flake 2020-11-23 15:14:59 -05:00
Jean-Paul Calderone
c694e8c7e2 Delete allmydata.version_checks and related functionality
It is not Tahoe-LAFS' job to manage package installation in this way.
Instead, we can declare our dependencies in setup.py and rely on installation
management tools and packagers to create a suitable execution environment.

Making this statement in the past required going much further out on a limb
than it does today.  This code has served its purpose and can now be retired.
2020-11-23 15:10:18 -05:00
Jean-Paul Calderone
224085c139 Clean up version checks and fix the PyPy regression 2020-11-23 14:14:52 -05:00
Jean-Paul Calderone
55193f725a Avoid passing None to ensure_str 2020-11-23 10:28:04 -05:00
Itamar Turner-Trauring
661bc967d2 Port to Python 3. 2020-11-20 14:06:16 -05:00
Itamar Turner-Trauring
5b87fb4afe All tests pass on Python 2 and 3. 2020-11-20 14:01:48 -05:00
Itamar Turner-Trauring
53a6882f21 Some progress on Python 3 passing tests, some going backwards. 2020-11-20 12:02:22 -05:00
Itamar Turner-Trauring
0e198e7361 Stop hiding Twisted logs! 2020-11-20 11:16:32 -05:00
Itamar Turner-Trauring
bcc509b7a7 Some progress towards passing tests. 2020-11-19 14:23:41 -05:00
Itamar Turner-Trauring
38275cbe6f Merge remote-tracking branch 'origin/master' into 3502.mutable-python-3-part-2 2020-11-19 13:43:10 -05:00
Itamar Turner-Trauring
2ae03043b7 Another passing Python 3 test. 2020-11-19 12:04:02 -05:00
Itamar Turner-Trauring
ad893c9aa1 More passing Python 3 tests. 2020-11-19 11:47:57 -05:00
Itamar Turner-Trauring
8029a1befc First passing test on Python 3. 2020-11-19 11:45:32 -05:00
Itamar Turner-Trauring
40d372a2f6 Some progress towards passing tests on Python 3. 2020-11-19 11:11:48 -05:00
Jean-Paul Calderone
1689804877 Try doing some other thing in Windows 2020-11-19 10:15:36 -05:00
Jean-Paul Calderone
4ce2572ce9 Does Windows behave if we restrict ourselves to *just* S_IREAD?
From CPython docs:

> Note Although Windows supports chmod(), you can only set the file’s
> read-only flag with it (via the stat.S_IWRITE and stat.S_IREAD constants or
> a corresponding integer value). All other bits are ignored.
2020-11-19 09:39:34 -05:00
Jean-Paul Calderone
d727ae4a86 Try to improve the failure mode 2020-11-19 08:50:44 -05:00
Jean-Paul Calderone
594f8019d1 Better support Windows here 2020-11-18 18:29:36 -05:00
Jean-Paul Calderone
f240cb183f flake cleanup 2020-11-18 18:13:01 -05:00
Jean-Paul Calderone
92691c1b32 Be sure the temporary directory exists 2020-11-18 16:53:38 -05:00
Jean-Paul Calderone
5b0d20c453 Everything should be new-style 2020-11-18 16:53:28 -05:00
Jean-Paul Calderone
799e5a2a60 tweak comment about our test case 2020-11-18 15:52:04 -05:00
Jean-Paul Calderone
6d137ac257 Get rid of the tempfile.tempdir hackery 2020-11-18 15:51:08 -05:00
Jean-Paul Calderone
46955202e2 Hook into Twisted Web to control where request bodies are written 2020-11-18 15:47:06 -05:00
Jean-Paul Calderone
875f4d3414 Better setup error re-raising 2020-11-18 14:48:40 -05:00
Jean-Paul Calderone
862d32a90d Add _Config.set_config for presistently changing config values 2020-11-18 13:18:21 -05:00
Jean-Paul Calderone
f21e3189b5 Remove some repetition between read_config and config_from_string 2020-11-18 13:17:16 -05:00
Jean-Paul Calderone
53aa434d77 Add a helper to make a deep copy of a ConfigParser
This will help avoid unintentional side-effects
2020-11-18 13:01:08 -05:00
Jean-Paul Calderone
84647e25b7 Refine the ConfigParser generator
Limit the characters used in the section and item name strategies.
ConfigParser doesn't allow all characters in all places.
2020-11-18 12:59:23 -05:00
Jean-Paul Calderone
021615bdff Some further test_configutil improvements 2020-11-18 12:44:52 -05:00
Jean-Paul Calderone
34714d5f6b Add everything and nothing config validation helpers 2020-11-18 12:42:31 -05:00
Jean-Paul Calderone
e60c643b5f Make configutil.write_config atomic and also make it take a FilePath 2020-11-18 10:57:38 -05:00
Itamar Turner-Trauring
feb85f4c4a Always use native strings as keys. 2020-11-17 13:15:57 -05:00
Itamar Turner-Trauring
bb7ed3afc9 Fix the bug. 2020-11-17 11:25:24 -05:00
Jean-Paul Calderone
2ee0b1d3c6 flake cleanup 2020-11-16 15:05:04 -05:00
Jean-Paul Calderone
5cb1df06c4 delegate introducer furl lookup to the config object 2020-11-16 15:02:51 -05:00
Jean-Paul Calderone
60e0056ad8 don't guide folks to the deprecated config item 2020-11-16 15:02:18 -05:00
Jean-Paul Calderone
0258bb7295 note it's deprecated 2020-11-16 15:02:13 -05:00
Jean-Paul Calderone
c9f7ce8db5 write introducers.yaml instead of [client]introducer.furl 2020-11-16 15:01:52 -05:00
Jean-Paul Calderone
302b5cb01f look for the introducer furl via a more structured interface 2020-11-16 15:01:34 -05:00
Jean-Paul Calderone
0fd354396f note this is for deprecated functionality 2020-11-16 15:01:21 -05:00
Jean-Paul Calderone
69b8262f6b use a different .furl item since introducer.furl will go away 2020-11-16 15:01:05 -05:00
Jean-Paul Calderone
1946ee5023 note this is for deprecated functionality 2020-11-16 15:00:49 -05:00
Jean-Paul Calderone
4e84f5e690 write introducers.yaml instead of [client]introducer.furl in client creation 2020-11-16 15:00:20 -05:00
Jean-Paul Calderone
10600ef5ec Move write_introducer somewhere it can be used more widely 2020-11-16 14:59:42 -05:00
Jean-Paul Calderone
d27c25a26f make sure we put text into yaml 2020-11-14 18:17:34 -05:00
Jean-Paul Calderone
3ac2e9365f yea okay that one fails 2020-11-14 16:57:45 -05:00
Jean-Paul Calderone
dbb8050a8c really suffering from not having a local dev env here 2020-11-14 16:51:36 -05:00
Jean-Paul Calderone
c529d271ee "unicode" is spelled "str" now 2020-11-14 16:46:54 -05:00
Jean-Paul Calderone
06fe3869ef is pyyaml screwing it up? 2020-11-14 16:36:51 -05:00
Jean-Paul Calderone
7b2d76c7ec Another effort to make this simultaneously Py2/Py3 friendly 2020-11-14 16:12:07 -05:00
Jean-Paul Calderone
22973e6951 Attempt to make Python 3 happier 2020-11-14 12:36:22 -05:00
Jean-Paul Calderone
18e327417c Get [client]introducer.furl out of test_system 2020-11-14 11:44:28 -05:00
Jean-Paul Calderone
0f4e34c41d Take [client]introducer.furl out of the UseNode fixture 2020-11-14 11:44:28 -05:00
Jean-Paul Calderone
b6bebc514a Remove [client]introducer.furl from test_node 2020-11-14 11:44:28 -05:00
Jean-Paul Calderone
b181b577e8 Remove [client]introducer.furl from test_multi_introducers (mostly)
Leave in this one test to demonstrate the deprecated functionality still
works, until we delete it entirely.
2020-11-14 11:44:28 -05:00
Jean-Paul Calderone
fabcc079c5 we're not testing the yaml library 2020-11-14 11:44:28 -05:00
Jean-Paul Calderone
0664416f65 Remove [client]introducer.furl from test_introducer 2020-11-14 11:44:26 -05:00
Jean-Paul Calderone
b202f81fd1 move config helper to shared location 2020-11-14 10:23:07 -05:00
Jean-Paul Calderone
25666ee49c Get rid of [client]introducer.furl from test_client 2020-11-14 10:02:19 -05:00
Jean-Paul Calderone
e0f69dcfcf Get the path manipulation into _Config too 2020-11-14 09:26:07 -05:00
Jean-Paul Calderone
bef5ccd0ca Move the introducer config reading code into _Config 2020-11-14 09:12:14 -05:00
Itamar Turner-Trauring
f60c703dfd Ported to Python 3. 2020-11-12 11:24:37 -05:00
Itamar Turner-Trauring
99f54223ab Ported to Python 3. 2020-11-12 11:17:17 -05:00
Itamar Turner-Trauring
679319baf4 Ported to Python 3. 2020-11-12 11:02:51 -05:00
Itamar Turner-Trauring
180c6d7536 Port to Python 3. 2020-11-12 11:00:54 -05:00
Itamar Turner-Trauring
9e2a79ee23 Ported to Python 3. 2020-11-11 14:45:20 -05:00
Itamar Turner-Trauring
d0d7a82734 Port to Python 3. 2020-11-11 14:25:58 -05:00
Itamar Turner-Trauring
d238242d73 Port to Python 3. 2020-11-11 14:09:49 -05:00
Itamar Turner-Trauring
b4803fbc3b Port to Python 3. 2020-11-11 14:05:22 -05:00
Itamar Turner-Trauring
2ae031f54c Merge remote-tracking branch 'origin/master' into 3500.mutable-tests-python-3 2020-11-11 11:41:45 -05:00
Itamar Turner-Trauring
1aeb46aadc Restored sorted. 2020-11-11 10:52:57 -05:00
Itamar Turner-Trauring
7c9b8542c1 Fix flake. 2020-11-09 15:12:38 -05:00
Itamar Turner-Trauring
874111be81 Merge remote-tracking branch 'origin/3496.mutable-tests-python-3-part-3' into 3500.mutable-tests-python-3 2020-11-09 15:09:33 -05:00
Itamar Turner-Trauring
da636984fe Merge remote-tracking branch 'origin/master' into 3500.mutable-tests-python-3 2020-11-09 15:09:16 -05:00
Itamar Turner-Trauring
fcc491bf3b Port to Python 3. 2020-11-09 15:08:56 -05:00
Itamar Turner-Trauring
d8c1b2fba7 Port to Python 3. 2020-11-09 15:02:33 -05:00
Itamar Turner-Trauring
6b61c06882 All tests pass on Python 3. 2020-11-09 15:00:55 -05:00
Itamar Turner-Trauring
e41e660917
Merge branch 'master' into 3496.mutable-tests-python-3-part-3 2020-11-09 14:37:46 -05:00
Itamar Turner-Trauring
c768e0f670
Merge pull request #888 from tahoe-lafs/3475.mutable-tests-part-2-python-3
Port mutable tests to Python 3, part 2 of N

Fixes ticket:3475
2020-11-09 14:36:28 -05:00
Itamar Turner-Trauring
d31667d58c Ported to Python 3. 2020-11-09 14:15:40 -05:00
Itamar Turner-Trauring
2b9e269d3a Tests pass on Python 3. 2020-11-09 14:13:14 -05:00
Itamar Turner-Trauring
da6dfcd86d Ported to Python 3. 2020-11-09 14:00:11 -05:00
Itamar Turner-Trauring
b2e72ef562 Port to Python 3. 2020-11-09 13:55:28 -05:00
Itamar Turner-Trauring
3d5d46fe7c Port to Python 3. 2020-11-09 13:48:22 -05:00
Itamar Turner-Trauring
0e27e7eba1 Merge branch '3496.mutable-tests-python-3-part-3' into 3500.mutable-tests-python-3 2020-11-09 13:46:19 -05:00
Itamar Turner-Trauring
f5f0ce2477 Re-enable sorting. 2020-11-09 13:41:03 -05:00
Chad Whitacre
fe07078859 Turn web service back on in test for Python 3 2020-11-06 19:44:08 -05:00
Itamar Turner-Trauring
9dd0faf528 Ported to Python 3. 2020-11-06 11:41:34 -05:00