MCPcopy Index your code
hub / github.com/python/cpython / test_win32_ver

Method test_win32_ver

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

Source from the content-addressed store, hash-verified

401
402 @unittest.skipUnless(support.MS_WINDOWS, 'This test only makes sense on Windows')
403 def test_win32_ver(self):
404 release1, version1, csd1, ptype1 = 'a', 'b', 'c', 'd'
405 res = platform.win32_ver(release1, version1, csd1, ptype1)
406 self.assertEqual(len(res), 4)
407 release, version, csd, ptype = res
408 if release:
409 # Currently, release names always come from internal dicts,
410 # but this could change over time. For now, we just check that
411 # release is something different from what we have passed.
412 self.assertNotEqual(release, release1)
413 if version:
414 # It is rather hard to test explicit version without
415 # going deep into the details.
416 self.assertIn('.', version)
417 for v in version.split('.'):
418 int(v) # should not fail
419 if csd:
420 self.assertStartsWith(csd, 'SP')
421 if ptype:
422 if os.cpu_count() > 1:
423 self.assertIn('Multiprocessor', ptype)
424 else:
425 self.assertIn('Uniprocessor', ptype)
426
427 @unittest.skipIf(support.MS_WINDOWS, 'This test only makes sense on non Windows')
428 def test_win32_ver_on_non_windows(self):

Callers

nothing calls this directly

Calls 6

assertNotEqualMethod · 0.80
assertInMethod · 0.80
assertStartsWithMethod · 0.80
cpu_countMethod · 0.80
assertEqualMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected