FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

test: make test_ssdt / test_recovery pass on Windows by Epic34-cyberdudder · Pull Request #72 · riftaway7-code/hackmate · GitHub

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
5 changes: 3 additions & 2 deletions tests/test_recovery.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,15 @@ def test_only_tahoe_requests_the_latest_recovery(self):
self.assertNotIn("-os", sonoma_args)

def test_shared_command_builder_includes_output_directory(self):
args = macrecovery_args(self._version("15"), Path("/tmp/recovery"))
outdir = Path("/tmp/recovery")
args = macrecovery_args(self._version("15"), outdir)

self.assertEqual(
[
"-b", "Mac-7BA5B2D9E42DDD94",
"-m", "00000000000000000",
"download",
"--outdir", "/tmp/recovery",
"--outdir", str(outdir),
],
args,
)
Expand Down
9 changes: 7 additions & 2 deletions tests/test_ssdt.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,15 @@

class Acpi0007DetectionTests(unittest.TestCase):
def _inspect(self, raw: bytes) -> dict:
with tempfile.NamedTemporaryFile(suffix=".aml") as f:
# A NamedTemporaryFile can't be reopened while still open on Windows,
# so write, close, inspect, then unlink.
f = tempfile.NamedTemporaryFile(suffix=".aml", delete=False)
try:
f.write(raw)
f.flush()
f.close()
return ssdt._inspect_dsdt(Path(f.name))
finally:
Path(f.name).unlink(missing_ok=True)

def test_detects_acpi0007_cpu_objects(self):
self.assertTrue(self._inspect(_ACPI0007_DSDT)["has_acpi0007"])
Expand Down

Back | FazBrowse Home | New Git URL