Ejemplo n.º 1
0
def test_external_activity_state(tmpdir):
    r = Request(ExternalStateActivity(), 1, dir=str(tmpdir))
    r.save()
    extstate = str(tmpdir / 'external_state')
    with open(extstate) as f:
        assert 'foo\n' == f.read()
    with open(extstate, 'w') as f:
        print('bar', file=f)
    r2 = Request.load(str(tmpdir))
    assert r2.activity.external == 'bar\n'
Ejemplo n.º 2
0
def test_external_activity_state(tmpdir, logger):
    r = Request(ExternalStateActivity(), 1, dir=str(tmpdir))
    r.save()
    extstate = str(tmpdir / "external_state")
    with open(extstate) as f:
        assert "foo\n" == f.read()
    with open(extstate, "w") as f:
        print("bar", file=f)
    r2 = Request.load(str(tmpdir), logger)
    assert r2.activity.external == "bar\n"