Exemplo n.º 1
0
 def test_get_project(self):
     """
     Test that a project can be fetched
     """
     reference = Gerrit(url=self.URL)
     reference.call = self.call
     reference.get_project(self.PROJECT)
     self.call.assert_called_with(r_endpoint='/a/projects/{}/'.format(
         self.PROJECT), )
Exemplo n.º 2
0
    def test_get_project(self, mock_get_netrc_auth):
        mock_get_netrc_auth.return_value = ('user', 'password')
        req = mock.Mock()
        req.status_code = 200
        req.content = ')]}\'{}'.encode('utf-8')
        call = mock.Mock()
        call.return_value = req

        reference = Gerrit(url='http://domain.com')
        reference.call = call
        project = reference.get_project('gerritproject')
        call.assert_called_with(r_endpoint='/a/projects/gerritproject/', )
Exemplo n.º 3
0
    def test_get_project(self, mock_get_netrc_auth):
        mock_get_netrc_auth.return_value = ('user', 'password')
        req = mock.Mock()
        req.status_code = 200
        req.content = ')]}\'{}'.encode('utf-8')
        call = mock.Mock()
        call.return_value = req

        reference = Gerrit(url='http://domain.com')
        reference.call = call
        project = reference.get_project('gerritproject')
        call.assert_called_with(
            r_endpoint='/a/projects/gerritproject/',
        )