Lines Matching refs:Perm
2223 class Perm(Flag): class in TestFlag
2241 Perm = self.Perm
2242 self.assertEqual(str(Perm.R), 'Perm.R')
2243 self.assertEqual(str(Perm.W), 'Perm.W')
2244 self.assertEqual(str(Perm.X), 'Perm.X')
2245 self.assertEqual(str(Perm.R | Perm.W), 'Perm.R|W')
2246 self.assertEqual(str(Perm.R | Perm.W | Perm.X), 'Perm.R|W|X')
2247 self.assertEqual(str(Perm(0)), 'Perm.0')
2248 self.assertEqual(str(~Perm.R), 'Perm.W|X')
2249 self.assertEqual(str(~Perm.W), 'Perm.R|X')
2250 self.assertEqual(str(~Perm.X), 'Perm.R|W')
2251 self.assertEqual(str(~(Perm.R | Perm.W)), 'Perm.X')
2252 self.assertEqual(str(~(Perm.R | Perm.W | Perm.X)), 'Perm.0')
2253 self.assertEqual(str(Perm(~0)), 'Perm.R|W|X')
2268 Perm = self.Perm
2269 self.assertEqual(repr(Perm.R), '<Perm.R: 4>')
2270 self.assertEqual(repr(Perm.W), '<Perm.W: 2>')
2271 self.assertEqual(repr(Perm.X), '<Perm.X: 1>')
2272 self.assertEqual(repr(Perm.R | Perm.W), '<Perm.R|W: 6>')
2273 self.assertEqual(repr(Perm.R | Perm.W | Perm.X), '<Perm.R|W|X: 7>')
2274 self.assertEqual(repr(Perm(0)), '<Perm.0: 0>')
2275 self.assertEqual(repr(~Perm.R), '<Perm.W|X: 3>')
2276 self.assertEqual(repr(~Perm.W), '<Perm.R|X: 5>')
2277 self.assertEqual(repr(~Perm.X), '<Perm.R|W: 6>')
2278 self.assertEqual(repr(~(Perm.R | Perm.W)), '<Perm.X: 1>')
2279 self.assertEqual(repr(~(Perm.R | Perm.W | Perm.X)), '<Perm.0: 0>')
2280 self.assertEqual(repr(Perm(~0)), '<Perm.R|W|X: 7>')
2295 Perm = self.Perm
2296 self.assertEqual(format(Perm.R, ''), 'Perm.R')
2297 self.assertEqual(format(Perm.R | Perm.X, ''), 'Perm.R|X')
2300 Perm = self.Perm
2301 for i in Perm:
2302 for j in Perm:
2303 self.assertEqual((i | j), Perm(i.value | j.value))
2305 self.assertIs(type(i | j), Perm)
2306 for i in Perm:
2312 Perm = self.Perm
2313 RW = Perm.R | Perm.W
2314 RX = Perm.R | Perm.X
2315 WX = Perm.W | Perm.X
2316 RWX = Perm.R | Perm.W | Perm.X
2317 values = list(Perm) + [RW, RX, WX, RWX, Perm(0)]
2321 self.assertIs(type(i & j), Perm)
2322 for i in Perm:
2330 Perm = self.Perm
2331 for i in Perm:
2332 for j in Perm:
2334 self.assertIs(type(i ^ j), Perm)
2335 for i in Perm:
2336 self.assertIs(i ^ Perm(0), i)
2337 self.assertIs(Perm(0) ^ i, i)
2343 Perm = self.Perm
2344 RW = Perm.R | Perm.W
2345 RX = Perm.R | Perm.X
2346 WX = Perm.W | Perm.X
2347 RWX = Perm.R | Perm.W | Perm.X
2348 values = list(Perm) + [RW, RX, WX, RWX, Perm(0)]
2350 self.assertIs(type(~i), Perm)
2352 for i in Perm:
2359 Perm = self.Perm
2360 for f in Perm:
2367 Perm = Flag('Perm', 'R W X')
2368 lst = list(Perm)
2369 self.assertEqual(len(lst), len(Perm))
2370 self.assertEqual(len(Perm), 3, Perm)
2371 self.assertEqual(lst, [Perm.R, Perm.W, Perm.X])
2374 e = Perm(v)
2378 self.assertIn(e, Perm)
2379 self.assertIs(type(e), Perm)
2382 Perm = Flag('Perm', 'R W X', start=8)
2383 lst = list(Perm)
2384 self.assertEqual(len(lst), len(Perm))
2385 self.assertEqual(len(Perm), 3, Perm)
2386 self.assertEqual(lst, [Perm.R, Perm.W, Perm.X])
2389 e = Perm(v)
2393 self.assertIn(e, Perm)
2394 self.assertIs(type(e), Perm)
2397 Perm = Flag('Perm', ['R', 'W', 'X'])
2398 lst = list(Perm)
2399 self.assertEqual(len(lst), len(Perm))
2400 self.assertEqual(len(Perm), 3, Perm)
2401 self.assertEqual(lst, [Perm.R, Perm.W, Perm.X])
2404 e = Perm(v)
2408 self.assertIn(e, Perm)
2409 self.assertIs(type(e), Perm)
2412 Perm = Flag('Perm', (('R', 2), ('W', 8), ('X', 32)))
2413 lst = list(Perm)
2414 self.assertEqual(len(lst), len(Perm))
2415 self.assertEqual(len(Perm), 3, Perm)
2416 self.assertEqual(lst, [Perm.R, Perm.W, Perm.X])
2419 e = Perm(v)
2423 self.assertIn(e, Perm)
2424 self.assertIs(type(e), Perm)
2427 Perm = Flag('Perm', OrderedDict((('R', 2), ('W', 8), ('X', 32))))
2428 lst = list(Perm)
2429 self.assertEqual(len(lst), len(Perm))
2430 self.assertEqual(len(Perm), 3, Perm)
2431 self.assertEqual(lst, [Perm.R, Perm.W, Perm.X])
2434 e = Perm(v)
2438 self.assertIn(e, Perm)
2439 self.assertIs(type(e), Perm)
2485 Perm = self.Perm
2486 R, W, X = Perm
2670 class Perm(IntFlag): class in TestIntFlag
2690 Perm = self.Perm
2691 self.assertTrue(Perm._member_type_ is int)
2693 for f in Perm:
2694 self.assertTrue(isinstance(f, Perm))
2696 self.assertTrue(isinstance(Perm.W | Perm.X, Perm))
2697 self.assertEqual(Perm.W | Perm.X, 3)
2706 Perm = self.Perm
2707 self.assertEqual(str(Perm.R), 'Perm.R')
2708 self.assertEqual(str(Perm.W), 'Perm.W')
2709 self.assertEqual(str(Perm.X), 'Perm.X')
2710 self.assertEqual(str(Perm.R | Perm.W), 'Perm.R|W')
2711 self.assertEqual(str(Perm.R | Perm.W | Perm.X), 'Perm.R|W|X')
2712 self.assertEqual(str(Perm.R | 8), 'Perm.8|R')
2713 self.assertEqual(str(Perm(0)), 'Perm.0')
2714 self.assertEqual(str(Perm(8)), 'Perm.8')
2715 self.assertEqual(str(~Perm.R), 'Perm.W|X')
2716 self.assertEqual(str(~Perm.W), 'Perm.R|X')
2717 self.assertEqual(str(~Perm.X), 'Perm.R|W')
2718 self.assertEqual(str(~(Perm.R | Perm.W)), 'Perm.X')
2719 self.assertEqual(str(~(Perm.R | Perm.W | Perm.X)), 'Perm.-8')
2720 self.assertEqual(str(~(Perm.R | 8)), 'Perm.W|X')
2721 self.assertEqual(str(Perm(~0)), 'Perm.R|W|X')
2722 self.assertEqual(str(Perm(~8)), 'Perm.R|W|X')
2739 Perm = self.Perm
2740 self.assertEqual(repr(Perm.R), '<Perm.R: 4>')
2741 self.assertEqual(repr(Perm.W), '<Perm.W: 2>')
2742 self.assertEqual(repr(Perm.X), '<Perm.X: 1>')
2743 self.assertEqual(repr(Perm.R | Perm.W), '<Perm.R|W: 6>')
2744 self.assertEqual(repr(Perm.R | Perm.W | Perm.X), '<Perm.R|W|X: 7>')
2745 self.assertEqual(repr(Perm.R | 8), '<Perm.8|R: 12>')
2746 self.assertEqual(repr(Perm(0)), '<Perm.0: 0>')
2747 self.assertEqual(repr(Perm(8)), '<Perm.8: 8>')
2748 self.assertEqual(repr(~Perm.R), '<Perm.W|X: -5>')
2749 self.assertEqual(repr(~Perm.W), '<Perm.R|X: -3>')
2750 self.assertEqual(repr(~Perm.X), '<Perm.R|W: -2>')
2751 self.assertEqual(repr(~(Perm.R | Perm.W)), '<Perm.X: -7>')
2752 self.assertEqual(repr(~(Perm.R | Perm.W | Perm.X)), '<Perm.-8: -8>')
2753 self.assertEqual(repr(~(Perm.R | 8)), '<Perm.W|X: -13>')
2754 self.assertEqual(repr(Perm(~0)), '<Perm.R|W|X: -1>')
2755 self.assertEqual(repr(Perm(~8)), '<Perm.R|W|X: -9>')
2772 Perm = self.Perm
2773 self.assertEqual(format(Perm.R, ''), '4')
2774 self.assertEqual(format(Perm.R | Perm.X, ''), '5')
2777 Perm = self.Perm
2778 for i in Perm:
2779 for j in Perm:
2782 self.assertIs(type(i | j), Perm)
2786 self.assertIs(type(i | j), Perm)
2789 self.assertIs(type(j | i), Perm)
2790 for i in Perm:
2798 Perm = self.Perm
2799 RW = Perm.R | Perm.W
2800 RX = Perm.R | Perm.X
2801 WX = Perm.W | Perm.X
2802 RWX = Perm.R | Perm.W | Perm.X
2803 values = list(Perm) + [RW, RX, WX, RWX, Perm(0)]
2808 self.assertIs(type(i & j), Perm, 'i is %r, j is %r' % (i, j))
2812 self.assertIs(type(i & j), Perm)
2815 self.assertIs(type(j & i), Perm)
2816 for i in Perm:
2824 Perm = self.Perm
2825 for i in Perm:
2826 for j in Perm:
2829 self.assertIs(type(i ^ j), Perm)
2833 self.assertIs(type(i ^ j), Perm)
2836 self.assertIs(type(j ^ i), Perm)
2837 for i in Perm:
2845 Perm = self.Perm
2846 RW = Perm.R | Perm.W
2847 RX = Perm.R | Perm.X
2848 WX = Perm.W | Perm.X
2849 RWX = Perm.R | Perm.W | Perm.X
2850 values = list(Perm) + [RW, RX, WX, RWX, Perm(0)]
2854 self.assertIs(type(~i), Perm)
2856 for i in Perm:
2863 Perm = IntFlag('Perm', 'R W X')
2864 lst = list(Perm)
2865 self.assertEqual(len(lst), len(Perm))
2866 self.assertEqual(len(Perm), 3, Perm)
2867 self.assertEqual(lst, [Perm.R, Perm.W, Perm.X])
2870 e = Perm(v)
2875 self.assertIn(e, Perm)
2876 self.assertIs(type(e), Perm)
2879 Perm = IntFlag('Perm', 'R W X', start=8)
2880 lst = list(Perm)
2881 self.assertEqual(len(lst), len(Perm))
2882 self.assertEqual(len(Perm), 3, Perm)
2883 self.assertEqual(lst, [Perm.R, Perm.W, Perm.X])
2886 e = Perm(v)
2891 self.assertIn(e, Perm)
2892 self.assertIs(type(e), Perm)
2895 Perm = IntFlag('Perm', ['R', 'W', 'X'])
2896 lst = list(Perm)
2897 self.assertEqual(len(lst), len(Perm))
2898 self.assertEqual(len(Perm), 3, Perm)
2899 self.assertEqual(lst, [Perm.R, Perm.W, Perm.X])
2902 e = Perm(v)
2907 self.assertIn(e, Perm)
2908 self.assertIs(type(e), Perm)
2911 Perm = IntFlag('Perm', (('R', 2), ('W', 8), ('X', 32)))
2912 lst = list(Perm)
2913 self.assertEqual(len(lst), len(Perm))
2914 self.assertEqual(len(Perm), 3, Perm)
2915 self.assertEqual(lst, [Perm.R, Perm.W, Perm.X])
2918 e = Perm(v)
2923 self.assertIn(e, Perm)
2924 self.assertIs(type(e), Perm)
2927 Perm = IntFlag('Perm', OrderedDict((('R', 2), ('W', 8), ('X', 32))))
2928 lst = list(Perm)
2929 self.assertEqual(len(lst), len(Perm))
2930 self.assertEqual(len(Perm), 3, Perm)
2931 self.assertEqual(lst, [Perm.R, Perm.W, Perm.X])
2934 e = Perm(v)
2939 self.assertIn(e, Perm)
2940 self.assertIs(type(e), Perm)
2944 Perm = enum.IntFlag('Perm', [])
2945 lst = list(Perm)
2946 self.assertEqual(len(lst), len(Perm))
2947 self.assertEqual(len(Perm), 0, Perm)
2955 Perm = enum.IntFlag('Perm', ())
2956 lst = list(Perm)
2957 self.assertEqual(len(lst), len(Perm))
2958 self.assertEqual(len(Perm), 0, Perm)
3004 Perm = self.Perm
3005 R, W, X = Perm
3026 Perm = self.Perm
3027 for f in Perm: