Commit 68ded13f authored by zhifan huang's avatar zhifan huang

add setup enter-point for unittest; use testsuite

parent b86c19c4
...@@ -81,6 +81,7 @@ setup( ...@@ -81,6 +81,7 @@ setup(
're6st-conf=re6st.cli.conf:main', 're6st-conf=re6st.cli.conf:main',
're6stnet=re6st.cli.node:main', 're6stnet=re6st.cli.node:main',
're6st-registry=re6st.cli.registry:main', 're6st-registry=re6st.cli.registry:main',
're6st-testrunner=tests.test_registry:main'
], ],
}, },
package_data = { package_data = {
......
...@@ -499,5 +499,15 @@ class TestRegistrtServer(unittest.TestCase): ...@@ -499,5 +499,15 @@ class TestRegistrtServer(unittest.TestCase):
self.assertEqual(res, expect_res) self.assertEqual(res, expect_res)
def main():
test_dir = os.path.dirname(os.path.abspath(__file__))
os.chdir(test_dir)
suite = unittest.TestSuite()
for method in dir(TestRegistrtServer):
if method.startswith("test"):
suite.addTest(TestRegistrtServer(method))
unittest.TextTestRunner().run(suite)
if __name__ == "__main__": if __name__ == "__main__":
unittest.main() main()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment