def test_get_branches(self):
        branches_api_response = json.dumps([
            {
                'name': 'master',
                'id': 'c272edcac05b00e15440d6274723b639e3acbd7c',
            },
            {
                'name': 'im_a_branch',
                'id': '83904e6acb60e7ec0dcaae6c09a579ab44d0cf38',
            }
        ])

        def _http_get(self, *args, **kwargs):
            return branches_api_response, None

        account = self._get_hosting_account()
        account.data['private_token'] = encrypt_password('abc123')

        repository = Repository(hosting_account=account)
        repository.extra_data = {
            'rbgateway_repo_name': 'myrepo',
        }

        service = account.service
        self.spy_on(service.client.http_get, call_fake=_http_get)

        branches = service.get_branches(repository)

        self.assertTrue(service.client.http_get.called)

        self.assertEqual(len(branches), 2)

        self.assertEqual(
            branches,
            [
                Branch(id='master',
                       commit='c272edcac05b00e15440d6274723b639e3acbd7c',
                       default=True),
                Branch(id='im_a_branch',
                       commit='83904e6acb60e7ec0dcaae6c09a579ab44d0cf38',
                       default=False)
            ])
Lookup the number of instances by ELB state and assert if the minimum required is not met.
dataset/ETHPy150Open reviewboard/reviewboard/reviewboard/hostingsvcs/tests/test_rbgateway.py/ReviewBoardGatewayTests.test_get_branches--crossover with--dataset/ETHPy150Open viewfinderco/viewfinder/fabfile.py/check_min_healthy_instances