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

Method test_write_opt

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

Source from the content-addressed store, hash-verified

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()

Callers

nothing calls this directly

Calls 2

mainFunction · 0.90
get_permsMethod · 0.45

Tested by

no test coverage detected