interactive-coding-challenges/arrays_strings/rotation/test_rotation.py

21 lines
512 B
Python
Raw Normal View History

2015-06-30 08:30:47 +08:00
from nose.tools import assert_equal
class TestRotation(object):
2015-07-12 03:34:14 +08:00
2015-06-30 08:30:47 +08:00
def test_rotation(self):
assert_equal(is_rotation('o', 'oo'), False)
assert_equal(is_rotation(None, 'foo'), False)
assert_equal(is_rotation('', 'foo'), False)
assert_equal(is_rotation('', ''), True)
assert_equal(is_rotation('foobarbaz', 'barbazfoo'), True)
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__':
main()