def test_core_command_ok(self):
        """This test case ensures fantastico sdk main command works as expected."""

        argv = ["fantastico", "test_cmd"]

        SdkCommandsRegistry.COMMANDS["fantastico"] = SdkCore
        SdkCommandsRegistry.COMMANDS["test_cmd"] = MockCmdTest

        cmd_test = SdkCore(argv, supported_prefixes=["not supported ----"])

        self.assertIsNotNone(cmd_test)
        cmd_test.exec_command()
    def test_core_command_ok(self):
        '''This test case ensures fantastico sdk main command works as expected.'''

        argv = ["fantastico", "test_cmd"]

        SdkCommandsRegistry.COMMANDS["fantastico"] = SdkCore
        SdkCommandsRegistry.COMMANDS["test_cmd"] = MockCmdTest

        cmd_test = SdkCore(argv, supported_prefixes=["not supported ----"])

        self.assertIsNotNone(cmd_test)
        cmd_test.exec_command()
    def test_syncdb_mysql(self):
        '''This test case ensures syncdb works great for mysql database.'''

        argv = [
            SdkCore.get_name(), "syncdb", "--comp-root", self._comp_root,
            "--db-command", "/usr/bin/mysql"
        ]

        main(argv)
Beispiel #4
0
    def test_fantastico_help_ok(self):
        '''This test case ensures help option works as expected.'''
        def assert_action(help_str):
            self.assertTrue(
                help_str.startswith("usage: %s" % SdkCore.get_help()))
            self.assertTrue(help_str.find("[version]") > -1)

        argv = [SdkCore.get_name()]

        self._exec_command_help_scenario(argv, assert_action, "fantastico")
    def test_fantastico_help_ok(self):
        '''This test case ensures help option works as expected.'''

        def assert_action(help_str):
            self.assertTrue(help_str.startswith("usage: %s" % SdkCore.get_help()))
            self.assertTrue(help_str.find("[version]") > -1)

        argv = [SdkCore.get_name()]

        self._exec_command_help_scenario(argv, assert_action, "fantastico")
    def test_version_ok(self):
        '''This test case check version command integration into sdk.'''

        argv = [SdkCore.get_name(), "version"]

        main(argv)

        version = self._stdout.getvalue()

        self.assertTrue(version.startswith(fantastico.__version__))
    def test_version_ok(self):
        '''This test case check version command integration into sdk.'''

        argv = [SdkCore.get_name(), "version"]

        main(argv)

        version = self._stdout.getvalue()

        self.assertTrue(version.startswith(fantastico.__version__))
    def test_version_help_ok(self):
        '''This test case check version command help screen is correctly generated.'''

        from fantastico.sdk.commands.command_version import SdkCommandVersion

        argv = [SdkCore.get_name(), "version"]

        assert_action = lambda help_str: \
                                self.assertTrue(help_str.startswith("usage: %s" % SdkCommandVersion.get_help()))

        self._exec_command_help_scenario(argv, assert_action, "version")
    def test_version_help_ok(self):
        '''This test case check version command help screen is correctly generated.'''

        from fantastico.sdk.commands.command_version import SdkCommandVersion

        argv = [SdkCore.get_name(), "version"]

        assert_action = lambda help_str: \
                                self.assertTrue(help_str.startswith("usage: %s" % SdkCommandVersion.get_help()))

        self._exec_command_help_scenario(argv, assert_action, "version")
    def test_activate_help(self):
        '''This test case ensures help works as expected for activate-extension.'''

        from fantastico.sdk.commands.command_activate_extension import SdkCommandActivateExtension

        def assert_action(help_str):
            self.assertTrue(help_str.startswith("usage: %s" % SdkCommandActivateExtension.get_help()))
            self.assertTrue(help_str.find("-n NAME, --name NAME") > -1)
            self.assertTrue(help_str.find("-p COMP_ROOT, --comp-root COMP_ROOT") > -1)

        argv = [SdkCore.get_name(), "activate-extension"]

        self._exec_command_help_scenario(argv, assert_action, "activate-extension")
Beispiel #11
0
 def assert_action(help_str):
     self.assertTrue(
         help_str.startswith("usage: %s" % SdkCore.get_help()))
     self.assertTrue(help_str.find("[version]") > -1)
    def test_syncdb_mysql(self):
        '''This test case ensures syncdb works great for mysql database.'''

        argv = [SdkCore.get_name(), "syncdb", "--comp-root", self._comp_root, "--db-command", "/usr/bin/mysql"]

        main(argv)
 def assert_action(help_str):
     self.assertTrue(help_str.startswith("usage: %s" % SdkCore.get_help()))
     self.assertTrue(help_str.find("[version]") > -1)