Esempio n. 1
0
 def test_make_req_url_max_limit_50(self):
     """
     Tests that any generated URL has a max limit of 50
     """
     match = 'https://bitbucket.org/api/1.0/repositories/technetiumccny/technetium/issues?limit=50'
     self.assertEqual(bitmethods.make_req_url
         (self.user, self.repo, self.issues_endpt, limit=9001), match)
Esempio n. 2
0
 def test_make_req_url_with_limit(self):
     """
     Tests that URL has proper limit parameter
     """
     match = 'https://bitbucket.org/api/1.0/repositories/technetiumccny/technetium/issues?limit=20'
     self.assertEqual(bitmethods.make_req_url
         (self.user, self.repo, self.issues_endpt, limit=20), match)
Esempio n. 3
0
 def test_make_req_url_with_limit_and_start(self):
     """
     Tests that URL is created with limit and start parameters
     """
     match = 'https://bitbucket.org/api/1.0/repositories/technetiumccny/technetium/issues?limit=50'
     self.assertEqual(bitmethods.make_req_url
         (self.user, self.repo, self.issues_endpt, limit=50), match)
Esempio n. 4
0
 def test_make_req_url(self):
     """
     Tests that constructs URL returns correct API request url.
     """
     match = 'https://bitbucket.org/api/1.0/repositories/technetiumccny/technetium/issues?limit=50'
     self.assertEqual(bitmethods.make_req_url
         (self.user, self.repo, self.issues_endpt), match)
Esempio n. 5
0
def get_subscribed_repo_urls(subs, endpoint, limit):
    """
    Creates a list of all subscribed repo API request URLs
    for issues endpoint.

    Parameters:
        subs: List (Subscription Objects)
        endpoint: String (API request endpoint: 'issues')
        limit: Integer (20)

    Returns:
        List (String URLs)
    """
    repo_urls = []
    for repo in subs:
        repo_urls.append(bitmethods.make_req_url(
            repo.owner, repo.slug_url, endpoint, limit))
    return repo_urls