def create_labels(): minimal_labels = { "Position": { "Cy3": { "attach_id": 1, "linker_length": 20, "linker_width": 5, "dye_radius1": 8, "dye_radius2": 3, "dye_radius3": 3, "use_LabelLib": False, }, "Cy5": { "attach_id": 288, "linker_length": 20, "linker_width": 5, "dye_radius1": 9.5, "dye_radius2": 3, "dye_radius3": 3, "use_LabelLib": False, }, }, "Distance": { "Cy3-Cy5": { "R0": 54 } } } cloud.check_labels(minimal_labels, verbose=False) return minimal_labels
def test_AV1(complete_labels, monkeypatch): monkeypatch.setitem(MINIMAL_LABELS["Position"]["Cy3"], "simulation_type", "AV1") cloud.check_labels(MINIMAL_LABELS, verbose=False) assert complete_labels["Position"]["Cy3"]["dye_radius2"] == 0
def test_unrecognized_key(monkeypatch): monkeypatch.setitem(MINIMAL_LABELS["Position"]["Cy3"], "unknown_key", "some_value") with pytest.raises(KeyError): cloud.check_labels(MINIMAL_LABELS, verbose=False)
def test_attachID_wrongtype(monkeypatch): monkeypatch.setitem(MINIMAL_LABELS["Position"]["Cy3"], "linker_length", "1") with pytest.raises(TypeError): cloud.check_labels(MINIMAL_LABELS, verbose=False)
def test_missing_item(label_dict, missing_item, error, monkeypatch): monkeypatch.delitem(label_dict, missing_item) with pytest.raises(error): cloud.check_labels(MINIMAL_LABELS, verbose=False)
def complete_labels(): cloud.check_labels(MINIMAL_LABELS, verbose=False) return MINIMAL_LABELS