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 (32 lines) | stat: -rw-r--r-- 687 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""
Config for tests inside this directory.
https://docs.pytest.org/en/2.7.3/plugins.html?highlight=re#working-with-plugins-and-conftest-files
"""

import os
import sys
from unittest.mock import MagicMock

this_dir = os.path.dirname(__file__)
sys.path.append(os.path.join(this_dir, "..", "..", "python", "AI/"))
sys.path.append(os.path.join(this_dir, "..", "..", "python"))


class aggression:
    beginner = 0
    turtle = 1
    cautious = 2
    typical = 3
    aggressive = 4
    maniacal = 5


def userString(x):
    return f"UserString {x}"


fo = MagicMock(name="freeOrionAIInterface")
fo.aggression = aggression
fo.userString = userString

sys.modules["freeOrionAIInterface"] = fo