def testImplVRcomma(self): """util.fix_separator: Able to replace comma in Implicit VR dataset..""" fixer.fix_separator(b",", for_VRs=["DS", "IS"], process_unknown_VRs=False) ds = filereader.read_dataset(self.bytesio, is_little_endian=True, is_implicit_VR=True) expected = [valuerep.DSfloat(x) for x in ["2", "4", "8", "16"]] got = ds.ROIContourSequence[0].ContourSequence[0].ContourData config.reset_data_element_callback() assert expected == got
def test_enforce_valid_values_value(self, val: Union[float, str], enforce_valid_true_fixture): """Test that errors are raised when value is invalid.""" with pytest.raises(ValueError): valuerep.DSfloat(val)
def test_enforce_valid_values_length(self, enforce_valid_true_fixture): """Test that errors are raised when length is too long.""" with pytest.raises(OverflowError): valuerep.DSfloat('3.141592653589793')