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

Method test_win32_ver

Lib/test/test_platform.py:361–383  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

359
360 @unittest.skipUnless(support.MS_WINDOWS, 'This test only makes sense on Windows')
361 def test_win32_ver(self):
362 release1, version1, csd1, ptype1 = 'a', 'b', 'c', 'd'
363 res = platform.win32_ver(release1, version1, csd1, ptype1)
364 self.assertEqual(len(res), 4)
365 release, version, csd, ptype = res
366 if release:
367 # Currently, release names always come from internal dicts,
368 # but this could change over time. For now, we just check that
369 # release is something different from what we have passed.
370 self.assertNotEqual(release, release1)
371 if version:
372 # It is rather hard to test explicit version without
373 # going deep into the details.
374 self.assertIn('.', version)
375 for v in version.split('.'):
376 int(v) # should not fail
377 if csd:
378 self.assertTrue(csd.startswith('SP'), msg=csd)
379 if ptype:
380 if os.cpu_count() > 1:
381 self.assertIn('Multiprocessor', ptype)
382 else:
383 self.assertIn('Uniprocessor', ptype)
384
385 @unittest.skipIf(support.MS_WINDOWS, 'This test only makes sense on non Windows')
386 def test_win32_ver_on_non_windows(self):

Callers

nothing calls this directly

Calls 8

lenFunction · 0.85
assertNotEqualMethod · 0.80
assertInMethod · 0.80
assertTrueMethod · 0.80
cpu_countMethod · 0.80
assertEqualMethod · 0.45
splitMethod · 0.45
startswithMethod · 0.45

Tested by

no test coverage detected