MCPcopy
hub / github.com/giampaolo/pyftpdlib / test_directory_opt

Method test_directory_opt

tests/test_cli.py:98–113  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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"])

Callers

nothing calls this directly

Calls 4

mainFunction · 0.90
get_testfnMethod · 0.80
mkdirMethod · 0.80
get_home_dirMethod · 0.45

Tested by

no test coverage detected