Exemplo n.º 1
0
    def test_api_different_host_in_provider_url(self, gitlab_mock):
        url = 'localhost'
        token = 'foo'

        prov = Provider(bundle=RequirementsBundle(), url=url)
        prov._api(token)
        gitlab_mock.assert_called_once_with(url, token, ssl_verify=True)
Exemplo n.º 2
0
    def test_ignore_ssl_should_be_default_false(self, gitlab_mock):
        provider = Provider(bundle=Mock())
        provider._api("foo")

        self.assertFalse(provider.ignore_ssl)
        gitlab_mock.assert_called_once_with("https://gitlab.com",
                                            "foo",
                                            ssl_verify=True)
Exemplo n.º 3
0
    def test_ignore_ssl(self, gitlab_mock):
        ignore_ssl = True
        provider = Provider(bundle=RequirementsBundle(), ignore_ssl=ignore_ssl)
        provider._api("foo")

        self.assertTrue(provider.ignore_ssl)
        gitlab_mock.assert_called_once_with("https://gitlab.com",
                                            "foo",
                                            ssl_verify=(not ignore_ssl))
Exemplo n.º 4
0
 def test_api_different_host(self, github_mock):
     prov = Provider(bundle=RequirementsBundle())
     prov._api("foo@localhost")
     github_mock.assert_called_once_with("localhost", "foo")
Exemplo n.º 5
0
 def test_api(self, github_mock):
     prov = Provider(bundle=RequirementsBundle())
     prov._api("foo")
     github_mock.assert_called_once_with("https://gitlab.com", "foo")
Exemplo n.º 6
0
 def setUp(self):
     self.provider = Provider(bundle=Mock())
     self.provider._api = Mock()
     self.repo = Mock()
Exemplo n.º 7
0
 def test_api_different_host_in_token(self, gitlab_mock):
     prov = Provider(bundle=RequirementsBundle())
     prov._api("foo@localhost")
     gitlab_mock.assert_called_once_with("localhost",
                                         "foo",
                                         ssl_verify=True)