-
Notifications
You must be signed in to change notification settings - Fork 334
Open
Labels
bfbbit-for-bitbit-for-bitsize: smalltestingadditions or changes to testsadditions or changes to tests
Milestone
Description
Originally posted by @billsacks in #3314 (comment)
I got as far as thinking about how I'd do this:
- Pull replace_grain into a top-level function
- Extract the line,
user_nl_clm_text = re.sub(r"GRAIN\w*", replace_grain, user_nl_clm_text)
into a new top-level function in the module. This will be the function that would be unit tested.- Do a manual test of building the LREPRSTRUCT test to ensure that the user_nl_clm file is still the same as before after steps (1) and (2).
- Create a unit test module for LREPRSTRUCT
- Create at least one unit test for the extracted function, giving it a string as input and testing the resulting string. At a minimum this should have the situation mentioned in my comment above, where one line contains 'GRAINN_TO_FOOD' and a later line contains (among other things) "'GRAINN_TO_FOOD_PERHARV', 'GRAINN_TO_FOOD_ANN'". (The later line could include a more extensive line that matches what's in that line in the current user_nl_clm.)
Metadata
Metadata
Assignees
Labels
bfbbit-for-bitbit-for-bitsize: smalltestingadditions or changes to testsadditions or changes to tests
Type
Projects
Status
No status