Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test_fullFile.py #111

Merged
merged 2 commits into from
Nov 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions tests/Functional/test_fullFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,16 @@ def test_full_file() -> None:


def create_cache() -> bytes:
vba_project = VbaProject()
vba_project.set_performance_cache_version(0x00B5)
modules = []
this_workbook = DocModule("ThisWorkbook")
this_workbook.cookie.value = 0xB81C
modules.append(this_workbook)
sheet1 = DocModule("Sheet1")
sheet1.cookie.value = 0x9B9A
modules.append(sheet1)
module1 = StdModule("Module1")
module1.cookie.value = 0xB241
modules.append(module1)

libraries = []
delim = []
Expand Down Expand Up @@ -232,10 +234,10 @@ def create_cache() -> bytes:
# index = 0x0046
i = 0

for module in vba_project.modules:
for module in modules:
name = module.modName.value.encode("utf_16_le")
ca += struct.pack("<H", prefix[i]) + name
ca += struct.pack("<HH", 0x0014, 0x0032) + chr(69 + i)
ca += struct.pack("<HH", 0x0014, 0x0032) + bytes([69 + i])
ca += "65be0257".encode("utf_16_le")
ca += struct.pack("<HHH", 0xFFFF, 0x0227, prefix[i])
ca += name + struct.pack("<HHHI", 0xFFFF, module.cookie.value, 0, 0)
Expand Down
Loading