MCPcopy Create free account
hub / github.com/python/cpython / test_lwp_filepermissions

Method test_lwp_filepermissions

Lib/test/test_http_cookiejar.py:385–395  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

383 @unittest.skipIf(mswindows, "windows file permissions are incompatible with file modes")
384 @os_helper.skip_unless_working_chmod
385 def test_lwp_filepermissions(self):
386 # Cookie file should only be readable by the creator
387 filename = os_helper.TESTFN
388 c = LWPCookieJar()
389 interact_netscape(c, "http://www.acme.com/", 'boo')
390 try:
391 c.save(filename, ignore_discard=True)
392 st = os.stat(filename)
393 self.assertEqual(stat.S_IMODE(st.st_mode), 0o600)
394 finally:
395 os_helper.unlink(filename)
396
397 @unittest.skipIf(mswindows, "windows file permissions are incompatible with file modes")
398 @os_helper.skip_unless_working_chmod

Callers

nothing calls this directly

Calls 6

saveMethod · 0.95
LWPCookieJarClass · 0.90
interact_netscapeFunction · 0.85
statMethod · 0.45
assertEqualMethod · 0.45
unlinkMethod · 0.45

Tested by

no test coverage detected