'Testing command_use()
* Unknown module'

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

    self.interpreter.current_module = None
    self.interpreter.modules = ['doo/pa/foo/bar']
    module_path = 'creds/foo/bar/baz'
    mocked_import_module.side_effect = ImportError('Not    working')
    self.interpreter.command_use(module_path)
    mocked_import_module.assert_called_once_with('routersploit.modules.creds.foo.bar.baz')
    mocked_print_error.assert_called_once_with("Error    during    loading    'routersploit/modules/creds/foo/bar/baz'\n\nError:    Not    working\n\nIt    should    be    valid    path    to    the    module.    Use    <tab>    key    multiple    times    for    completion.")
    self.assertEqual(self.interpreter.current_module, None)
