From 90d723b01a27e8c9d283c0683ab049d74c85b982 Mon Sep 17 00:00:00 2001 From: Yuming Zhu Date: Oct 26 2016 17:41:12 +0000 Subject: ut: cli - test_unique_path --- diff --git a/tests/test_cli/test_unique_path.py b/tests/test_cli/test_unique_path.py new file mode 100644 index 0000000..528b882 --- /dev/null +++ b/tests/test_cli/test_unique_path.py @@ -0,0 +1,16 @@ +import unittest + +import loadcli + +cli = loadcli.cli + + +class TestUniquePath(unittest.TestCase): + + def test_unique_path(self): + for i in range(1000): + self.assertNotEqual(cli._unique_path('prefix'), cli._unique_path('prefix')) + self.assertRegexpMatches(cli._unique_path('prefix'), '^prefix/\d{10}\.\d{1,6}\.[a-zA-Z]{8}$') + +if __name__ == '__main__': + unittest.main()