'Testing command_use()
* Unknown Exploit
* Known module'

@mock.patch('importlib.import_module')
@mock.patch('routersploit.utils.print_error')
def test_command_use_unknown_extension(self, mocked_print_error, mocked_import_module):

    module_path = 'exploits/foo/bar'
    self.interpreter.current_module = None
    self.interpreter.modules = [module_path, 'doo/pa/foo/bar']
    mocked_import_module.return_value = mocked_module = mock.MagicMock(name='module')
    del mocked_module.Exploit
    self.interpreter.command_use(module_path)
    mocked_import_module.assert_called_once_with('routersploit.modules.exploits.foo.bar')
    mocked_print_error.assert_called_once_with("Error    during    loading    'routersploit/modules/exploits/foo/bar'\n\nError:    Exploit\n\nIt    should    be    valid    path    to    the    module.    Use    <tab>    key    multiple    times    for    completion.")
    self.assertEqual(self.interpreter.current_module, None)
