mirror of
https://github.com/donnemartin/interactive-coding-challenges
synced 2026-01-03 07:58:02 +00:00
24 lines
651 B
Python
24 lines
651 B
Python
from nose.tools import assert_equal, assert_raises
|
|
|
|
|
|
class TestLongestCommonSubseq(object):
|
|
|
|
def test_longest_common_subseq(self):
|
|
str_comp = StringCompare()
|
|
assert_raises(TypeError, str_comp.longest_common_subseq, None, None)
|
|
assert_equal(str_comp.longest_common_subseq('', ''), '')
|
|
str0 = 'ABCDEFGHIJ'
|
|
str1 = 'FOOBCDBCDE'
|
|
expected = 'BCDE'
|
|
assert_equal(str_comp.longest_common_subseq(str0, str1), expected)
|
|
print('Success: test_longest_common_subseq')
|
|
|
|
|
|
def main():
|
|
test = TestLongestCommonSubseq()
|
|
test.test_longest_common_subseq()
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|