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)
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
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)