Esempio n. 1
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)
Esempio n. 2
0
def _code_json(a: A) -> Do:
    json = yield dump_json(a)
    yield decode_json(json)
Esempio n. 3
0
 def codec_either(self) -> None:
     v = Ei(Right(E(7, 'value')), Right(List(5, 9)), Left('error'))
     json = dump_json(v)
     (json // decode_json).should.equal(Right(v))
Esempio n. 4
0
 def codec_dat(self) -> None:
     target = D(E(2, 'E'), 1, 'D')
     json = f'{{"e": {{"a": 2, "b": "E", "{tpe_key}": "{mod}.E"}}, "a": 1, "b": "D", "{tpe_key}": "{mod}.D"}}'
     decoded = decode_json(json)
     decoded.should.equal(Right(target))
     dump_json(target).should.equal(Right(json))
Esempio n. 5
0
 def env(self) -> Expectation:
     ready = List('one')
     env = Env.cons(ready=ready)
     json = dump_json(env)
     restored = json // decode_json / _.ready
     return k(restored).must(be_right(ready))
Esempio n. 6
0
 def venv(self) -> Expectation:
     p = Path('/')
     rplugin = simple_rplugin('spec', 'name')
     venv = Venv(rplugin, VenvMeta(rplugin.name, p, Right(p), Right(p)))
     return k(dump_json(venv)).must(be_right)