mirror of
https://github.com/vee1e/flare-floss.git
synced 2026-09-01 17:57:06 +00:00
test(cache): narrow optional layout before access for mypy
the new materialize tag tests asserted layout.strings without proving the layout is present, failing the CI mypy check. assert layout is not None first so the union narrows.
This commit is contained in:
parent
1571c403e0
commit
7a9b529100
1 changed files with 2 additions and 0 deletions
|
|
@ -388,6 +388,7 @@ def test_materialize_clears_tags_when_disabled():
|
|||
|
||||
# Analysis(enable_tags=False) keeps every string type enabled, tags off
|
||||
mat = floss.cache.materialize(doc, Path("sample.exe"), Analysis(enable_tags=False), 4)
|
||||
assert mat.layout is not None
|
||||
assert mat.strings.static_strings[0].tags == []
|
||||
assert mat.strings.language_strings[0].tags == []
|
||||
assert mat.layout.strings[0].tags == []
|
||||
|
|
@ -395,5 +396,6 @@ def test_materialize_clears_tags_when_disabled():
|
|||
|
||||
def test_materialize_keeps_tags_when_enabled():
|
||||
mat = floss.cache.materialize(make_full_doc(), Path("sample.exe"), wanted(), 4)
|
||||
assert mat.layout is not None
|
||||
assert mat.strings.static_strings[0].tags == ["#common"]
|
||||
assert mat.layout.strings[0].tags == ["#winapi"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue