Skip to content

Commit

Permalink
update null time unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
RushiT0122 committed Mar 7, 2024
1 parent 404c5af commit 9544d36
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/unittests/test_null_cell_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,28 @@ def test_null_datetime_effectiveFormat(self):
# verify the returned schema has expected field types and format
self.assertIn(expected_format,returned_formats)

def test_null_date_effectiveFormat(self):
"""
Test when no value is given in second row of date, discovery is locking at 'effectiveFormat'.
And returns type and format in schema according to that.
"""
sheet = SHEET
sheet["data"][0]["rowData"][1]["values"][0]["effectiveFormat"]["numberFormat"]["type"] = "DATE"

expected_format = {
"type": [
"null",
"string"
],
"format": "date-time"
}

sheet_json_schema, columns = schema.get_sheet_schema_columns(sheet)
returned_formats = sheet_json_schema["properties"]["Column1"]["anyOf"]

# verify the returned schema has expected field types and format
self.assertIn(expected_format,returned_formats)

def test_null_time_effectiveFormat(self):
"""
Test when no value is given in second row of time, discovery is locking at 'effectiveFormat'.
Expand Down

0 comments on commit 9544d36

Please sign in to comment.