Esempio n. 1
0
 def test_sstr(self):
     s1 = sstr("abcde")
     self.assertEqual(s1 >> 0, sstr("abcde"))
     self.assertEqual(s1 << 0, sstr("abcde"))
     self.assertEqual(s1 << 2, sstr("cdeab"))
     self.assertEqual(s1 >> 2, sstr("deabc"))
     self.assertEqual(s1 >> 5, sstr("abcde"))
     self.assertTrue((s1 >> 5) << 5 == sstr("abcde"))
     s2 = sstr("abcdefghijlkmnopqrst")
     self.assertEqual(s2 >> 10, sstr("lkmnopqrstabcdefghij"))
Esempio n. 2
0
 def test_sstr(self):
     s1 = sstr("abcde")
     self.assertEqual(s1 << 0, 'abcde')
     self.assertEqual(s1 >> 0, 'abcde')
     self.assertEqual(s1 << 2, 'cdeab')
     self.assertEqual(s1 >> 2, 'deabc')
     self.assertEqual(s1 >> 5, 'abcde')
     self.assertTrue((s1 >> 5) << 5 == 'abcde')
Esempio n. 3
0
 def test_sstr(self):
     s1 = sstr("abcde")
     self.assertTrue(s1 << 0 == 'abcde', "'abcde' is expected")
     self.assertTrue(s1 >> 0 == 'abcde', "'abcde' is expected")
     self.assertTrue(s1 << 2 == 'cdeab', "'cdeab' is expected")
     self.assertTrue(s1 >> 2 == 'deabc', "'cdeab' is expected")
     self.assertTrue(s1 >> 5 == 'abcde', "'abcde' is expected")
     self.assertTrue((s1 >> 5) << 5 == 'abcde', "'abcde' is expected")
Esempio n. 4
0
 def test_sstr(self):
     s1 = sstr("abcde")
     self.assertTrue(s1 << 0 == "abcde", "'abcde' is expected")
     self.assertTrue(s1 >> 0 == "abcde", "'abcde' is expected")
     self.assertTrue(s1 << 2 == "cdeab", "'cdeab' is expected")
     self.assertTrue(s1 >> 2 == "deabc", "'cdeab' is expected")
     self.assertTrue(s1 >> 5 == "abcde", "'abcde' is expected")
     self.assertTrue((s1 >> 5) << 5 == "abcde", "'abcde' is expected")
Esempio n. 5
0
 def test_sstr(self):
     s1 = sstr("abcde")
     actual = s1 << 0
     expected = "abcde"
     self.assertEqual(actual, expected)
     actual = s1 >> 0
     self.assertEqual(actual, expected)
     actual = s1 >> 5
     self.assertEqual(actual, expected)
     actual = s1 << 2
     expected = "cdeab"
     self.assertEqual(actual, expected)
     actual = s1 >> 2
     expected = "deabc"
     self.assertEqual(actual, expected)
     actual = (s1 >> 5) << 5 == "abcde"
     expected = True
     self.assertEqual(actual, expected)
Esempio n. 6
0
 def setUp(self):
     self.s1 = sstr('abcde')