Open snake-biscuits opened 2 months ago
atm we're only testing __init__
s (specifically .from_file()
)
some of these tests include .namelist()
& .read()
checks
.namelist()
can't work without some __init__
.read()
can't work without .namelist()
loading a file 3 times to test 2 methods is a bit much
but it'd still be best to break these tests up
loading the maps before tests is less than ideal
excluding
nexon.PakFile
because it only appears in CS:O2.bsp
s
We need some specific SpecialLumpClass
tests for this
But afaik no public source tool for making these PakFiles exists
organnerx has some people making tools, idk how public they are
Which means the only real-world examples of the format we're going to find are inside maps
Tho we can test .from_bytes()
like we do for pkware.Zip
For testing the real-world cases:
nexon.PakFile.as_bytes()
is really important to test, since it's required for NexonBsp.save_as()
ArchiveClasses don't have to have .as_bytes()
methods
Except for pkware.Zip
& nexon.PakFile
, since they both get used as SpecialLumpClasses
But we should keep links etc. for external tools used with each format in docs/
Something to add to the DB
Testing nexon.PakFile
via CS:O2 .bsp
s is failing in a really wierd way
>>> import bsp_tool
>>> bsp = bsp_tool.load_bsp("E:/Mod/CSO2/maps/gb_varena.bsp") # map with least files in pakfile (8)
>>> bsp.headers["PAKFILE"]
<LumpHeader (offset: 587596, length: 134135, version: 0, compressed: 0, fourCC: 0)>
>>> len(bsp.PAKFILE.as_bytes())
134146 # 11 bytes over???
Really need to be testing this w/ a handmade deflate
for .from_bytes()
And as a SpecialLumpClass
, though that requires either local test maps:
Or a specific test that targets MegaTest maps:
As stated in #191 we should be testing all
ArchiveClass
es as they're being actively worked onArchiveClasses
bluepoint.Bpk
cdrom.Iso
gearbox.Nightfire007
id_software.Pak
id_software.Pk3
infinity_ward.FastFile
infinity_ward.Iwd
ion_storm.Dat
ion_storm.Pak
mame.Chd
nexon.Hfs
nexon.Pkg
padus.Cdi
pi_studios.Bpk
pkware.Zip
respawn.RPak
respawn.Vpk
sega.GDRom
sega.Gdi
utoplanet.Apk
valve.Vpk
Related
191