Skip to content

Commit a189c70

Browse files
Pa04rthnorthdpole
authored andcommitted
Added test case to read the spreadsheet
1 parent d7c0a18 commit a189c70

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

application/tests/spreadsheet_test.py

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -107,20 +107,19 @@ def test_prepare_spreadsheet(self) -> None:
107107
result = list(csv.DictReader(out))
108108

109109
self.assertCountEqual(result, expected)
110+
111+
112+
def test_read_spreadsheet_iso_numbers(self) -> None:
113+
url = "https://docs.google.com/spreadsheets/d/1eZOEYgts7d_-Dr-1oAbogPfzBLh6511b58pX3b59kvg" #CRE spreadsheet url
114+
alias = "Test Spreadsheet"
115+
result = read_spreadsheet(url, alias, validate=False, parse_numbered_only=False)
110116

111-
# def get_spreadsheet_url(self) -> str:
112-
# """Helper function to retrieve the spreadsheet URL from an environment variable."""
113-
# return os.environ.get("TEST_SPREADSHEET_URL", "https://docs.google.com/spreadsheets/d/1IgfpPw5TCKSJ4eDlzfI9oNwVOZgtXQvWxSbC7SHE7Zg")
114-
115-
# def test_read_spreadsheet_iso_numbers(self) -> None:
116-
# url = self.get_spreadsheet_url()
117-
# alias = "Test Spreadsheet"
118-
# result = read_spreadsheet(url, alias, validate=False, parse_numbered_only=False)
119-
120-
# # Assuming the spreadsheet has a column "ISO Number" with values "7.10" and "8.20"
121-
# expected = [
122-
# {"ISO Number": "7.10", "Name": "Example 1", "Value": 10},
123-
# {"ISO Number": "8.20", "Name": "Example 2", "Value": 20}
124-
# ]
117+
# Assuming the spreadsheet has a column "ISO Number" with values "7.10" and "8.20"
118+
expected = [
119+
{"ISO Number": "7.10", "Name": "Example 1", "Value": 10},
120+
{"ISO Number": "8.20", "Name": "Example 2", "Value": 20}
121+
]
125122

126-
# self.assertEqual(result["Sheet1"], expected)
123+
self.assertEqual(result["Sheet1"], expected)
124+
125+

0 commit comments

Comments
 (0)