This repository has been archived by the owner on Aug 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
conftest.py
52 lines (45 loc) · 1.49 KB
/
conftest.py
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import pytest
from app import controller
def get_cities():
return ["berlin"]
@pytest.fixture(autouse=True)
def mock_get_cities(monkeypatch):
monkeypatch.setattr(controller, 'get_cities', get_cities)
@pytest.fixture(autouse=True)
def mock_get_data(monkeypatch):
monkeypatch.setattr(controller, 'get_data_for', create_fake_data)
def create_fake_data(*args):
return {
"features": [
{
"geometry": {
"coordinates": [
13.062124,
52.401653
],
"type": "Point"
},
"properties": {
"title": "Wochenmarkt Potsdam Bassinplatz",
"location": "Wochenmarkt Potsdam Bassinplatz",
"opening_hours": "Mo-Fr 07:00-16:00;Sa 07:00-13:00",
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
13.095129,
52.3942
],
"type": "Point"
},
"properties": {
"title": "Floh- und Bauernmarkt in Potsdam Weberplatz, 14482 Potsdam",
"location": "Floh- und Bauernmarkt in Potsdam Weberplatz, 14482 Potsdam",
"opening_hours": "Sa 07:00-13:00",
},
"type": "Feature"
}
]
}