MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_module_attributes

Method test_module_attributes

Lib/test/test_stat.py:230–246  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

228 self.assertS_IS("SOCK", st_mode)
229
230 def test_module_attributes(self):
231 for key, value in self.stat_struct.items():
232 modvalue = getattr(self.statmod, key)
233 self.assertEqual(value, modvalue, key)
234 for key, value in self.permission_bits.items():
235 modvalue = getattr(self.statmod, key)
236 self.assertEqual(value, modvalue, key)
237 for key in self.file_flags:
238 modvalue = getattr(self.statmod, key)
239 self.assertIsInstance(modvalue, int)
240 for key in self.formats:
241 modvalue = getattr(self.statmod, key)
242 self.assertIsInstance(modvalue, int)
243 for key in self.format_funcs:
244 func = getattr(self.statmod, key)
245 self.assertTrue(callable(func))
246 self.assertEqual(func(0), 0)
247
248 def test_flags_consistent(self):
249 self.assertFalse(self.statmod.UF_SETTABLE & self.statmod.SF_SETTABLE)

Callers

nothing calls this directly

Calls 7

getattrFunction · 0.85
callableFunction · 0.85
assertIsInstanceMethod · 0.80
assertTrueMethod · 0.80
funcFunction · 0.70
itemsMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected