diff --git a/tests/cli/test_clean.py b/tests/cli/test_clean.py new file mode 100644 index 00000000..39254bff --- /dev/null +++ b/tests/cli/test_clean.py @@ -0,0 +1,40 @@ +from ee.utils import test +from ee.cli.main import get_test_app + + +class CliTestCaseClean(test.EETestCase): + + def test_ee_cli(self): + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_clean(self): + self.app = get_test_app(argv=['clean']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_clean_fastcgi(self): + self.app = get_test_app(argv=['clean', '--fastcgi']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_clean_all(self): + self.app = get_test_app(argv=['clean', '--all']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_clean_memcache(self): + self.app = get_test_app(argv=['clean', '--memcache']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_clean_opcache(self): + self.app = get_test_app(argv=['clean', '--opcache']) + self.app.setup() + self.app.run() + self.app.close() diff --git a/tests/cli/test_debug.py b/tests/cli/test_debug.py new file mode 100644 index 00000000..8d02c28e --- /dev/null +++ b/tests/cli/test_debug.py @@ -0,0 +1,101 @@ +from ee.utils import test +from ee.cli.main import get_test_app + + +class CliTestCaseDebug(test.EETestCase): + + def test_ee_cli(self): + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_debug_stop(self): + self.app = get_test_app(argv=['debug', '--stop']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_debug_start(self): + self.app = get_test_app(argv=['debug', '--start']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_debug_php(self): + self.app = get_test_app(argv=['debug', '--php']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_debug_nginx(self): + self.app = get_test_app(argv=['debug', '--nginx']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_debug_rewrite(self): + self.app = get_test_app(argv=['debug', '--rewrite']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_debug_fpm(self): + self.app = get_test_app(argv=['debug', '--fpm']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_debug_mysql(self): + self.app = get_test_app(argv=['debug', '--mysql']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_debug_import_slow_log_interval(self): + self.app = get_test_app(argv=['debug', '--mysql', + '--import-slow-log-interval']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_debug_site_name_mysql(self): + self.app = get_test_app(argv=['debug', 'example3.com', '--mysql']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_debug_site_name_wp(self): + self.app = get_test_app(argv=['debug', 'example4.com', '--wp']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_debug_site_name_nginx(self): + self.app = get_test_app(argv=['debug', 'example4.com', '--nginx']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_debug_site_name_start(self): + self.app = get_test_app(argv=['debug', 'example.com', '--start']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_debug_site_name_stop(self): + self.app = get_test_app(argv=['debug', 'example.com', '--stop']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_debug_site_name_rewrite(self): + self.app = get_test_app(argv=['debug', 'example.com', '--rewrite']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_debug(self): + self.app = get_test_app(argv=['debug']) + self.app.setup() + self.app.run() + self.app.close() diff --git a/tests/cli/test_ee.py b/tests/cli/test_ee.py deleted file mode 100644 index f02da325..00000000 --- a/tests/cli/test_ee.py +++ /dev/null @@ -1,67 +0,0 @@ -"""CLI tests for ee.""" - -from ee.utils import test -from ee.cli.main import get_test_app - - -class CliTestCase(test.EETestCase): - def test_ee_cli(self): - self.app.setup() - self.app.run() - self.app.close() - - def test_ee_cli_site_create(self): - self.app = get_test_app(argv=['site', 'create', 'example.com']) - self.app.setup() - self.app.run() - data, output = self.app.last_rendered - self.eq(output, 'Inside EESiteCreateController.default().\n') - self.app.close() - - def test_ee_cli_site_update(self): - 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): - 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): - 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): - 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): - 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): - 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): - 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): - self.app = get_test_app(argv=['site', 'edit', 'example.com']) - self.app.setup() - self.app.run() - self.app.close() diff --git a/tests/cli/test_info.py b/tests/cli/test_info.py new file mode 100644 index 00000000..0c36edb4 --- /dev/null +++ b/tests/cli/test_info.py @@ -0,0 +1,28 @@ +from ee.utils import test +from ee.cli.main import get_test_app + + +class CliTestCaseInfo(test.EETestCase): + + def test_ee_cli(self): + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_info_mysql(self): + self.app = get_test_app(argv=['info', '--mysql']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_info_php(self): + self.app = get_test_app(argv=['info', '--php']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_info_nginx(self): + self.app = get_test_app(argv=['info', '--nginx']) + self.app.setup() + self.app.run() + self.app.close() diff --git a/tests/cli/test_secure.py b/tests/cli/test_secure.py new file mode 100644 index 00000000..d867a2e8 --- /dev/null +++ b/tests/cli/test_secure.py @@ -0,0 +1,28 @@ +from ee.utils import test +from ee.cli.main import get_test_app + + +class CliTestCaseSecure(test.EETestCase): + + def test_ee_cli(self): + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_secure_auth(self): + self.app = get_test_app(argv=['secure', '--auth']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_secure_port(self): + self.app = get_test_app(argv=['secure', '--port']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_secure_ip(self): + self.app = get_test_app(argv=['secure', '--ip']) + self.app.setup() + self.app.run() + self.app.close() diff --git a/tests/cli/test_site_cd.py b/tests/cli/test_site_cd.py new file mode 100644 index 00000000..51d55bec --- /dev/null +++ b/tests/cli/test_site_cd.py @@ -0,0 +1,16 @@ +from ee.utils import test +from ee.cli.main import get_test_app + + +class CliTestCaseSite(test.EETestCase): + + def test_ee_cli(self): + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_show_cd(self): + self.app = get_test_app(argv=['site', 'cd', 'example.com']) + self.app.setup() + self.app.run() + self.app.close() diff --git a/tests/cli/test_site_create.py b/tests/cli/test_site_create.py new file mode 100644 index 00000000..3b3a2554 --- /dev/null +++ b/tests/cli/test_site_create.py @@ -0,0 +1,73 @@ +from ee.utils import test +from ee.cli.main import get_test_app + + +class CliTestCaseSite(test.EETestCase): + + def test_ee_cli(self): + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_create_html(self): + self.app = get_test_app(argv=['site', 'create', 'example1.com', + '--html']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_create_php(self): + self.app = get_test_app(argv=['site', 'create', 'example2.com', + '--php']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_create_mysql(self): + self.app = get_test_app(argv=['site', 'create', 'example3.com', + '--mysql']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_create_wp(self): + self.app = get_test_app(argv=['site', 'create', 'example4.com', + '--wp']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_create_wpsubdir(self): + self.app = get_test_app(argv=['site', 'create', 'example5.com', + '--wpsubdir']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_create_wpsubdomain(self): + self.app = get_test_app(argv=['site', 'create', 'example6.com', + '--wpsubdomain']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_create_w3tc(self): + self.app = get_test_app(argv=['site', 'create', 'example7.com', + '--w3tc']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_create_wpfc(self): + self.app = get_test_app(argv=['site', 'create', 'example8.com', + '--wpfc']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_create_wpsc(self): + self.app = get_test_app(argv=['site', 'create', 'example9.com', + '--wpsc']) + self.app.setup() + self.app.run() + self.app.close() diff --git a/tests/cli/test_site_delete.py b/tests/cli/test_site_delete.py new file mode 100644 index 00000000..2a2dfe8d --- /dev/null +++ b/tests/cli/test_site_delete.py @@ -0,0 +1,38 @@ +from ee.utils import test +from ee.cli.main import get_test_app + + +class CliTestCaseSite(test.EETestCase): + + def test_ee_cli(self): + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_detele(self): + self.app = get_test_app(argv=['site', 'delete', 'example1.com', + '--no-prompt']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_detele_all(self): + self.app = get_test_app(argv=['site', 'delete', 'example2.com', + '--all']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_detele_db(self): + self.app = get_test_app(argv=['site', 'delete', 'example3.com', + '--db']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_detele_files(self): + self.app = get_test_app(argv=['site', 'delete', 'example4.com', + '--files']) + self.app.setup() + self.app.run() + self.app.close() diff --git a/tests/cli/test_site_disable.py b/tests/cli/test_site_disable.py new file mode 100644 index 00000000..3d948f77 --- /dev/null +++ b/tests/cli/test_site_disable.py @@ -0,0 +1,16 @@ +from ee.utils import test +from ee.cli.main import get_test_app + + +class CliTestCaseSite(test.EETestCase): + + def test_ee_cli(self): + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_disable(self): + self.app = get_test_app(argv=['site', 'disable', 'example2.com']) + self.app.setup() + self.app.run() + self.app.close() diff --git a/tests/cli/test_site_edit.py b/tests/cli/test_site_edit.py new file mode 100644 index 00000000..ebeee4f5 --- /dev/null +++ b/tests/cli/test_site_edit.py @@ -0,0 +1,16 @@ +from ee.utils import test +from ee.cli.main import get_test_app + + +class CliTestCaseSite(test.EETestCase): + + def test_ee_cli(self): + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_edit(self): + self.app = get_test_app(argv=['site', 'edit', 'example1.com']) + self.app.setup() + self.app.run() + self.app.close() diff --git a/tests/cli/test_site_enable.py b/tests/cli/test_site_enable.py new file mode 100644 index 00000000..87cc4f85 --- /dev/null +++ b/tests/cli/test_site_enable.py @@ -0,0 +1,16 @@ +from ee.utils import test +from ee.cli.main import get_test_app + + +class CliTestCaseSite(test.EETestCase): + + def test_ee_cli(self): + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_enable(self): + self.app = get_test_app(argv=['site', 'enable', 'example2.com']) + self.app.setup() + self.app.run() + self.app.close() diff --git a/tests/cli/test_site_info.py b/tests/cli/test_site_info.py new file mode 100644 index 00000000..1ecc2062 --- /dev/null +++ b/tests/cli/test_site_info.py @@ -0,0 +1,16 @@ +from ee.utils import test +from ee.cli.main import get_test_app + + +class CliTestCaseSite(test.EETestCase): + + def test_ee_cli(self): + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_info(self): + self.app = get_test_app(argv=['site', 'info', 'example1.com']) + self.app.setup() + self.app.run() + self.app.close() diff --git a/tests/cli/test_site_list.py b/tests/cli/test_site_list.py new file mode 100644 index 00000000..477e6915 --- /dev/null +++ b/tests/cli/test_site_list.py @@ -0,0 +1,22 @@ +from ee.utils import test +from ee.cli.main import get_test_app + + +class CliTestCaseSite(test.EETestCase): + + def test_ee_cli(self): + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_list_enable(self): + self.app = get_test_app(argv=['site', 'list', '--enabled']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_list_disable(self): + self.app = get_test_app(argv=['site', 'list', '--disabled']) + self.app.setup() + self.app.run() + self.app.close() diff --git a/tests/cli/test_site_log.py b/tests/cli/test_site_log.py new file mode 100644 index 00000000..e73f4c6f --- /dev/null +++ b/tests/cli/test_site_log.py @@ -0,0 +1,16 @@ +from ee.utils import test +from ee.cli.main import get_test_app + + +class CliTestCaseSite(test.EETestCase): + + def test_ee_cli(self): + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_log(self): + self.app = get_test_app(argv=['site', 'log', 'example1.com']) + self.app.setup() + self.app.run() + self.app.close() diff --git a/tests/cli/test_site_show.py b/tests/cli/test_site_show.py new file mode 100644 index 00000000..ba6c4f1f --- /dev/null +++ b/tests/cli/test_site_show.py @@ -0,0 +1,16 @@ +from ee.utils import test +from ee.cli.main import get_test_app + + +class CliTestCaseSite(test.EETestCase): + + def test_ee_cli(self): + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_show_edit(self): + self.app = get_test_app(argv=['site', 'show', 'example.com']) + self.app.setup() + self.app.run() + self.app.close() diff --git a/tests/cli/test_site_update.py b/tests/cli/test_site_update.py new file mode 100644 index 00000000..3f46d400 --- /dev/null +++ b/tests/cli/test_site_update.py @@ -0,0 +1,80 @@ +from ee.utils import test +from ee.cli.main import get_test_app + + +class CliTestCaseSite(test.EETestCase): + + def test_ee_cli(self): + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_update(self): + self.app = get_test_app(argv=['site', 'update', 'example.com', + '--password']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_update_html(self): + self.app = get_test_app(argv=['site', 'update', 'example1.com', + '--html']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_update_php(self): + self.app = get_test_app(argv=['site', 'update', 'example2.com', + '--php']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_update_mysql(self): + self.app = get_test_app(argv=['site', 'update', 'example3.com', + '--mysql']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_update_wp(self): + self.app = get_test_app(argv=['site', 'update', 'example4.com', + '--wp']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_update_wpsubdir(self): + self.app = get_test_app(argv=['site', 'update', 'example5.com', + '--wpsubdir']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_update_wpsubdomain(self): + self.app = get_test_app(argv=['site', 'update', 'example6.com', + '--wpsubdomain']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_update_w3tc(self): + self.app = get_test_app(argv=['site', 'update', 'example7.com', + '--w3tc']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_update_wpfc(self): + self.app = get_test_app(argv=['site', 'update', 'example8.com', + '--wpfc']) + self.app.setup() + self.app.run() + self.app.close() + + def test_ee_cli_site_update_wpsc(self): + self.app = get_test_app(argv=['site', 'update', 'example9.com', + '--wpsc']) + self.app.setup() + self.app.run() + self.app.close()