Browse Source

Merge branch 'python' of github.com:rtCamp/easyengine into python

bugfixes
gau1991 10 years ago
parent
commit
8d232bad3f
  1. 6
      ee/cli/bootstrap.py
  2. 22
      ee/cli/plugins/site.py
  3. 76
      tests/cli/test_stack_purge.py
  4. 76
      tests/cli/test_stack_remove.py
  5. 52
      tests/cli/test_stack_services_restart.py
  6. 52
      tests/cli/test_stack_services_start.py
  7. 52
      tests/cli/test_stack_services_status.py
  8. 52
      tests/cli/test_stack_services_stop.py

6
ee/cli/bootstrap.py

@ -5,9 +5,6 @@
from cement.core import handler
from ee.cli.controllers.base import EEBaseController
from ee.cli.controllers.site import EESiteController
from ee.cli.controllers.site import EESiteCreateController
from ee.cli.controllers.site import EESiteUpdateController
from ee.cli.controllers.debug import EEDebugController
from ee.cli.controllers.clean import EECleanController
from ee.cli.controllers.secure import EESecureController
@ -17,9 +14,6 @@ from ee.cli.controllers.info import EEInfoController
def load(app):
handler.register(EEBaseController)
handler.register(EESiteController)
handler.register(EESiteCreateController)
handler.register(EESiteUpdateController)
handler.register(EEDebugController)
handler.register(EECleanController)
handler.register(EEInfoController)

22
ee/cli/controllers/site.py → ee/cli/plugins/site.py

