Skip to content

Commit e94e4e2

Browse files
committed
Fix tests
1 parent 5d5b6f7 commit e94e4e2

File tree

3 files changed

+3
-47
lines changed

3 files changed

+3
-47
lines changed

clever/models/event.py

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -42,39 +42,6 @@ class Event(object):
4242
'type': 'type'
4343
}
4444

45-
discriminator_value_class_map = {
46-
'': 'DistrictsUpdated',
47-
'': 'TermsCreated',
48-
'': 'DistrictsDeleted',
49-
'': 'SchooladminsCreated',
50-
'': 'TeachersUpdated',
51-
'': 'ContactsUpdated',
52-
'': 'TermsDeleted',
53-
'': 'TeachersDeleted',
54-
'': 'TermsUpdated',
55-
'': 'ContactsDeleted',
56-
'': 'DistrictsCreated',
57-
'': 'DistrictadminsDeleted',
58-
'': 'SectionsCreated',
59-
'': 'SchooladminsDeleted',
60-
'': 'CoursesCreated',
61-
'': 'StudentsDeleted',
62-
'': 'SchoolsCreated',
63-
'': 'CoursesDeleted',
64-
'': 'CoursesUpdated',
65-
'': 'DistrictadminsCreated',
66-
'': 'SectionsDeleted',
67-
'': 'SectionsUpdated',
68-
'': 'SchoolsDeleted',
69-
'': 'ContactsCreated',
70-
'': 'TeachersCreated',
71-
'': 'SchoolsUpdated',
72-
'': 'StudentsCreated',
73-
'': 'SchooladminsUpdated',
74-
'': 'StudentsUpdated',
75-
'': 'DistrictadminsUpdated'
76-
}
77-
7845
def __init__(self, created=None, id=None, type=None):
7946
"""
8047
Event - a model defined in Swagger
@@ -83,7 +50,6 @@ def __init__(self, created=None, id=None, type=None):
8350
self._created = None
8451
self._id = None
8552
self._type = None
86-
self.discriminator = 'type'
8753

8854
if created is not None:
8955
self.created = created
@@ -156,16 +122,6 @@ def type(self, type):
156122

157123
self._type = type
158124

159-
def get_real_child_model(self, data):
160-
"""
161-
Returns the real base class specified by the discriminator
162-
"""
163-
discriminator_value = data[self.discriminator].lower()
164-
if self.discriminator_value_class_map.has_key(discriminator_value):
165-
return self.discriminator_value_class_map[discriminator_value]
166-
else:
167-
return None
168-
169125
def to_dict(self):
170126
"""
171127
Returns the model properties as a dict

test/test_data_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class TestDataApi(unittest.TestCase):
3838

3939
def setUp(self):
4040
self.api = clever.apis.data_api.DataApi()
41-
clever.configuration.access_token = 'TEST_TOKEN'
41+
self.api.api_client.configuration.access_token = 'TEST_TOKEN'
4242

4343
def tearDown(self):
4444
pass
@@ -52,7 +52,7 @@ def test_unicode_receive(self):
5252
real_pool = self.api.api_client.rest_client.pool_manager
5353
self.api.api_client.rest_client.pool_manager = mock_pool
5454

55-
mock_pool.expect_request('GET', 'https://api.clever.com/v1.2/districts/something')
55+
mock_pool.expect_request('GET', 'https://api.clever.com/v2.0/districts/something')
5656
# Make sure unicode responses can be received.
5757
self.assertEqual(u'Oh haiô', self.api.get_district('something').data.name)
5858
self.api.api_client.rest_client.pool_manager = real_pool

test/test_events_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class TestEventsApi(unittest.TestCase):
2727

2828
def setUp(self):
2929
self.api = clever.apis.events_api.EventsApi()
30-
clever.configuration.access_token = 'TEST_TOKEN'
30+
self.api.api_client.configuration.access_token = 'TEST_TOKEN'
3131

3232
def tearDown(self):
3333
pass

0 commit comments

Comments
 (0)