-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtest.py
74 lines (56 loc) · 2.56 KB
/
test.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import os
import datetime
import unittest
from teammood.teammood import Teammood, INTERVALS, TAG_COMBINATOR
class Test_Functionality(unittest.TestCase):
def test_01_auth(self):
teammood_client = Teammood(team_id=os.getenv("TEAM_ID"),
api_key=os.getenv("API_KEY")
)
assert teammood_client.TEAM_ID and teammood_client.API_KEY
def test_02_moods_since(self):
teammood_client = Teammood(team_id=os.getenv("TEAM_ID"),
api_key=os.getenv("API_KEY")
)
moods = teammood_client.get_all_moods_since(
since=7
)
assert len(moods.days) > 0
def test_02a_moods_since(self):
teammood_client = Teammood(team_id=os.getenv("TEAM_ID"),
api_key=os.getenv("API_KEY")
)
moods = teammood_client.get_all_moods_since(
since=7,
tags=[''],
tagscombinator=TAG_COMBINATOR.INTERSECTION
)
assert len(moods.days) > 0
def test_03_moods_by_date(self):
teammood_client = Teammood(team_id=os.getenv("TEAM_ID"),
api_key=os.getenv("API_KEY")
)
moods = teammood_client.get_all_moods_for_dates(
start_datetime=datetime.datetime(year=2019, month=5, day=1),
end_datetime=datetime.datetime(year=2019, month=5, day=27)
)
assert len(moods.days) > 0
def test_04_participation_by_date(self):
teammood_client = Teammood(team_id=os.getenv("TEAM_ID"),
api_key=os.getenv("API_KEY")
)
participation = teammood_client.get_participation_for_dates(
start_datetime=datetime.datetime(year=2019, month=5, day=1),
end_datetime=datetime.datetime(year=2019, month=5, day=27),
interval=INTERVALS.DAILY
)
assert len(participation.rates) > 0
def test_05_get_unified_mood_with_participation(self):
teammood_client = Teammood(team_id=os.getenv("TEAM_ID"),
api_key=os.getenv("API_KEY")
)
super_mood = teammood_client.get_moods_with_participation(
start_datetime=datetime.datetime(year=2019, month=5, day=1),
end_datetime=datetime.datetime(year=2019, month=5, day=27)
)
assert len(super_mood.days) > 1