예제 #1
0
def test_file_error_model__probability_distribution_no_probability_distribution_in_header():
    fem = FileErrorModel(os.path.join(FILES_DIR, 'no_probability_distribution.jsonl'))
    with pytest.raises(ValueError):
        fem.probability_distribution(0.4)
예제 #2
0
def test_file_error_model_probability_distribution():
    fem = FileErrorModel(os.path.join(FILES_DIR, 'fivequbitcode-errors-p0.4-bias10.jsonl'))
    pd = fem.probability_distribution(fem._probability)
    assert isinstance(pd, tuple)
    assert len(pd) == 4
    assert pd[0] + pd[1] + pd[2] + pd[3] == 1
예제 #3
0
def test_file_error_model_probability_distribution_invalid_probability_parameter():
    fem = FileErrorModel(os.path.join(FILES_DIR, 'fivequbitcode-errors-p0.4-bias10.jsonl'))
    with pytest.raises(ValueError):
        fem.probability_distribution(0.3)