Skip to content

Commit 3e9fc9f

Browse files
authored
Add a unit test to verify that has_valid_headers() succeeds for an empty file. This allows removing test_fileoutput_has_valid_headers.py which is now completley redundant. (#981)
1 parent 2a81596 commit 3e9fc9f

File tree

2 files changed

+7
-135
lines changed

2 files changed

+7
-135
lines changed

tests/output_methods/test_file.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ def test_has_valid_headers_success(self):
7070

7171
self.assertTrue(file_output.has_valid_headers(self.emissions_data))
7272

73+
def test_has_valid_headers_success_with_empty_file(self):
74+
file_output = FileOutput("test.csv", self.temp_dir)
75+
with open(file_output.save_file_path, "w", newline="") as _:
76+
pass
77+
78+
self.assertTrue(file_output.has_valid_headers(self.emissions_data))
79+
7380
def test_has_valid_headers_failure(self):
7481
file_output = FileOutput("test.csv", self.temp_dir)
7582
file_output.out(self.emissions_data, MagicMock())

tests/output_methods/test_fileoutput_has_valid_headers.py

Lines changed: 0 additions & 135 deletions
This file was deleted.

0 commit comments

Comments
 (0)