You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following skillshare, it's apparent the setup approach & intent of tests is less obvious to project newcomers (& those new to mock). One question asked about why the tests used these mocks:
The 2 mock shortcut makes load_umfile() do nothing & simulates process_mule_vars() returning data. An alternative is mocking load_umfile() to return a mock mule object that can be "opened" in process_mule_vars() & return data values. That's clearly more complex than the current approach.
Therefore, it's potentially worth over documenting a couple of tests to provide training hints.
Downsides:
Once mule calls are extracted & process() takes data structure args, mocking isn't required.
The comments "rot"...
The text was updated successfully, but these errors were encountered:
Following skillshare, it's apparent the setup approach & intent of tests is less obvious to project newcomers (& those new to mock). One question asked about why the tests used these mocks:
um2nc-standalone/test/test_um2netcdf.py
Lines 200 to 201 in 33d0dc5
Which cover this code:
um2nc-standalone/umpost/um2netcdf.py
Lines 468 to 469 in 33d0dc5
The 2 mock shortcut makes
load_umfile()
do nothing & simulatesprocess_mule_vars()
returning data. An alternative is mockingload_umfile()
to return a mockmule
object that can be "opened" inprocess_mule_vars()
& return data values. That's clearly more complex than the current approach.Therefore, it's potentially worth over documenting a couple of tests to provide training hints.
Downsides:
mule
calls are extracted &process()
takes data structure args, mocking isn't required.The text was updated successfully, but these errors were encountered: