mirror of
https://github.com/donnemartin/interactive-coding-challenges
synced 2026-01-11 20:08:04 +00:00
fixed execution counts
This commit is contained in:
27
arrays_strings/group_ordered/test_group_ordered.py
Normal file
27
arrays_strings/group_ordered/test_group_ordered.py
Normal file
@@ -0,0 +1,27 @@
|
||||
from nose.tools import assert_equal
|
||||
|
||||
class TestGroupOrdered(object):
|
||||
|
||||
def test_group_ordered(self,func):
|
||||
|
||||
assert_equal(func(None), None)
|
||||
assert_equal(func([]), [])
|
||||
assert_equal(func([1]), [1])
|
||||
assert_equal(func([1,2,1,3,2]),[1,1,2,2,3])
|
||||
assert_equal(func(['a','b','a']),['a','a','b'])
|
||||
assert_equal(func([1,1,2,3,4,5,2,1]),[1,1,1,2,2,3,4,5])
|
||||
assert_equal(func([1,2,3,4,3,4]),[1,2,3,3,4,4])
|
||||
print('Success: ' + func.__name__)
|
||||
|
||||
def main():
|
||||
test = TestGroupOrdered()
|
||||
test.test_group_ordered(group_ordered)
|
||||
try:
|
||||
test.test_group_ordered(group_ordered_alt)
|
||||
except NameError:
|
||||
# Alternate solutions are only defined
|
||||
# in the solutions file
|
||||
pass
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user