def test_CreateProject(self): #read api token values apitoken = config.get('todoistinfo', 'apitoken') # read project name projectname = config.get('todoistinfo', 'projectname') ''' Create project by using API commands ''' api = TodoistAPI(apitoken) api.sync() create_project = api.projects.add(projectname) response = api.commit() # Verify if the project has been created successfully assert response['projects'][0]['name'] == projectname assert projectname in [p['name'] for p in api.state['projects']] assert api.projects.get_by_id(create_project['id']) == create_project # update the created project ID to ini file config.set("todoistinfo", "projectid", str(create_project['id'])) config.write(open('../test_info.ini', 'w')) #Login to mobile apps and verify the project has been created successfully Todoist.Login(self) sleep(6) Todoist.Verify_CreatedProject(self, projectname)
def tearDown(self): Todoist.tearDown(self)
def setUp(self): Todoist.setUp(self)