2020-07-04 10:56:49 -04:00
|
|
|
import unittest
|
2015-07-03 19:57:24 -04:00
|
|
|
|
|
|
|
|
2020-07-04 10:56:49 -04:00
|
|
|
class TestUniqueChars(unittest.TestCase):
|
2015-07-03 19:57:24 -04:00
|
|
|
|
2015-07-11 15:34:14 -04:00
|
|
|
def test_unique_chars(self, func):
|
2020-07-04 10:56:49 -04:00
|
|
|
self.assertEqual(func(None), False)
|
|
|
|
self.assertEqual(func(''), True)
|
|
|
|
self.assertEqual(func('foo'), False)
|
|
|
|
self.assertEqual(func('bar'), True)
|
2015-07-03 19:57:24 -04:00
|
|
|
print('Success: test_unique_chars')
|
|
|
|
|
2015-07-11 15:34:14 -04:00
|
|
|
|
2015-07-03 19:57:24 -04:00
|
|
|
def main():
|
|
|
|
test = TestUniqueChars()
|
2016-08-13 06:42:05 -04:00
|
|
|
unique_chars = UniqueChars()
|
|
|
|
test.test_unique_chars(unique_chars.has_unique_chars)
|
2015-07-03 19:57:24 -04:00
|
|
|
try:
|
2016-08-13 06:42:05 -04:00
|
|
|
unique_chars_set = UniqueCharsSet()
|
|
|
|
test.test_unique_chars(unique_chars_set.has_unique_chars)
|
|
|
|
unique_chars_in_place = UniqueCharsInPlace()
|
|
|
|
test.test_unique_chars(unique_chars_in_place.has_unique_chars)
|
2015-07-03 19:57:24 -04:00
|
|
|
except NameError:
|
|
|
|
# Alternate solutions are only defined
|
|
|
|
# in the solutions file
|
|
|
|
pass
|
2015-07-11 15:34:14 -04:00
|
|
|
|
|
|
|
|
2015-07-03 19:57:24 -04:00
|
|
|
if __name__ == '__main__':
|
2020-07-04 10:56:49 -04:00
|
|
|
main()
|