Private
Public Access
1
0

fixing failing tests

This commit is contained in:
Sander Roosendaal
2023-02-10 17:44:23 +01:00
parent 2981c59a5d
commit 792faf414e
5 changed files with 82 additions and 16 deletions

View File

@@ -186,15 +186,16 @@ class AsyncTaskTests(TestCase):
self.u.id)
self.assertEqual(res,1)
@patch('rowers.c2stuff.requests.post', side_effect=mocked_requests)
@patch('rowers.c2stuff.requests.get', side_effect=mocked_requests)
@patch('rowers.integrations.c2.requests.post', side_effect=mocked_requests)
@patch('rowers.integrations.c2.requests.get', side_effect=mocked_requests)
def test_c2_sync(self, mock_get, mock_post):
authorizationstring = str('Bearer aap')
headers = {'Authorization': authorizationstring,
'user-agent': 'sanderroosendaal',
'Content-Type': 'application/json'}
data = c2stuff.createc2workoutdata(self.wwater)
integration = C2Integration(self.u)
data = integration.createworkoutdata(self.wwater)
url = "https://log.concept2.com/api/users/%s/results" % (1)
res = tasks.handle_c2_sync(1,url,headers,data)
@@ -469,8 +470,8 @@ class AsyncTaskTests(TestCase):
self.assertEqual(res,1)
@patch('rowers.c2stuff.requests.post',side_effect=mocked_requests)
@patch('rowers.c2stuff.requests.get',side_effect=mocked_requests)
@patch('rowers.integrations.c2.requests.post',side_effect=mocked_requests)
@patch('rowers.integrations.c2.requests.get',side_effect=mocked_requests)
def test_import_c2_strokedata(self, mock_get, mock_post):
c2token = 'aap'
c2id = 1212