示例#1
0
    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)
示例#2
0
 def tearDown(self):
     Todoist.tearDown(self)
示例#3
0
 def setUp(self):
     Todoist.setUp(self)