Skip to content

Commit 6e895ca

Browse files
committed
test: update CSV test to include a valid row with a blank well_name_point_id
1 parent c9d1305 commit 6e895ca

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

tests/features/steps/well-inventory-csv-given.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,13 @@ def step_impl(context: Context):
212212
'my CSV file contains 3 rows of data with 2 valid rows and 1 row with a blank "well_name_point_id"'
213213
)
214214
def step_impl(context: Context):
215-
_set_file_content(context, "well-inventory-invalid-partial.csv")
215+
df = _get_valid_df(context)
216+
217+
# Start from two valid rows, add a third valid row, then blank only well_name_point_id.
218+
df = pd.concat([df, df.iloc[[0]].copy()], ignore_index=True)
219+
df.loc[2, "well_name_point_id"] = ""
220+
221+
_set_content_from_df(context, df)
216222

217223

218224
@given('my CSV file contains a row missing the required "{required_field}" field')
@@ -259,6 +265,8 @@ def _set_content_from_df(context: Context, df: pd.DataFrame, delimiter: str = ",
259265
df.to_csv(buffer, index=False, sep=delimiter)
260266
context.file_content = buffer.getvalue()
261267
context.rows = list(csv.DictReader(context.file_content.splitlines()))
268+
context.row_count = len(context.rows)
269+
context.file_type = "text/csv"
262270

263271

264272
@given("my CSV file contains more rows than the configured maximum for bulk upload")

0 commit comments

Comments
 (0)