Beispiel #1
0
    def test_valid_uninstall(self, wp_generator_specific, wp_plugin_list):

        for plugin_name in ['add-to-any', 'redirection']:

            plugin_config = wp_plugin_list.plugins(TEST_SITE)[plugin_name]
            wp_plugin_config = WPPluginConfig(wp_generator_specific.wp_site, plugin_name, plugin_config)
            wp_plugin_config.uninstall()
            assert wp_plugin_config.is_installed is False
Beispiel #2
0
    def test_valid_uninstall(self, wp_generator_category,
                             wp_plugin_list_category):

        for plugin_name in ['add-to-any', 'redirection']:

            plugin_config = wp_plugin_list_category.plugins[plugin_name]
            wp_plugin_config = WPPluginConfig(wp_generator_category.wp_site,
                                              plugin_name, plugin_config)
            wp_plugin_config.uninstall()
            assert wp_plugin_config.is_installed is False
Beispiel #3
0
    def test_is_activated_generic(self, wp_generator_generic, wp_plugin_list):

        # plugins and if they have to be activated or not
        for plugin_name, activated in {
            'add-to-any': True,
            'akismet': False
        }.items():

            plugin_config = wp_plugin_list.plugins()[plugin_name]
            wp_plugin_config = WPPluginConfig(wp_generator_generic.wp_site, plugin_name, plugin_config)

            assert wp_plugin_config.is_activated is activated
Beispiel #4
0
    def test_is_activated_specific(self, wp_generator_specific, wp_plugin_list):

        # plugins and if they have to be activated or not
        for plugin_name, activated in {
            'add-to-any': True,
            'redirection': True
        }.items():

            plugin_config = wp_plugin_list.plugins(TEST_SITE)[plugin_name]
            wp_plugin_config = WPPluginConfig(wp_generator_specific.wp_site, plugin_name, plugin_config)

            assert wp_plugin_config.is_activated is activated
Beispiel #5
0
    def test_restore_generic_config(self, wp_generator_generic, wp_plugin_list):

        # First, uninstall from WP installation
        plugin_config = wp_plugin_list.plugins()['add-to-any']
        wp_plugin_config = WPPluginConfig(wp_generator_generic.wp_site, 'add-to-any', plugin_config)
        wp_plugin_config.uninstall()

        # Then, reinstall plugin and configure it
        wp_plugin_config.install()
        wp_plugin_config.configure(force=True)

        # Check plugin options
        wp_config = WPConfig(wp_generator_generic.wp_site)
        assert wp_config.run_wp_cli("option get addtoany_options") == 'test'
Beispiel #6
0
    def test_valid_install_generic(self, wp_generator_generic, wp_plugin_list):

        # Plugins and if they have to be installed or not
        for plugin_name, installed in {
            'add-to-any': True,
            'hello': False,
            'akismet': True
        }.items():

            plugin_config = wp_plugin_list.plugins()[plugin_name]
            wp_plugin_config = WPPluginConfig(wp_generator_generic.wp_site, plugin_name, plugin_config)

            assert wp_plugin_config.is_installed is installed
Beispiel #7
0
    def test_is_activated_category(self, wp_generator_category,
                                   wp_plugin_list_category):

        # plugins and if they have to be activated or not
        for plugin_name, activated in {
                'add-to-any': True,
                'redirection': True
        }.items():

            plugin_config = wp_plugin_list_category.plugins[plugin_name]
            wp_plugin_config = WPPluginConfig(wp_generator_category.wp_site,
                                              plugin_name, plugin_config)

            assert wp_plugin_config.is_activated is activated
Beispiel #8
0
    def test_valid_install_category(self, wp_generator_category,
                                    wp_plugin_list_category):

        # Plugins and if they have to be installed or not
        for plugin_name, installed in {
                'add-to-any': True,
                'redirection': True,
                'hello': False,
                'akismet': False
        }.items():

            plugin_config = wp_plugin_list_category.plugins[plugin_name]
            wp_plugin_config = WPPluginConfig(wp_generator_category.wp_site,
                                              plugin_name, plugin_config)

            assert wp_plugin_config.is_installed is installed
Beispiel #9
0
    def test_restore_specific_config(self, wp_generator_generic,
                                     wp_plugin_list):

        # First, uninstall from WP installation
        plugin_config = wp_plugin_list.plugins(
            settings.TEST_SITE)['add-to-any']
        wp_plugin_config = WPPluginConfig(wp_generator_generic.wp_site,
                                          'add-to-any', plugin_config)
        wp_plugin_config.uninstall()

        # Then, reinstall and configure it
        wp_plugin_config.install()
        wp_plugin_config.configure()

        # Check plugin options
        wp_config = WPConfig(wp_generator_generic.wp_site)
        assert wp_config.run_wp_cli(
            "option get addtoany_options") == 'test_overload'
        assert wp_config.run_wp_cli("option get addtoany_dummy") == 'dummy'