Example #1
0
def deactivate_spec() -> Do:
    yield await_k(flag_channel_id_becomes, not_equal(-1))
    channel = yield flag_channel_id()
    yield await_k(flag_jobpid_becomes, greater(0))
    yield nvim_command('CrmDeactivate')
    command_nonexistent = yield await_k(command_must_not_exist, 'FlagTest', timeout=10)
    quit_var = yield var_must_become('flagellum_quit', 1)
    pid = yield N.safe(nvim_call_tpe(int, 'jobpid', channel))
    return (
        command_nonexistent &
        k(pid).must(have_type(NError)) &
        quit_var
    )
Example #2
0
def bootstrap_spec() -> Do:
    yield variable_set_prefixed('interpreter', 'python3.7')
    yield variable_set_prefixed('autobootstrap', False)
    yield option_cat('runtimepath', List(str(project)))
    cram_exists_not = yield await_k(command_must_not_exist, 'Cram')
    yield runtime('chromatin.nvim/plugin/bootstrap')
    yield command_once_defined('BootstrapChromatin', timeout=3)
    yield command_once_defined('CrmSetupPlugins', timeout=30)
    plugin_exists = yield plug_exists('Flag', timeout=20)
    return cram_exists_not & plugin_exists
Example #3
0
def reboot_spec() -> Do:
    before = yield call_once_defined(reboot_test)
    json = yield N.e(dump_json(update_query))
    yield nvim_command(f'CrmUpdateState {json}')
    yield seen_program('update_state')
    updated_path = yield await_k(check_path)
    yield nvim_command('CrmUpdate')
    yield nvim_command('CrmReboot')
    yield wait_for_function_undef(reboot_test)
    after = yield call_once_defined(reboot_test)
    return updated_path & (k(before) == 13) & (k(after) == 17)
Example #4
0
def twice_spec() -> Do:
    yield nvim_sync_command('CrmActivate')
    yield await_k(log_entry, resources.already_active(List(name)))
Example #5
0
def update_spec() -> Do:
    yield nvim_sync_command('CrmUpdate')
    yield await_k(log_entry, resources.updated_plugin(name), timeout=10)
Example #6
0
def config_spec() -> Do:
    yield nvim_command('FlagConfTest')
    x1 = yield var_must_become('flagellum_value', 'success')
    x2 = yield await_k(log_entry, 'success')
    return x1 & x2
Example #7
0
def autocmd_spec() -> Do:
    yield doautocmd('VimEnter')
    yield await_k(log_entry, 'autocmd works')
Example #8
0
def cmd_parameter_spec() -> Do:
    yield nvim_command('FlagArgTest', 1)
    yield await_k(log_entry, 'success 1')
Example #9
0
 def proteome(self) -> Expectation:
     return cached_venvs_test(List('proteome'),
                              lambda: await_k(command_must_exist, 'ProAdd'))
Example #10
0
def stages_spec() -> Do:
    entries = yield names.traverse(
        lambda a: await_k(log_entry, f'{a} initialized'), NvimIO)
    fvar = yield var_must_become('flag', 2)
    cvar = yield var_must_become('cil', 1)
    return entries.fold(AlgExpectation) & fvar & cvar
Example #11
0
def flag_cil_spec(spec: Callable[[], NvimIO[Expectation]]) -> Do:
    yield wait_for_command('FlagTest')
    yield wait_for_command('CilTest')
    yield await_k(log_entry, 'cilia initialized')
    yield spec()
Example #12
0
def plug_exists(name: str, timeout=5, **kw: Any) -> NvimIO[Expectation]:
    cmd = f'{name}Test'
    return await_k(command_must_exist, cmd, timeout=timeout, **kw)
Example #13
0
def dir_venv_spec() -> Do:
    flag_dir = fixture_path('rplugin', 'flagellum')
    yield NS.lift(variable_set_prefixed('autostart', True))
    yield request('cram', f'dir:{flag_dir}', name='flagellum')
    yield NS.lift(wait_for_command('FlagTest', timeout=1))
    yield NS.lift(await_k(log_entry, 'flagellum initialized'))