Exemple #1
0
    def test_no_endpoint(self):
        """
        Test what happens if the endpoint class attr isn't set.
        """
        account_url = 'http://example.com'
        access_token = 'abceasyas123'

        some_api = Basecamp(account_url, access_token)
        some_api.construct_url()
Exemple #2
0
    def test_endpoint_slashes(self):
        """
        Test that slashes are removed from the endpoint.
        """
        account_url = 'http://example.com'
        access_token = 'abceasyas123'

        some_api = Basecamp(account_url, access_token)
        some_api.endpoint = '/foobars/'
        self.assertEquals(
            some_api.construct_url(),
            'http://example.com/foobars?access_token=abceasyas123')
Exemple #3
0
    def test_good_url(self):
        """
        Test construction of a URL.
        """
        account_url = 'http://example.com'
        access_token = 'abceasyas123'

        some_api = Basecamp(account_url, access_token)
        some_api.endpoint = 'foobars'
        self.assertEquals(
            some_api.construct_url(),
            'http://example.com/foobars?access_token=abceasyas123')
Exemple #4
0
    def show_logs(self, username='', password='', hours='', description=''):
        bc = Basecamp('', '', '')
        me = bc.getCurrentPerson().id
        total = 0.0

        projects = bc.getProjects()
        print projects[0]

        #bc.createTimeEntryForProject(projects[0],hours=hours,person_id=me,description=description)

        for te in bc.getEntriesReport('', '', subject_id=me):
            print '%s: %0.2f' % (te.description, float(te.hours))
Exemple #5
0
    def show_logs(self, username='', password='', hours='', description=''):
        bc = Basecamp('https://seertechnologies.basecamphq.com',
                      '*****@*****.**', 'asdasd123')
        me = bc.getCurrentPerson().id
        total = 0.0

        projects = bc.getProjects()
        print projects[0]

        #bc.createTimeEntryForProject(projects[0],hours=hours,person_id=me,description=description)

        for te in bc.getEntriesReport('2012-11-01',
                                      '2014-11-30',
                                      subject_id=me):
            print '%s: %0.2f' % (te.description, float(te.hours))