Skip to content

Commit 6278a8e

Browse files
committed
Update tests with actual object info
1 parent 8342f2a commit 6278a8e

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

tests/test_diffraction_objects.py

+24-2
Original file line numberDiff line numberDiff line change
@@ -341,5 +341,27 @@ def test_dump(tmp_path, mocker):
341341

342342
@pytest.mark.parametrize("inputs, expected", tc_params)
343343
def 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

Comments
 (0)