File: conftest.py

package info (click to toggle)
freeorion 0.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 194,940 kB
  • sloc: cpp: 186,508; python: 40,969; ansic: 1,164; xml: 719; makefile: 32; sh: 7
file content (16 lines) | stat: -rw-r--r-- 370 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import pytest

import aistate_interface
from savegame_codec import build_savegame_string


@pytest.fixture()
def pack_object(monkeypatch):
    def do_decoding(obj):
        def get_aistate():
            return obj

        monkeypatch.setattr(aistate_interface, "get_aistate", get_aistate)
        return build_savegame_string().decode("utf-8")

    return do_decoding