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"))
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')
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")
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")
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)
def setUp(self): self.s1 = sstr('abcde')