Lines Matching defs:Perm
1944 class Perm(Flag):
1962 Perm = self.Perm
1963 self.assertEqual(str(Perm.R), 'Perm.R')
1964 self.assertEqual(str(Perm.W), 'Perm.W')
1965 self.assertEqual(str(Perm.X), 'Perm.X')
1966 self.assertEqual(str(Perm.R | Perm.W), 'Perm.R|W')
1967 self.assertEqual(str(Perm.R | Perm.W | Perm.X), 'Perm.R|W|X')
1968 self.assertEqual(str(Perm(0)), 'Perm.0')
1969 self.assertEqual(str(~Perm.R), 'Perm.W|X')
1970 self.assertEqual(str(~Perm.W), 'Perm.R|X')
1971 self.assertEqual(str(~Perm.X), 'Perm.R|W')
1972 self.assertEqual(str(~(Perm.R | Perm.W)), 'Perm.X')
1973 self.assertEqual(str(~(Perm.R | Perm.W | Perm.X)), 'Perm.0')
1974 self.assertEqual(str(Perm(~0)), 'Perm.R|W|X')
1989 Perm = self.Perm
1990 self.assertEqual(repr(Perm.R), '<Perm.R: 4>')
1991 self.assertEqual(repr(Perm.W), '<Perm.W: 2>')
1992 self.assertEqual(repr(Perm.X), '<Perm.X: 1>')
1993 self.assertEqual(repr(Perm.R | Perm.W), '<Perm.R|W: 6>')
1994 self.assertEqual(repr(Perm.R | Perm.W | Perm.X), '<Perm.R|W|X: 7>')
1995 self.assertEqual(repr(Perm(0)), '<Perm.0: 0>')
1996 self.assertEqual(repr(~Perm.R), '<Perm.W|X: 3>')
1997 self.assertEqual(repr(~Perm.W), '<Perm.R|X: 5>')
1998 self.assertEqual(repr(~Perm.X), '<Perm.R|W: 6>')
1999 self.assertEqual(repr(~(Perm.R | Perm.W)), '<Perm.X: 1>')
2000 self.assertEqual(repr(~(Perm.R | Perm.W | Perm.X)), '<Perm.0: 0>')
2001 self.assertEqual(repr(Perm(~0)), '<Perm.R|W|X: 7>')
2016 Perm = self.Perm
2017 for i in Perm:
2018 for j in Perm:
2019 self.assertEqual((i | j), Perm(i.value | j.value))
2021 self.assertIs(type(i | j), Perm)
2022 for i in Perm:
2028 Perm = self.Perm
2029 RW = Perm.R | Perm.W
2030 RX = Perm.R | Perm.X
2031 WX = Perm.W | Perm.X
2032 RWX = Perm.R | Perm.W | Perm.X
2033 values = list(Perm) + [RW, RX, WX, RWX, Perm(0)]
2037 self.assertIs(type(i & j), Perm)
2038 for i in Perm:
2046 Perm = self.Perm
2047 for i in Perm:
2048 for j in Perm:
2050 self.assertIs(type(i ^ j), Perm)
2051 for i in Perm:
2052 self.assertIs(i ^ Perm(0), i)
2053 self.assertIs(Perm(0) ^ i, i)
2059 Perm = self.Perm
2060 RW = Perm.R | Perm.W
2061 RX = Perm.R | Perm.X
2062 WX = Perm.W | Perm.X
2063 RWX = Perm.R | Perm.W | Perm.X
2064 values = list(Perm) + [RW, RX, WX, RWX, Perm(0)]
2066 self.assertIs(type(~i), Perm)
2068 for i in Perm:
2075 Perm = self.Perm
2076 for f in Perm:
2083 Perm = Flag('Perm', 'R W X')
2084 lst = list(Perm)
2085 self.assertEqual(len(lst), len(Perm))
2086 self.assertEqual(len(Perm), 3, Perm)
2087 self.assertEqual(lst, [Perm.R, Perm.W, Perm.X])
2090 e = Perm(v)
2094 self.assertIn(e, Perm)
2095 self.assertIs(type(e), Perm)
2098 Perm = Flag('Perm', 'R W X', start=8)
2099 lst = list(Perm)
2100 self.assertEqual(len(lst), len(Perm))
2101 self.assertEqual(len(Perm), 3, Perm)
2102 self.assertEqual(lst, [Perm.R, Perm.W, Perm.X])
2105 e = Perm(v)
2109 self.assertIn(e, Perm)
2110 self.assertIs(type(e), Perm)
2113 Perm = Flag('Perm', ['R', 'W', 'X'])
2114 lst = list(Perm)
2115 self.assertEqual(len(lst), len(Perm))
2116 self.assertEqual(len(Perm), 3, Perm)
2117 self.assertEqual(lst, [Perm.R, Perm.W, Perm.X])
2120 e = Perm(v)
2124 self.assertIn(e, Perm)
2125 self.assertIs(type(e), Perm)
2128 Perm = Flag('Perm', (('R', 2), ('W', 8), ('X', 32)))
2129 lst = list(Perm)
2130 self.assertEqual(len(lst), len(Perm))
2131 self.assertEqual(len(Perm), 3, Perm)
2132 self.assertEqual(lst, [Perm.R, Perm.W, Perm.X])
2135 e = Perm(v)
2139 self.assertIn(e, Perm)
2140 self.assertIs(type(e), Perm)
2143 Perm = Flag('Perm', OrderedDict((('R', 2), ('W', 8), ('X', 32))))
2144 lst = list(Perm)
2145 self.assertEqual(len(lst), len(Perm))
2146 self.assertEqual(len(Perm), 3, Perm)
2147 self.assertEqual(lst, [Perm.R, Perm.W, Perm.X])
2150 e = Perm(v)
2154 self.assertIn(e, Perm)
2155 self.assertIs(type(e), Perm)
2178 Perm = self.Perm
2179 R, W, X = Perm
2326 class Perm(IntFlag):
2346 Perm = self.Perm
2348 for f in Perm:
2349 self.assertTrue(isinstance(f, Perm))
2351 self.assertTrue(isinstance(Perm.W | Perm.X, Perm))
2352 self.assertEqual(Perm.W | Perm.X, 3)
2361 Perm = self.Perm
2362 self.assertEqual(str(Perm.R), 'Perm.R')
2363 self.assertEqual(str(Perm.W), 'Perm.W')
2364 self.assertEqual(str(Perm.X), 'Perm.X')
2365 self.assertEqual(str(Perm.R | Perm.W), 'Perm.R|W')
2366 self.assertEqual(str(Perm.R | Perm.W | Perm.X), 'Perm.R|W|X')
2367 self.assertEqual(str(Perm.R | 8), 'Perm.8|R')
2368 self.assertEqual(str(Perm(0)), 'Perm.0')
2369 self.assertEqual(str(Perm(8)), 'Perm.8')
2370 self.assertEqual(str(~Perm.R), 'Perm.W|X')
2371 self.assertEqual(str(~Perm.W), 'Perm.R|X')
2372 self.assertEqual(str(~Perm.X), 'Perm.R|W')
2373 self.assertEqual(str(~(Perm.R | Perm.W)), 'Perm.X')
2374 self.assertEqual(str(~(Perm.R | Perm.W | Perm.X)), 'Perm.-8')
2375 self.assertEqual(str(~(Perm.R | 8)), 'Perm.W|X')
2376 self.assertEqual(str(Perm(~0)), 'Perm.R|W|X')
2377 self.assertEqual(str(Perm(~8)), 'Perm.R|W|X')
2394 Perm = self.Perm
2395 self.assertEqual(repr(Perm.R), '<Perm.R: 4>')
2396 self.assertEqual(repr(Perm.W), '<Perm.W: 2>')
2397 self.assertEqual(repr(Perm.X), '<Perm.X: 1>')
2398 self.assertEqual(repr(Perm.R | Perm.W), '<Perm.R|W: 6>')
2399 self.assertEqual(repr(Perm.R | Perm.W | Perm.X), '<Perm.R|W|X: 7>')
2400 self.assertEqual(repr(Perm.R | 8), '<Perm.8|R: 12>')
2401 self.assertEqual(repr(Perm(0)), '<Perm.0: 0>')
2402 self.assertEqual(repr(Perm(8)), '<Perm.8: 8>')
2403 self.assertEqual(repr(~Perm.R), '<Perm.W|X: -5>')
2404 self.assertEqual(repr(~Perm.W), '<Perm.R|X: -3>')
2405 self.assertEqual(repr(~Perm.X), '<Perm.R|W: -2>')
2406 self.assertEqual(repr(~(Perm.R | Perm.W)), '<Perm.X: -7>')
2407 self.assertEqual(repr(~(Perm.R | Perm.W | Perm.X)), '<Perm.-8: -8>')
2408 self.assertEqual(repr(~(Perm.R | 8)), '<Perm.W|X: -13>')
2409 self.assertEqual(repr(Perm(~0)), '<Perm.R|W|X: -1>')
2410 self.assertEqual(repr(Perm(~8)), '<Perm.R|W|X: -9>')
2427 Perm = self.Perm
2428 for i in Perm:
2429 for j in Perm:
2432 self.assertIs(type(i | j), Perm)
2436 self.assertIs(type(i | j), Perm)
2439 self.assertIs(type(j | i), Perm)
2440 for i in Perm:
2448 Perm = self.Perm
2449 RW = Perm.R | Perm.W
2450 RX = Perm.R | Perm.X
2451 WX = Perm.W | Perm.X
2452 RWX = Perm.R | Perm.W | Perm.X
2453 values = list(Perm) + [RW, RX, WX, RWX, Perm(0)]
2458 self.assertIs(type(i & j), Perm, 'i is %r, j is %r' % (i, j))
2462 self.assertIs(type(i & j), Perm)
2465 self.assertIs(type(j & i), Perm)
2466 for i in Perm:
2474 Perm = self.Perm
2475 for i in Perm:
2476 for j in Perm:
2479 self.assertIs(type(i ^ j), Perm)
2483 self.assertIs(type(i ^ j), Perm)
2486 self.assertIs(type(j ^ i), Perm)
2487 for i in Perm:
2495 Perm = self.Perm
2496 RW = Perm.R | Perm.W
2497 RX = Perm.R | Perm.X
2498 WX = Perm.W | Perm.X
2499 RWX = Perm.R | Perm.W | Perm.X
2500 values = list(Perm) + [RW, RX, WX, RWX, Perm(0)]
2504 self.assertIs(type(~i), Perm)
2506 for i in Perm:
2513 Perm = IntFlag('Perm', 'R W X')
2514 lst = list(Perm)
2515 self.assertEqual(len(lst), len(Perm))
2516 self.assertEqual(len(Perm), 3, Perm)
2517 self.assertEqual(lst, [Perm.R, Perm.W, Perm.X])
2520 e = Perm(v)
2525 self.assertIn(e, Perm)
2526 self.assertIs(type(e), Perm)
2529 Perm = IntFlag('Perm', 'R W X', start=8)
2530 lst = list(Perm)
2531 self.assertEqual(len(lst), len(Perm))
2532 self.assertEqual(len(Perm), 3, Perm)
2533 self.assertEqual(lst, [Perm.R, Perm.W, Perm.X])
2536 e = Perm(v)
2541 self.assertIn(e, Perm)
2542 self.assertIs(type(e), Perm)
2545 Perm = IntFlag('Perm', ['R', 'W', 'X'])
2546 lst = list(Perm)
2547 self.assertEqual(len(lst), len(Perm))
2548 self.assertEqual(len(Perm), 3, Perm)
2549 self.assertEqual(lst, [Perm.R, Perm.W, Perm.X])
2552 e = Perm(v)
2557 self.assertIn(e, Perm)
2558 self.assertIs(type(e), Perm)
2561 Perm = IntFlag('Perm', (('R', 2), ('W', 8), ('X', 32)))
2562 lst = list(Perm)
2563 self.assertEqual(len(lst), len(Perm))
2564 self.assertEqual(len(Perm), 3, Perm)
2565 self.assertEqual(lst, [Perm.R, Perm.W, Perm.X])
2568 e = Perm(v)
2573 self.assertIn(e, Perm)
2574 self.assertIs(type(e), Perm)
2577 Perm = IntFlag('Perm', OrderedDict((('R', 2), ('W', 8), ('X', 32))))
2578 lst = list(Perm)
2579 self.assertEqual(len(lst), len(Perm))
2580 self.assertEqual(len(Perm), 3, Perm)
2581 self.assertEqual(lst, [Perm.R, Perm.W, Perm.X])
2584 e = Perm(v)
2589 self.assertIn(e, Perm)
2590 self.assertIs(type(e), Perm)
2594 Perm = enum.IntFlag('Perm', [])
2595 lst = list(Perm)
2596 self.assertEqual(len(lst), len(Perm))
2597 self.assertEqual(len(Perm), 0, Perm)
2605 Perm = enum.IntFlag('Perm', ())
2606 lst = list(Perm)
2607 self.assertEqual(len(lst), len(Perm))
2608 self.assertEqual(len(Perm), 0, Perm)
2630 Perm = self.Perm
2631 R, W, X = Perm
2652 Perm = self.Perm
2653 for f in Perm: