(self)
| 96 | main(["-w", "foo", "-p", "0"]) |
| 97 | |
| 98 | def test_directory_opt(self): |
| 99 | dirname = self.get_testfn() |
| 100 | os.mkdir(dirname) |
| 101 | ftpd = main(["-d", dirname, "-p", "0"]) |
| 102 | ftpd = main(["--directory", dirname, "-p", "0"]) |
| 103 | assert ftpd.handler.authorizer.get_home_dir( |
| 104 | "anonymous" |
| 105 | ) == os.path.abspath(dirname) |
| 106 | |
| 107 | # without argument |
| 108 | with pytest.raises(SystemExit): |
| 109 | main(["-d"]) |
| 110 | |
| 111 | # no such directory |
| 112 | with pytest.raises(ValueError, match="no such directory"): |
| 113 | main(["-d", "?!?", "-p", "0"]) |
| 114 | |
| 115 | def test_nat_address_opt(self): |
| 116 | ftpd = main(["-n", "127.0.0.1", "-p", "0"]) |
nothing calls this directly
no test coverage detected