-
Notifications
You must be signed in to change notification settings - Fork 275
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3d6dfe7
commit e99b710
Showing
3 changed files
with
101 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
Empty file.
This file contains 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
from NanoVNASaver.Hardware.litevna_64 import ScreenshotData | ||
|
||
VALID_HEADER = b'\xe0\x01@\x01\x10' | ||
|
||
class TestScreenshotData: | ||
|
||
@staticmethod | ||
def test_from_header() -> None: | ||
result = ScreenshotData.from_header(VALID_HEADER) | ||
|
||
assert result.width == 480 | ||
assert result.height == 320 | ||
assert result.pixel_size == 16 | ||
assert len(result.data) == 0 | ||
|
||
@staticmethod | ||
def test_data_size() -> None: | ||
assert ScreenshotData(0,0,0).data_size() == 0 | ||
assert ScreenshotData(480,320,16).data_size() == 307200 | ||
|
||
@staticmethod | ||
def test_repr() -> None: | ||
assert f"{ScreenshotData(0,0,0)}" == "0x0 0bits (0 Bytes)" | ||
assert f"{ScreenshotData(480,320,16)}" == "480x320 16bits (307200 Bytes)" |