コード例 #1
0
ファイル: test_runinfo.py プロジェクト: eheydrick/squadron
def test_basic(tmpdir):
    tmpdir = str(tmpdir)
    info = {'number': random.randint(0, 100)}

    write_run_info(tmpdir, info)

    assert get_last_run_info(tmpdir, False) == info
コード例 #2
0
ファイル: test_runinfo.py プロジェクト: eheydrick/squadron
def test_dryrun(tmpdir):
    tmpdir = str(tmpdir)
    info = {'number': random.randint(0, 100)}

    write_run_info(tmpdir, info)

    assert get_last_run_info(tmpdir, True) == info

    with open(os.path.join(tmpdir, 'info.json.lock'), 'w') as lockfile:
        lockfile.write('locked!')

    with pytest.raises(FileLockException) as ex:
        # Will fail if it doesn't throw
        assert get_last_run_info(tmpdir, True) is "fail"

    assert ex is not None
コード例 #3
0
ファイル: test_runinfo.py プロジェクト: altoplano/squadron
def test_basic(tmpdir):
    tmpdir = str(tmpdir)
    info = {'number': random.randint(0,100)}

    write_run_info(tmpdir, info)

    assert get_last_run_info(tmpdir, False) == info
コード例 #4
0
ファイル: test_runinfo.py プロジェクト: altoplano/squadron
def test_dryrun(tmpdir):
    tmpdir = str(tmpdir)
    info = {'number': random.randint(0,100)}

    write_run_info(tmpdir, info)

    assert get_last_run_info(tmpdir, True) == info

    with open(os.path.join(tmpdir, 'info.json.lock'), 'w') as lockfile:
        lockfile.write('locked!')

    with pytest.raises(FileLockException) as ex:
        # Will fail if it doesn't throw
        assert get_last_run_info(tmpdir, True) is "fail"

    assert ex is not None
コード例 #5
0
ファイル: test_runinfo.py プロジェクト: eheydrick/squadron
def test_blank(tmpdir):
    tmpdir = str(tmpdir)
    create_blank_infojson(tmpdir)
    assert get_last_run_info(tmpdir, False) == {}
コード例 #6
0
ファイル: test_runinfo.py プロジェクト: altoplano/squadron
def test_blank(tmpdir):
    tmpdir = str(tmpdir)
    create_blank_infojson(tmpdir)
    assert get_last_run_info(tmpdir, False) == {}