MCPcopy Create free account
hub / github.com/python/cpython / test_permute_optional_groups

Method test_permute_optional_groups

Lib/test/test_clinic.py:4464–4542  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4462 self.assertEqual(actual, expected)
4463
4464 def test_permute_optional_groups(self):
4465 empty = {
4466 "left": (), "required": (), "right": (),
4467 "expected": ((),),
4468 }
4469 noleft1 = {
4470 "left": (), "required": ("b",), "right": ("c",),
4471 "expected": (
4472 ("b",),
4473 ("b", "c"),
4474 ),
4475 }
4476 noleft2 = {
4477 "left": (), "required": ("b", "c",), "right": ("d",),
4478 "expected": (
4479 ("b", "c"),
4480 ("b", "c", "d"),
4481 ),
4482 }
4483 noleft3 = {
4484 "left": (), "required": ("b", "c",), "right": ("d", "e"),
4485 "expected": (
4486 ("b", "c"),
4487 ("b", "c", "d"),
4488 ("b", "c", "d", "e"),
4489 ),
4490 }
4491 noright1 = {
4492 "left": ("a",), "required": ("b",), "right": (),
4493 "expected": (
4494 ("b",),
4495 ("a", "b"),
4496 ),
4497 }
4498 noright2 = {
4499 "left": ("a",), "required": ("b", "c"), "right": (),
4500 "expected": (
4501 ("b", "c"),
4502 ("a", "b", "c"),
4503 ),
4504 }
4505 noright3 = {
4506 "left": ("a", "b"), "required": ("c",), "right": (),
4507 "expected": (
4508 ("c",),
4509 ("b", "c"),
4510 ("a", "b", "c"),
4511 ),
4512 }
4513 leftandright1 = {
4514 "left": ("a",), "required": ("b",), "right": ("c",),
4515 "expected": (
4516 ("b",),
4517 ("a", "b"), # Prefer left.
4518 ("a", "b", "c"),
4519 ),
4520 }
4521 leftandright2 = {

Callers

nothing calls this directly

Calls 4

permute_optional_groupsFunction · 0.90
subTestMethod · 0.45
valuesMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected