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

Method test_format_resources

Lib/test/test_regrtest.py:2477–2495  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2475 self.assertIsNone(normalize('tearDownModule (test.test_module)', is_error=True))
2476
2477 def test_format_resources(self):
2478 format_resources = utils.format_resources
2479 ALL_RESOURCES = utils.ALL_RESOURCES
2480 self.assertEqual(
2481 format_resources({"network": None}),
2482 'resources (1): network')
2483 self.assertEqual(
2484 format_resources(dict.fromkeys(("audio", "decimal", "network"))),
2485 'resources (3): audio,decimal,network')
2486 self.assertEqual(
2487 format_resources(dict.fromkeys(ALL_RESOURCES)),
2488 'resources: all')
2489 self.assertEqual(
2490 format_resources({name: None for name in ALL_RESOURCES
2491 if name != "cpu"}),
2492 'resources: all,-cpu')
2493 self.assertEqual(
2494 format_resources({**dict.fromkeys(ALL_RESOURCES), "tzdata": None}),
2495 'resources: all,tzdata')
2496
2497 def test_match_test(self):
2498 class Test:

Callers

nothing calls this directly

Calls 3

format_resourcesFunction · 0.85
assertEqualMethod · 0.45
fromkeysMethod · 0.45

Tested by

no test coverage detected