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

Method test_format_resources

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

Source from the content-addressed store, hash-verified

2442 self.assertIsNone(normalize('tearDownModule (test.test_module)', is_error=True))
2443
2444 def test_format_resources(self):
2445 format_resources = utils.format_resources
2446 ALL_RESOURCES = utils.ALL_RESOURCES
2447 self.assertEqual(
2448 format_resources(("network",)),
2449 'resources (1): network')
2450 self.assertEqual(
2451 format_resources(("audio", "decimal", "network")),
2452 'resources (3): audio,decimal,network')
2453 self.assertEqual(
2454 format_resources(ALL_RESOURCES),
2455 'resources: all')
2456 self.assertEqual(
2457 format_resources(tuple(name for name in ALL_RESOURCES
2458 if name != "cpu")),
2459 'resources: all,-cpu')
2460 self.assertEqual(
2461 format_resources((*ALL_RESOURCES, "tzdata")),
2462 'resources: all,tzdata')
2463
2464 def test_match_test(self):
2465 class Test:

Callers

nothing calls this directly

Calls 2

format_resourcesFunction · 0.85
assertEqualMethod · 0.45

Tested by

no test coverage detected