@@ -341,5 +341,27 @@ def test_dump(tmp_path, mocker):
341341
342342@pytest .mark .parametrize ("inputs, expected" , tc_params )
343343def test_constructor (inputs , expected ):
344- actualdo = DiffractionObject (** inputs )
345- compare_dicts (actualdo .__dict__ , expected )
344+ actual_do = DiffractionObject (** inputs )
345+ actual_dict = {
346+ "all_arrays" : actual_do .all_arrays ,
347+ "metadata" : actual_do .metadata ,
348+ "input_xtype" : actual_do .input_xtype ,
349+ "name" : actual_do .name ,
350+ "scat_quantity" : actual_do .scat_quantity ,
351+ "qmin" : actual_do .qmin ,
352+ "qmax" : actual_do .qmax ,
353+ "tthmin" : actual_do .tthmin ,
354+ "tthmax" : actual_do .tthmax ,
355+ "dmin" : actual_do .dmin ,
356+ "dmax" : actual_do .dmax ,
357+ "wavelength" : actual_do .wavelength ,
358+ }
359+ compare_dicts (actual_dict , expected )
360+
361+
362+ def test_all_array_setter ():
363+ actual_do = DiffractionObject ()
364+
365+ # Attempt to directly modify the property
366+ with pytest .raises (AttributeError , match = "Direct modification of 'all_arrays' is not allowed." ):
367+ actual_do .all_arrays = np .empty ((4 , 4 ))
0 commit comments