Пример #1
0
 def test_create_using_reviewboard_url(self):
     reviewboard_url = 'http://reviewboard.anthony.com'
     with mock.patch('reviewboard_client.RBClient') as mock_rb_client:
         reviewboard_client = ReviewboardClient.create_using_reviewboard_url(
             reviewboard_url)
         mock_rb_client.assert_called_once_with(reviewboard_url)
         self.assertIsNotNone(reviewboard_client)
	def test_create_using_reviewboard_url(self):
		reviewboard_url = 'http://reviewboard.anthony.com'
		with mock.patch('reviewboard_client.RBClient') as mock_rb_client:
			reviewboard_client = ReviewboardClient.create_using_reviewboard_url(reviewboard_url)
			mock_rb_client.assert_called_once_with(
				reviewboard_url
			)
			self.assertIsNotNone(reviewboard_client)
def collect_reviewboard_stats(reviewboard_url, usernames, client_kwargs=None, **get_review_requests_kwargs):
	if client_kwargs is None:
		client_kwargs = {}
	reviewboard_client = ReviewboardClient.create_using_reviewboard_url(reviewboard_url, **client_kwargs)
	return dict(
		(
			username,
			list(
				reviewboard_client.get_review_requests(to_users_directly=username, **get_review_requests_kwargs)
			)
		) for username in usernames
	)
Пример #4
0
def collect_reviewboard_stats(reviewboard_url,
                              usernames,
                              client_kwargs=None,
                              **get_review_requests_kwargs):
    if client_kwargs is None:
        client_kwargs = {}
    reviewboard_client = ReviewboardClient.create_using_reviewboard_url(
        reviewboard_url, **client_kwargs)
    return dict(
        (username,
         list(
             reviewboard_client.get_review_requests(
                 to_users_directly=username, **get_review_requests_kwargs)))
        for username in usernames)
	def test_get_review_requests(self):
		reviewboard_client = ReviewboardClient(MockRBClient())
		reviews = list(reviewboard_client.get_review_requests())
		self.assertEqual(len(reviews), 2)
Пример #6
0
 def test_get_review_requests(self):
     reviewboard_client = ReviewboardClient(MockRBClient())
     reviews = list(reviewboard_client.get_review_requests())
     self.assertEqual(len(reviews), 2)