Esempio n. 1
0
    def test_list_state_functions(self):
        '''
        Test if it list the functions for all state modules.
        '''
        self.assertListEqual(sysmod.list_state_functions(), [])

        self.assertListEqual(sysmod.list_state_functions('file.s*'), [])
Esempio n. 2
0
    def test_list_state_functions(self):
        """
        Test if it list the functions for all state modules.
        """
        self.assertListEqual(sysmod.list_state_functions(), [])

        self.assertListEqual(sysmod.list_state_functions("file.s*"), [])
Esempio n. 3
0
    def test_list_state_functions(self):
        '''
        Test if it lists the functions for all state modules.
        '''
        self.assertListEqual(sysmod.list_state_functions(), self._functions)

        self.assertListEqual(sysmod.list_state_functions('nonexist'), [])

        # list all functions in/given a specific module
        self.assertListEqual(
            sysmod.list_state_functions('sys'),
            ['sys.doc', 'sys.list_functions', 'sys.list_modules'])

        # globs can be used for both module names and function names:
        self.assertListEqual(sysmod.list_state_functions('sys*'), [
            'sys.doc', 'sys.list_functions', 'sys.list_modules', 'sysctl.get',
            'sysctl.show', 'system.halt', 'system.reboot'
        ])
        self.assertListEqual(sysmod.list_state_functions('sys.list*'),
                             ['sys.list_functions', 'sys.list_modules'])

        # "list", or check for a specific function:
        self.assertListEqual(sysmod.list_state_functions('sys.list'), [])
        self.assertListEqual(sysmod.list_state_functions('exist.exist'),
                             ['exist.exist'])
Esempio n. 4
0
    def test_list_state_functions(self):
        '''
        Test if it lists the functions for all state modules.
        '''
        self.assertListEqual(sysmod.list_state_functions(), _functions)

        self.assertListEqual(sysmod.list_state_functions('nonexist'), [])

        # list all functions in/given a specific module
        self.assertListEqual(sysmod.list_state_functions('sys'), ['sys.doc', 'sys.list_functions', 'sys.list_modules'])

        # globs can be used for both module names and function names:
        self.assertListEqual(sysmod.list_state_functions('sys*'), ['sys.doc', 'sys.list_functions', 'sys.list_modules', 'sysctl.get', 'sysctl.show', 'system.halt', 'system.reboot'])
        self.assertListEqual(sysmod.list_state_functions('sys.list*'), ['sys.list_functions', 'sys.list_modules'])

        # "list", or check for a specific function:
        self.assertListEqual(sysmod.list_state_functions('sys.list'), [])
        self.assertListEqual(sysmod.list_state_functions('exist.exist'), ['exist.exist'])
Esempio n. 5
0
    def test_list_state_functions(self):
        """
        Test if it lists the functions for all state modules.
        """
        self.assertListEqual(sysmod.list_state_functions(), self._functions)

        self.assertListEqual(sysmod.list_state_functions("nonexist"), [])

        # list all functions in/given a specific module
        self.assertListEqual(
            sysmod.list_state_functions("sys"),
            ["sys.doc", "sys.list_functions", "sys.list_modules"],
        )

        # globs can be used for both module names and function names:
        self.assertListEqual(
            sysmod.list_state_functions("sys*"),
            [
                "sys.doc",
                "sys.list_functions",
                "sys.list_modules",
                "sysctl.get",
                "sysctl.show",
                "system.halt",
                "system.reboot",
            ],
        )
        self.assertListEqual(
            sysmod.list_state_functions("sys.list*"),
            ["sys.list_functions", "sys.list_modules"],
        )

        # "list", or check for a specific function:
        self.assertListEqual(sysmod.list_state_functions("sys.list"), [])
        self.assertListEqual(sysmod.list_state_functions("exist.exist"),
                             ["exist.exist"])