diff --git a/mgz/fast/header.py b/mgz/fast/header.py index f96c878..d3c035c 100644 --- a/mgz/fast/header.py +++ b/mgz/fast/header.py @@ -230,7 +230,9 @@ def parse_scenario(data, num_players, version, save): """Parse scenario section.""" data.read(4455) if version is Version.DE: - data.read(128) + data.read(102) + aoc_string(data) # scenario filename + data.read(24) instructions = aoc_string(data) for _ in range(0, 9): aoc_string(data) diff --git a/tests/recs/de-50.6-scenario.aoe2record b/tests/recs/de-50.6-scenario.aoe2record new file mode 100644 index 0000000..f1b6c92 Binary files /dev/null and b/tests/recs/de-50.6-scenario.aoe2record differ diff --git a/tests/test_fast.py b/tests/test_fast.py index 156c6f2..39b07fe 100644 --- a/tests/test_fast.py +++ b/tests/test_fast.py @@ -42,6 +42,21 @@ def test_map(self): self.assertEqual(self.data['lobby']['seed'], -1970180596) +class TestFastDEScenario(unittest.TestCase): + + @classmethod + def setUpClass(cls): + with open('tests/recs/de-50.6-scenario.aoe2record', 'rb') as handle: + cls.data = parse(handle) + + def test_version(self): + self.assertEqual(self.data['version'], Version.DE) + + def test_players(self): + players = self.data.get('players') + self.assertEqual(len(players), 3) + + class TestFastHD(unittest.TestCase): @classmethod