Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_from_string():
assert Perm.from_string("203451") == Perm((2, 0, 3, 4, 5, 1))
assert Perm.from_string("40132") == Perm((4, 0, 1, 3, 2))
assert Perm.from_string("0") == Perm((0,))
for _ in range(100):
perm = Perm.random(random.randint(0, 10))
assert perm == Perm.from_string("".join(map(str, perm)))
def test_from_string():
assert Perm.from_string("203451") == Perm((2, 0, 3, 4, 5, 1))
assert Perm.from_string("40132") == Perm((4, 0, 1, 3, 2))
assert Perm.from_string("0") == Perm((0,))
for _ in range(100):
perm = Perm.random(random.randint(0, 10))
assert perm == Perm.from_string("".join(map(str, perm)))
def test_from_string():
assert Perm.from_string("203451") == Perm((2, 0, 3, 4, 5, 1))
assert Perm.from_string("40132") == Perm((4, 0, 1, 3, 2))
assert Perm.from_string("0") == Perm((0,))
for _ in range(100):
perm = Perm.random(random.randint(0, 10))
assert perm == Perm.from_string("".join(map(str, perm)))
def test_applies_to_a_symmetry(self):
assert Ru2143CoreStrategy([cu, p2143]).applies()
assert Ru2143CoreStrategy(
[
Perm.from_string("0231"),
Perm.from_string("1032"),
Perm.from_string("03124"),
]
def test_applies_to_a_symmetry(self):
assert Rd2134CoreStrategy([cd, p2134]).applies()
assert Rd2134CoreStrategy(
[
Perm.from_string("0132"),
Perm.from_string("1302"),
Perm.from_string("32014"),
]
def test_applies_to_a_symmetry(self):
assert Ru2143CoreStrategy([cu, p2143]).applies()
assert Ru2143CoreStrategy(
[
Perm.from_string("0231"),
Perm.from_string("1032"),
Perm.from_string("03124"),
]
def test_applies_to_a_symmetry(self):
assert Rd2134CoreStrategy([cd, p2134]).applies()
assert Rd2134CoreStrategy(
[
Perm.from_string("0132"),
Perm.from_string("1302"),
Perm.from_string("32014"),
]
def test_applies_to_a_symmetry(self):
assert Ru2143CoreStrategy([cu, p2143]).applies()
assert Ru2143CoreStrategy(
[
Perm.from_string("0231"),
Perm.from_string("1032"),
Perm.from_string("03124"),
]
def test_applies_to_a_symmetry(self):
assert Rd2134CoreStrategy([cd, p2134]).applies()
assert Rd2134CoreStrategy(
[
Perm.from_string("0132"),
Perm.from_string("1302"),
Perm.from_string("32014"),
]