Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
| Download
Views: 18655
1
from unittest import TestCase
2
3
from pbx_gs_python_utils.utils.Dev import Dev
4
from pbx_gs_python_utils.utils.Files import Files
5
6
from oss_hugo.OSS_GSheet_Data import OSS_GSheet_Data
7
8
9
class test_OSS_GSheet_Data(TestCase):
10
11
def setUp(self):
12
self.gsheet_data = OSS_GSheet_Data()
13
self.result = None
14
15
def tearDown(self):
16
if self.result is not None:
17
Dev.pprint(self.result)
18
19
def test__init__(self):
20
assert type(self.gsheet_data.url) == str
21
22
def test_get_data(self):
23
assert set(self.gsheet_data.get_data()) == {'onsite','remote'}
24
25
def test_data_participants_onsite(self):
26
assert len(self.gsheet_data.data_participants_onsite()) > 100
27
28
def test_data_participants_remote(self):
29
assert len(self.gsheet_data.data_participants_remote()) > 20
30
31
def test_df_participants_onsite(self):
32
data = self.gsheet_data.df_participants_onsite()
33
assert set(data) == { 'Accommodation','Chapter Leader','Company','Days','ID','Location','Name',
34
'Nights','Page On website','Payment Status','Project Leader',
35
'Skills/Topics','Sponsor'}
36
assert type(data['Days'][0]) == list
37
38
def test_df_participants_remote(self):
39
assert set(self.gsheet_data.df_participants_remote()) == {'Location', 'ID', 'Name'}
40