2020-07-04 22:56:49 +08:00
|
|
|
import unittest
|
2015-06-30 08:30:47 +08:00
|
|
|
|
|
|
|
|
2020-07-04 22:56:49 +08:00
|
|
|
class TestRotation(unittest.TestCase):
|
2015-07-12 03:34:14 +08:00
|
|
|
|
2015-06-30 08:30:47 +08:00
|
|
|
def test_rotation(self):
|
2016-08-13 18:40:52 +08:00
|
|
|
rotation = Rotation()
|
2020-07-04 22:56:49 +08:00
|
|
|
self.assertEqual(rotation.is_rotation('o', 'oo'), False)
|
|
|
|
self.assertEqual(rotation.is_rotation(None, 'foo'), False)
|
|
|
|
self.assertEqual(rotation.is_rotation('', 'foo'), False)
|
|
|
|
self.assertEqual(rotation.is_rotation('', ''), True)
|
|
|
|
self.assertEqual(rotation.is_rotation('foobarbaz', 'barbazfoo'), True)
|
2015-06-30 08:30:47 +08:00
|
|
|
print('Success: test_rotation')
|
|
|
|
|
2015-07-12 03:34:14 +08:00
|
|
|
|
2015-06-30 08:30:47 +08:00
|
|
|
def main():
|
|
|
|
test = TestRotation()
|
|
|
|
test.test_rotation()
|
|
|
|
|
2015-07-12 03:34:14 +08:00
|
|
|
|
2015-06-30 08:30:47 +08:00
|
|
|
if __name__ == '__main__':
|
2020-07-04 22:56:49 +08:00
|
|
|
main()
|