Skip to content

Commit

Permalink
Pin dissect.cstruct < 4.0 for now (#54)
Browse files Browse the repository at this point in the history
Pin older version of dissect.cstruct for now until we have proper compatibility with dissect.cstruct v4.
  • Loading branch information
yunzheng authored Sep 23, 2024
1 parent 65716f6 commit b15c85e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace_packages = dissect
platforms = any
include_package_data = true
install_requires =
dissect.cstruct >= 2.0
dissect.cstruct >= 2.0, < 4.0
lark
python_requires = >=3.7
setup_requires =
Expand Down
22 changes: 11 additions & 11 deletions tests/test_beacon.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ def test_beacon_from_file(beacon_x64_file):


def test_beacon_from_path(beacon_x86_file, tmp_path):
with tmp_path / "beacon_x86.bin" as p:
p.write_bytes(beacon_x86_file.read())
bconfig = beacon.BeaconConfig.from_path(p)
assert len(bconfig.domains)
assert len(bconfig.uris)
assert bconfig.xorencoded
assert bconfig.protocol == "https"
p = tmp_path / "beacon_x86.bin"
p.write_bytes(beacon_x86_file.read())
bconfig = beacon.BeaconConfig.from_path(p)
assert len(bconfig.domains)
assert len(bconfig.uris)
assert bconfig.xorencoded
assert bconfig.protocol == "https"

with tmp_path / "bacon.bin" as p:
p.write_bytes(b"no bacon for you")
with pytest.raises(ValueError, match="No valid Beacon configuration found"):
beacon.BeaconConfig.from_path(p)
p = tmp_path / "bacon.bin"
p.write_bytes(b"no bacon for you")
with pytest.raises(ValueError, match="No valid Beacon configuration found"):
beacon.BeaconConfig.from_path(p)


def test_beacon_from_bytes(beacon_x86_file):
Expand Down

0 comments on commit b15c85e

Please sign in to comment.