@ -1,7 +1,11 @@
"""EasyEngine site controller."""
from cement.core.controller import CementBaseController, expose
from ee.core.dummy import EEDummy
from cement.core import handler, hook
def ee_site_hook(app):
# do something with the ``app`` object here.
pass
class EESiteController(CementBaseController):
@ -9,8 +13,8 @@ class EESiteController(CementBaseController):
label = 'site'
stacked_on = 'base'
stacked_type = 'nested'
description = 'site command manages website configuration with the help \
of the following subcommands'
description = ('site command manages website configuration'
'with the help of the following subcommands')
arguments = [
(['site_name'],
dict(help='website name')),
@ -142,3 +146,13 @@ class EESiteUpdateController(CementBaseController):
# The 'default.mustache' file would be loaded from
# ``ee.cli.templates``, or ``/var/lib/ee/templates/``.
#
def load(app):
# register the plugin class.. this only happens if the plugin is enabled
handler.register(EESiteController)
handler.register(EESiteCreateController)
handler.register(EESiteUpdateController)
# register a hook (function) to run after arguments are parsed.
hook.register('post_argument_parsing', ee_site_hook)

76
tests/cli/test_stack_purge.py

@ -0,0 +1,76 @@
from ee.utils import test
from ee.cli.main import get_test_app
class CliTestCaseStack(test.EETestCase):
def test_ee_cli(self):
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_purge_web(self):
self.app = get_test_app(argv=['stack', 'purge', '--web'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_purge_admin(self):
self.app = get_test_app(argv=['stack', 'purge', '--admin'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_purge_mail(self):
self.app = get_test_app(argv=['stack', 'purge', '--mail'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_purge_nginx(self):
self.app = get_test_app(argv=['stack', 'purge', '--nginx'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_purge_php(self):
self.app = get_test_app(argv=['stack', 'purge', '--php'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_purge_mysql(self):
self.app = get_test_app(argv=['stack', 'purge', '--mysql'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_purge_postfix(self):
self.app = get_test_app(argv=['stack', 'purge', '--postfix'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_purge_wpcli(self):
self.app = get_test_app(argv=['stack', 'purge', '--wpcli'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_purge_phpmyadmin(self):
self.app = get_test_app(argv=['stack', 'purge', '--phpmyadmin'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_purge_adminer(self):
self.app = get_test_app(argv=['stack', 'purge', '--adminer'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_purge_utils(self):
self.app = get_test_app(argv=['stack', 'purge', '--utils'])
self.app.setup()
self.app.run()
self.app.close()

76
tests/cli/test_stack_remove.py

@ -0,0 +1,76 @@
from ee.utils import test
from ee.cli.main import get_test_app
class CliTestCaseStack(test.EETestCase):
def test_ee_cli(self):
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_remove_web(self):
self.app = get_test_app(argv=['stack', 'remove', '--web'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_install_admin(self):
self.app = get_test_app(argv=['stack', 'remove', '--admin'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_install_mail(self):
self.app = get_test_app(argv=['stack', 'remove', '--mail'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_install_nginx(self):
self.app = get_test_app(argv=['stack', 'remove', '--nginx'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_install_php(self):
self.app = get_test_app(argv=['stack', 'remove', '--php'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_install_mysql(self):
self.app = get_test_app(argv=['stack', 'remove', '--mysql'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_install_postfix(self):
self.app = get_test_app(argv=['stack', 'remove', '--postfix'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_install_wpcli(self):
self.app = get_test_app(argv=['stack', 'remove', '--wpcli'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_install_phpmyadmin(self):
self.app = get_test_app(argv=['stack', 'remove', '--phpmyadmin'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_install_adminer(self):
self.app = get_test_app(argv=['stack', 'remove', '--adminer'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_install_utils(self):
self.app = get_test_app(argv=['stack', 'remove', '--utils'])
self.app.setup()
self.app.run()
self.app.close()

52
tests/cli/test_stack_services_restart.py

@ -0,0 +1,52 @@
from ee.utils import test
from ee.cli.main import get_test_app
class CliTestCaseStack(test.EETestCase):
def test_ee_cli(self):
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_services_restart_nginx(self):
self.app = get_test_app(argv=['stack', 'restart', '--nginx'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_services_restart_php5_fpm(self):
self.app = get_test_app(argv=['stack', 'restart', '--php5-fpm'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_services_restart_mysql(self):
self.app = get_test_app(argv=['stack', 'restart', '--mysql'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_services_restart_postfix(self):
self.app = get_test_app(argv=['stack', 'restart', '--postfix'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_services_restart_memcached(self):
self.app = get_test_app(argv=['stack', 'restart', '--memcached'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_services_restart_dovecot(self):
self.app = get_test_app(argv=['stack', 'restart', '--dovecot'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_services_restart_all(self):
self.app = get_test_app(argv=['stack', 'restart'])
self.app.setup()
self.app.run()
self.app.close()

52
tests/cli/test_stack_services_start.py

@ -0,0 +1,52 @@
from ee.utils import test
from ee.cli.main import get_test_app
class CliTestCaseStack(test.EETestCase):
def test_ee_cli(self):
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_services_start_nginx(self):
self.app = get_test_app(argv=['stack', 'start', '--nginx'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_services_start_php5_fpm(self):
self.app = get_test_app(argv=['stack', 'start', '--php5-fpm'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_services_start_mysql(self):
self.app = get_test_app(argv=['stack', 'start', '--mysql'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_services_start_postfix(self):
self.app = get_test_app(argv=['stack', 'start', '--postfix'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_services_start_memcached(self):
self.app = get_test_app(argv=['stack', 'start', '--memcached'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_services_start_dovecot(self):
self.app = get_test_app(argv=['stack', 'start', '--dovecot'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_services_start_all(self):
self.app = get_test_app(argv=['stack', 'start'])
self.app.setup()
self.app.run()
self.app.close()

52
tests/cli/test_stack_services_status.py

@ -0,0 +1,52 @@
from ee.utils import test
from ee.cli.main import get_test_app
class CliTestCaseStack(test.EETestCase):
def test_ee_cli(self):
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_services_status_nginx(self):
self.app = get_test_app(argv=['stack', 'status', '--nginx'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_services_status_php5_fpm(self):
self.app = get_test_app(argv=['stack', 'status', '--php5-fpm'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_services_status_mysql(self):
self.app = get_test_app(argv=['stack', 'status', '--mysql'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_services_status_postfix(self):
self.app = get_test_app(argv=['stack', 'status', '--postfix'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_services_status_memcached(self):
self.app = get_test_app(argv=['stack', 'status', '--memcached'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_services_status_dovecot(self):
self.app = get_test_app(argv=['stack', 'status', '--dovecot'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_services_status_all(self):
self.app = get_test_app(argv=['stack', 'status'])
self.app.setup()
self.app.run()
self.app.close()

52
tests/cli/test_stack_services_stop.py

@ -0,0 +1,52 @@
from ee.utils import test
from ee.cli.main import get_test_app
class CliTestCaseStack(test.EETestCase):
def test_ee_cli(self):
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_services_stop_nginx(self):
self.app = get_test_app(argv=['stack', 'stop', '--nginx'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_services_stop_php5_fpm(self):
self.app = get_test_app(argv=['stack', 'stop', '--php5-fpm'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_services_stop_mysql(self):
self.app = get_test_app(argv=['stack', 'stop', '--mysql'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_services_stop_postfix(self):
self.app = get_test_app(argv=['stack', 'stop', '--postfix'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_services_stop_memcached(self):
self.app = get_test_app(argv=['stack', 'stop', '--memcached'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_services_stop_dovecot(self):
self.app = get_test_app(argv=['stack', 'stop', '--dovecot'])
self.app.setup()
self.app.run()
self.app.close()
def test_ee_cli_stack_services_stop_all(self):
self.app = get_test_app(argv=['stack', 'stop'])
self.app.setup()
self.app.run()
self.app.close()
Loading…
Cancel
Save