From 6b62edc0e4ecf6f8335e90868120bd05b8d74ba2 Mon Sep 17 00:00:00 2001 From: harshadyeola Date: Fri, 5 Dec 2014 15:17:35 +0530 Subject: [PATCH] added test cases --- ee/cli/main.py | 5 +++++ ee/core/domaincheck.py | 2 ++ tests/cli/test_ee.py | 51 +++++++++++++++++++++++++++++++++++++++++- 3 files changed, 57 insertions(+), 1 deletion(-) diff --git a/ee/cli/main.py b/ee/cli/main.py index 69cec1e9..5570b781 100644 --- a/ee/cli/main.py +++ b/ee/cli/main.py @@ -84,5 +84,10 @@ def main(): # Close the application app.close(code) + +def get_test_app(**kw): + app = EEApp(**kw) + return app + if __name__ == '__main__': main() diff --git a/ee/core/domaincheck.py b/ee/core/domaincheck.py index 62b40142..ea318af3 100644 --- a/ee/core/domaincheck.py +++ b/ee/core/domaincheck.py @@ -1,4 +1,6 @@ """EasyEngine domain check module.""" + + class EEDomainCheck(): """Intialization domain check""" diff --git a/tests/cli/test_ee.py b/tests/cli/test_ee.py index e79e172e..ad010863 100644 --- a/tests/cli/test_ee.py +++ b/tests/cli/test_ee.py @@ -1,6 +1,7 @@ """CLI tests for ee.""" from ee.utils import test +from ee.cli.main import get_test_app class CliTestCase(test.EETestCase): @@ -10,7 +11,55 @@ class CliTestCase(test.EETestCase): self.app.close() def test_ee_cli_site_create(self): - self.app = EETestApp(argv=['site', 'create', 'example.com']) + app = get_test_app(argv=['site', 'create', 'example.com']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_update(self): + app = get_test_app(argv=['site', 'update', 'example.com']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_delete(self): + app = get_test_app(argv=['site', 'delete', 'example.com']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_cd(self): + app = get_test_app(argv=['site', 'cd', 'example.com']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_log(self): + app = get_test_app(argv=['site', 'log', 'example.com']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_info(self): + app = get_test_app(argv=['site', 'info', 'example.com']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_enable(self): + app = get_test_app(argv=['site', 'enable', 'example.com']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_disable(self): + app = get_test_app(argv=['site', 'disable', 'example.com']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_edit(self): + app = get_test_app(argv=['site', 'edit', 'example.com']) self.app.setup() self.app.run() self.app.close()