@mock.patch('importlib.import_module')
    def test_command_use_02(self, mocked_import_module):
        module_path = "creds/foo/bar/baz"
        self.interpreter.current_module = None
        self.interpreter.modules = [module_path, 'doo/pa/foo/bar']
        exploit_class = mock.MagicMock(name="password_disclosure_module")
        mocked_import_module.return_value = mocked_module = mock.MagicMock(name='module')
        mocked_module.Exploit = exploit_class

        self.interpreter.command_use(module_path)

        mocked_import_module.assert_called_once_with('routersploit.modules.creds.foo.bar.baz')
        self.assertEqual(self.interpreter.current_module, exploit_class())
Testing command_use()
dataset/ETHPy150Open reverse-shell/routersploit/routersploit/test/test_interpreter.py/RoutersploitInterpreterTest.test_command_use_02