diff --git a/README.md b/README.md index fc02f33..15e09ee 100644 --- a/README.md +++ b/README.md @@ -80,8 +80,3 @@ activities_list = hubstaff.get_activities_list( organization_id_list=[123, 456], project_id_list=[123, 456]) ``` - -Take activity item: -```python -activity_item = hubstaff.get_activity_item(activity_id=123) -``` diff --git a/hubstaff/client_v1.py b/hubstaff/client_v1.py index e4546e3..5210aab 100644 --- a/hubstaff/client_v1.py +++ b/hubstaff/client_v1.py @@ -19,7 +19,6 @@ class HubstaffClient: tasks_list_endpoint = '/tasks' task_item_endpoint = '/tasks/%s' activities_list_endpoint = '/activities' - activity_item_endpoint = '/activities/%s' def __init__(self, app_token, auth_token=None, username=None, password=None): @@ -184,8 +183,3 @@ def get_activities_list(self, from_, to_, activities_list = result['activities'] return activities_list - - def get_activity_item(self, activity_id): - result = self._get(self.activity_item_endpoint % activity_id) - activity_item = result['activity'] - return activity_item diff --git a/tests/test_v1_activity_item_integration.py b/tests/test_v1_activity_item_integration.py deleted file mode 100644 index 970ca9b..0000000 --- a/tests/test_v1_activity_item_integration.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import unittest -import os -from datetime import datetime - -from hubstaff.client_v1 import HubstaffClient - - -# @unittest.skip('to prevent rate limits api error') -class TestCase(unittest.TestCase): - - @classmethod - def setUpClass(cls): - cls.client = HubstaffClient( - app_token=os.getenv('HUBSTAFF_APP_TOKEN'), - auth_token=os.getenv('HUBSTAFF_AUTH_TOKEN'), - username=os.getenv('HUBSTAFF_USERNAME'), - password=os.getenv('HUBSTAFF_PASSWORD')) - # save auth_token to prevent auth api throttling - if not os.getenv('HUBSTAFF_AUTH_TOKEN'): - os.environ['HUBSTAFF_AUTH_TOKEN'] = cls.client.authenticate() - # date range - cls.date_from = datetime.strptime( - os.getenv('HUBSTAFF_TEST_DATE_FROM'), '%Y-%m-%d') - cls.date_to = datetime.strptime( - os.getenv('HUBSTAFF_TEST_DATE_TO'), '%Y-%m-%d') - # save first found activity id - activities_list = cls.client.get_activities_list( - cls.date_from, cls.date_to) - cls.activity_id = activities_list[0]['id'] - - def test_get_activity_item(self): - activity_item = self.client.get_activity_item( - activity_id=self.activity_id) - - self.assertIn('id', activity_item) - self.assertIn('time_slot', activity_item) - self.assertIn('starts_at', activity_item) - self.assertIn('user_id', activity_item) - self.assertIn('project_id', activity_item) - self.assertIn('task_id', activity_item) - self.assertIn('keyboard', activity_item) - self.assertIn('mouse', activity_item) - self.assertIn('overall', activity_item) - self.assertIn('tracked', activity_item) - self.assertIn('paid', activity_item) - - -if __name__ == '__main__': - unittest.main()