Browse Source

changes done in test case

bugfixes
shital.rtcamp 10 years ago
parent
commit
11ca0fdd8c
  1. 40
      tests/cli/test_clean.py
  2. 101
      tests/cli/test_debug.py
  3. 67
      tests/cli/test_ee.py
  4. 28
      tests/cli/test_info.py
  5. 28
      tests/cli/test_secure.py
  6. 2
      tests/cli/test_site_cd.py
  7. 24
      tests/cli/test_site_create.py
  8. 8
      tests/cli/test_site_delete.py
  9. 2
      tests/cli/test_site_disable.py
  10. 2
      tests/cli/test_site_edit.py
  11. 2
      tests/cli/test_site_enable.py
  12. 2
      tests/cli/test_site_info.py
  13. 0
      tests/cli/test_site_list.py
  14. 2
      tests/cli/test_site_log.py
  15. 2
      tests/cli/test_site_show.py
  16. 26
      tests/cli/test_site_update.py

40
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()

101
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()

67
tests/cli/test_ee.py

@ -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()

28
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()

28
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()

2
tests/cli/test_site_cd.py

@ -10,7 +10,7 @@ class CliTestCaseSite(test.EETestCase):
self.app.close()
def test_ee_cli_show_cd(self):
self.app = get_test_app(argv=['site', 'cd', 'site_name'])
self.app = get_test_app(argv=['site', 'cd', 'example.com'])
self.app.setup()
self.app.run()
self.app.close()

24
tests/cli/test_site_create.py

@ -10,58 +10,64 @@ class CliTestCaseSite(test.EETestCase):
self.app.close()
def test_ee_cli_site_create_html(self):
self.app = get_test_app(argv=['site', 'create', 'site_name', '--html'])
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', 'site_name', '--php'])
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', 'site_name',
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', 'site_name', '--wp'])
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', 'site_name',
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', 'site_name',
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', 'site_name', '--w3tc'])
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', 'site_name', '--wpfc'])
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', 'site_name', '--wpsc'])
self.app = get_test_app(argv=['site', 'create', 'example9.com',
'--wpsc'])
self.app.setup()
self.app.run()
self.app.close()

8
tests/test_site_delete.py → tests/cli/test_site_delete.py

@ -10,28 +10,28 @@ class CliTestCaseSite(test.EETestCase):
self.app.close()
def test_ee_cli_site_detele(self):
self.app = get_test_app(argv=['site', 'delete', 'site_name',
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', 'site_name',
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', 'site_name',
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', 'site_name',
self.app = get_test_app(argv=['site', 'delete', 'example4.com',
'--files'])
self.app.setup()
self.app.run()

2
tests/cli/test_site_disable.py

@ -10,7 +10,7 @@ class CliTestCaseSite(test.EETestCase):
self.app.close()
def test_ee_cli_site_disable(self):
self.app = get_test_app(argv=['site', 'disable', 'site_name'])
self.app = get_test_app(argv=['site', 'disable', 'example2.com'])
self.app.setup()
self.app.run()
self.app.close()

2
tests/cli/test_site_edit.py

@ -10,7 +10,7 @@ class CliTestCaseSite(test.EETestCase):
self.app.close()
def test_ee_cli_site_edit(self):
self.app = get_test_app(argv=['site', 'edit', 'site_name'])
self.app = get_test_app(argv=['site', 'edit', 'example1.com'])
self.app.setup()
self.app.run()
self.app.close()

2
tests/cli/test_site_enable.py

@ -10,7 +10,7 @@ class CliTestCaseSite(test.EETestCase):
self.app.close()
def test_ee_cli_site_enable(self):
self.app = get_test_app(argv=['site', 'enable', 'site_name'])
self.app = get_test_app(argv=['site', 'enable', 'example2.com'])
self.app.setup()
self.app.run()
self.app.close()

2
tests/cli/test_site_info.py

@ -10,7 +10,7 @@ class CliTestCaseSite(test.EETestCase):
self.app.close()
def test_ee_cli_site_info(self):
self.app = get_test_app(argv=['site', 'info', 'site_name'])
self.app = get_test_app(argv=['site', 'info', 'example1.com'])
self.app.setup()
self.app.run()
self.app.close()

0
tests/test_site_list.py → tests/cli/test_site_list.py

2
tests/cli/test_site_log.py

@ -10,7 +10,7 @@ class CliTestCaseSite(test.EETestCase):
self.app.close()
def test_ee_cli_site_log(self):
self.app = get_test_app(argv=['site', 'log', 'site_name'])
self.app = get_test_app(argv=['site', 'log', 'example1.com'])
self.app.setup()
self.app.run()
self.app.close()

2
tests/cli/test_site_show.py

@ -10,7 +10,7 @@ class CliTestCaseSite(test.EETestCase):
self.app.close()
def test_ee_cli_show_edit(self):
self.app = get_test_app(argv=['site', 'show', 'site_name'])
self.app = get_test_app(argv=['site', 'show', 'example.com'])
self.app.setup()
self.app.run()
self.app.close()

26
tests/cli/test_site_update.py

@ -10,65 +10,71 @@ class CliTestCaseSite(test.EETestCase):
self.app.close()
def test_ee_cli_site_update(self):
self.app = get_test_app(argv=['site', 'update', 'site_name',
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', 'site_name', '--html'])
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', 'site_name', '--php'])
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', 'site_name',
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', 'site_name', '--wp'])
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', 'site_name',
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', 'site_name',
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', 'site_name', '--w3tc'])
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', 'site_name', '--wpfc'])
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', 'site_name', '--wpsc'])
self.app = get_test_app(argv=['site', 'update', 'example9.com',
'--wpsc'])
self.app.setup()
self.app.run()
self.app.close()

Loading…
Cancel
Save