mirror of
https://github.com/donnemartin/interactive-coding-challenges
synced 2026-01-10 11:28:03 +00:00
Added rotation challenge and solution.
This commit is contained in:
19
arrays_strings/rotation/test_rotation.py
Normal file
19
arrays_strings/rotation/test_rotation.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from nose.tools import assert_equal
|
||||
|
||||
|
||||
class TestRotation(object):
|
||||
|
||||
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')
|
||||
|
||||
def main():
|
||||
test = TestRotation()
|
||||
test.test_rotation()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user