(self, name, mode)
| 98 | return st_mode, modestr |
| 99 | |
| 100 | def assertS_IS(self, name, mode): |
| 101 | # test format, lstrip is for S_IFIFO |
| 102 | fmt = getattr(self.statmod, "S_IF" + name.lstrip("F")) |
| 103 | self.assertEqual(self.statmod.S_IFMT(mode), fmt) |
| 104 | # test that just one function returns true |
| 105 | testname = "S_IS" + name |
| 106 | for funcname in self.format_funcs: |
| 107 | func = getattr(self.statmod, funcname, None) |
| 108 | if func is None: |
| 109 | if funcname == testname: |
| 110 | raise ValueError(funcname) |
| 111 | continue |
| 112 | if funcname == testname: |
| 113 | self.assertTrue(func(mode)) |
| 114 | else: |
| 115 | self.assertFalse(func(mode)) |
| 116 | |
| 117 | @os_helper.skip_unless_working_chmod |
| 118 | def test_mode(self): |
no test coverage detected