@@ -232,7 +232,7 @@ def test_diffraction_objects_equality(inputs1, inputs2, expected):
232
232
233
233
234
234
def test_dump (tmp_path , mocker ):
235
- x , y = np .linspace (0 , 10 , 11 ), np .linspace (0 , 10 , 11 )
235
+ x , y = np .linspace (0 , 5 , 6 ), np .linspace (0 , 5 , 6 )
236
236
directory = Path (tmp_path )
237
237
file = directory / "testfile"
238
238
test = Diffraction_object ()
@@ -242,8 +242,12 @@ def test_dump(tmp_path, mocker):
242
242
test .insert_scattering_quantity (
243
243
x , y , "q" , metadata = {"thing1" : 1 , "thing2" : "thing2" , "package_info" : {"package2" : "3.4.5" }}
244
244
)
245
- with mocker .patch ("importlib.metadata.version" , return_value = "3.3.0" ), freeze_time ("2012-01-14" ):
245
+
246
+ mocker .patch ("importlib.metadata.version" , return_value = "3.3.0" )
247
+
248
+ with freeze_time ("2012-01-14" ):
246
249
test .dump (file , "q" )
250
+
247
251
with open (file , "r" ) as f :
248
252
actual = f .read ()
249
253
expected = (
@@ -256,10 +260,6 @@ def test_dump(tmp_path, mocker):
256
260
"3.000000000000000000e+00 3.000000000000000000e+00\n "
257
261
"4.000000000000000000e+00 4.000000000000000000e+00\n "
258
262
"5.000000000000000000e+00 5.000000000000000000e+00\n "
259
- "6.000000000000000000e+00 6.000000000000000000e+00\n "
260
- "7.000000000000000000e+00 7.000000000000000000e+00\n "
261
- "8.000000000000000000e+00 8.000000000000000000e+00\n "
262
- "9.000000000000000000e+00 9.000000000000000000e+00\n "
263
- "1.000000000000000000e+01 1.000000000000000000e+01\n "
264
263
)
264
+
265
265
assert actual == expected
0 commit comments