mirror of
https://github.com/smittix/intercept.git
synced 2026-07-07 09:08:12 -07:00
style: apply ruff-format to entire codebase
First-time run of ruff-format via pre-commit hook normalises quote style, trailing commas, and whitespace across 188 Python files. No logic changes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,13 +4,13 @@ from utils.sdr.base import SDRDevice, SDRType
|
||||
from utils.sdr.hackrf import HackRFCommandBuilder
|
||||
|
||||
|
||||
def _make_device(serial: str = 'abc123') -> SDRDevice:
|
||||
def _make_device(serial: str = "abc123") -> SDRDevice:
|
||||
return SDRDevice(
|
||||
sdr_type=SDRType.HACKRF,
|
||||
index=0,
|
||||
name='HackRF One',
|
||||
name="HackRF One",
|
||||
serial=serial,
|
||||
driver='hackrf',
|
||||
driver="hackrf",
|
||||
capabilities=HackRFCommandBuilder.CAPABILITIES,
|
||||
)
|
||||
|
||||
@@ -59,30 +59,26 @@ class TestBuildAdsbCommand:
|
||||
def test_contains_soapysdr_device_type(self):
|
||||
builder = HackRFCommandBuilder()
|
||||
cmd = builder.build_adsb_command(_make_device(), gain=40)
|
||||
assert '--device-type' in cmd
|
||||
assert 'soapysdr' in cmd
|
||||
assert "--device-type" in cmd
|
||||
assert "soapysdr" in cmd
|
||||
|
||||
def test_includes_serial_in_device_string(self):
|
||||
builder = HackRFCommandBuilder()
|
||||
cmd = builder.build_adsb_command(_make_device(serial='deadbeef'), gain=40)
|
||||
device_idx = cmd.index('--device')
|
||||
assert 'deadbeef' in cmd[device_idx + 1]
|
||||
cmd = builder.build_adsb_command(_make_device(serial="deadbeef"), gain=40)
|
||||
device_idx = cmd.index("--device")
|
||||
assert "deadbeef" in cmd[device_idx + 1]
|
||||
|
||||
|
||||
class TestBuildIQCaptureCommand:
|
||||
def test_outputs_cu8_to_stdout(self):
|
||||
builder = HackRFCommandBuilder()
|
||||
cmd = builder.build_iq_capture_command(
|
||||
_make_device(), frequency_mhz=100.0, sample_rate=2048000, gain=40
|
||||
)
|
||||
assert '-F' in cmd
|
||||
assert 'CU8' in cmd
|
||||
assert cmd[-1] == '-'
|
||||
cmd = builder.build_iq_capture_command(_make_device(), frequency_mhz=100.0, sample_rate=2048000, gain=40)
|
||||
assert "-F" in cmd
|
||||
assert "CU8" in cmd
|
||||
assert cmd[-1] == "-"
|
||||
|
||||
def test_gain_split_in_command(self):
|
||||
builder = HackRFCommandBuilder()
|
||||
cmd = builder.build_iq_capture_command(
|
||||
_make_device(), frequency_mhz=100.0, gain=80
|
||||
)
|
||||
gain_idx = cmd.index('-g')
|
||||
assert cmd[gain_idx + 1] == 'LNA=40,VGA=40'
|
||||
cmd = builder.build_iq_capture_command(_make_device(), frequency_mhz=100.0, gain=80)
|
||||
gain_idx = cmd.index("-g")
|
||||
assert cmd[gain_idx + 1] == "LNA=40,VGA=40"
|
||||
|
||||
Reference in New Issue
Block a user