Skip to content

Commit 77a442e

Browse files
committed
Adjust unit tests
1 parent af411e7 commit 77a442e

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

microsetta_private_api/repo/tests/test_source.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ def setUp(self):
2828

2929
file_name = "test_source.py"
3030
file_label = "Test Source Repo"
31-
fh = open(file_name, "rb")
32-
file_contents = fh.read()
33-
fh.close()
31+
# Opening and reading a file's contents doesn't appear to work on
32+
# GitHub during workflow, so we need to fake the contents
33+
file_contents = b'Imagine a full file here'
3434
cur = t.cursor()
3535
cur.execute(
3636
"INSERT INTO ag.external_reports ("
@@ -207,9 +207,7 @@ def test_get_external_report_bytes(self):
207207
HUMAN_SOURCE.id, er.external_report_id
208208
)
209209

210-
fh = open("test_source.py", "rb")
211-
act = fh.read()
212-
fh.close()
210+
act = b'Imagine a full file here'
213211

214212
self.assertEqual(bytes(obs.file_contents), act)
215213

0 commit comments

Comments
 (0)