Esempio n. 1
0
    def test_auth_check(self, mock_get_conf, mock_get_password):
        mock_get_conf.return_value = fakes.USERNAME
        mock_get_password.return_value = fakes.PASSWORD

        api.auth_check()

        mock_get_conf.assert_called_with(cfg.USERNAME_KEY)
        mock_get_password.assert_called()
Esempio n. 2
0
    def test_auth_check(self, mock_get_conf, mock_get_password):
        mock_get_conf.return_value = fakes.USERNAME
        mock_get_password.return_value = fakes.PASSWORD

        api.auth_check()

        mock_get_conf.assert_called_with(cfg.USERNAME_KEY)
        mock_get_password.assert_called()
Esempio n. 3
0
    def test_auth_check_no_creds(self, mock_get_conf, mock_get_password,
                                 mock_echo, mock_sys):
        mock_get_conf.return_value = None
        mock_get_password.return_value = None

        api.auth_check()

        mock_echo.assert_called_with('Credentials not found. Run `vcl config`.')
        mock_sys.assert_called_with(1)
Esempio n. 4
0
    def test_auth_check_no_creds(self, mock_get_conf, mock_get_password,
                                 mock_echo, mock_sys):
        mock_get_conf.return_value = None
        mock_get_password.return_value = None

        api.auth_check()

        mock_echo.assert_called_with(
            'Credentials not found. Run `vcl config`.')
        mock_sys.assert_called_with(1)