| 76 | main(["--port", "0"]) |
| 77 | |
| 78 | def test_write_opt(self): |
| 79 | with warnings.catch_warnings(): |
| 80 | warnings.filterwarnings("error") |
| 81 | with pytest.raises(RuntimeWarning): |
| 82 | main(["-w", "-p", "0"]) |
| 83 | |
| 84 | with warnings.catch_warnings(): |
| 85 | warnings.filterwarnings("ignore") |
| 86 | ftpd = main(["-w", "-p", "0"]) |
| 87 | perms = ftpd.handler.authorizer.get_perms("anonymous") |
| 88 | assert ( |
| 89 | perms |
| 90 | == DummyAuthorizer.read_perms + DummyAuthorizer.write_perms |
| 91 | ) |
| 92 | |
| 93 | # unexpected argument |
| 94 | with warnings.catch_warnings(): |
| 95 | with pytest.raises(SystemExit): |
| 96 | main(["-w", "foo", "-p", "0"]) |
| 97 | |
| 98 | def test_directory_opt(self): |
| 99 | dirname = self.get_testfn() |