コード例 #1
0
    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()
コード例 #2
0
    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()
コード例 #3
0
    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)
コード例 #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")
コード例 #5
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")
コード例 #6
0
    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__))
コード例 #7
0
    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__))
コード例 #8
0
    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")
コード例 #9
0
    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")
コード例 #10
0
    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")
コード例 #11
0
 def assert_action(help_str):
     self.assertTrue(
         help_str.startswith("usage: %s" % SdkCore.get_help()))
     self.assertTrue(help_str.find("[version]") > -1)
コード例 #12
0
    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)
コード例 #13
0
 def assert_action(help_str):
     self.assertTrue(help_str.startswith("usage: %s" % SdkCore.get_help()))
     self.assertTrue(help_str.find("[version]") > -1)