Exemple #1
0
def test_handler_bad_type(config_mock, failure_mock):
    """App Integration - Test Handler, Bad Service Type"""
    base_config = get_valid_config_dict('duo_auth')
    base_config.update({'type': 'bad_type', 'current_state': 'running'})
    config_mock.return_value = AppConfig(base_config)
    handler(None, get_mock_context())

    failure_mock.assert_called()
Exemple #2
0
def test_handler_success(gather_mock, config_mock, failure_mock):
    """App Integration - Test Handler, Success"""
    base_config = get_valid_config_dict('duo_auth')
    config_mock.return_value = AppConfig(base_config)
    gather_mock.return_value = None
    handler(None, get_mock_context())

    failure_mock.assert_not_called()
def test_endpoint_not_implemented():
    """DuoApp - Subclass Endpoint Not Implemented"""
    class DuoFakeApp(DuoApp):
        """Fake Duo app that should raise a NotImplementedError"""
        @classmethod
        def _type(cls):
            return 'fake'

    DuoFakeApp(get_valid_config_dict('duo'))._endpoint()
Exemple #4
0
def test_filter_entries_not_implemented():
    """SlackApp - Subclass Filter Entries Not Implemented"""
    class SlackFakeApp(SlackApp):
        """Fake Slack app that should raise a NotImplementedError"""
        @classmethod
        def _type(cls):
            return 'fake'

        @classmethod
        def _endpoint(cls):
            return 0

    SlackFakeApp(get_valid_config_dict('slack'))._filter_response_entries("")
Exemple #5
0
def test_endpoint_not_implemented():
    """SlackApp - Subclass Endpoint Not Implemented"""
    class SlackFakeApp(SlackApp):
        """Fake Slack app that should raise a NotImplementedError"""
        @classmethod
        def _type(cls):
            return 'fake'

        @classmethod
        def _sleep_seconds(cls):
            return 0

    SlackFakeApp(get_valid_config_dict('slack'))._endpoint()
 def setup(self):
     """Setup before each method"""
     self._app = DuoApp(AppConfig(get_valid_config_dict('duo')))
 def setup(self):
     """Setup before each method"""
     self._app = AppIntegration(AppConfig(get_valid_config_dict('duo_admin')))
def test_get_app_exception_invalid():
    """App Integration - App Base, Get App Exception for Invalid Service"""
    config = AppConfig(get_valid_config_dict('duo_auth'))
    config['type'] = 'bad_service_type'
    get_app(config)
def test_get_app_exception_type():
    """App Integration - App Base, Get App Exception for No 'type'"""
    config = AppConfig(get_valid_config_dict('duo_auth'))
    del config['type']
    get_app(config)
def test_get_app():
    """App Integration - App Base, Get App"""
    config = AppConfig(get_valid_config_dict('duo_auth'))
    app = get_app(config)
    assert_is_not_none(app)
Exemple #11
0
 def setup(self):
     """Setup before each method"""
     self._app = OneLoginApp(AppConfig(get_valid_config_dict('onelogin')))
Exemple #12
0
 def setup(self):
     """Setup before each method"""
     self._app = GSuiteReportsApp(
         AppConfig(get_valid_config_dict('gsuite_admin')))
Exemple #13
0
 def setup(self):
     """Setup before each method"""
     self._app = SalesforceApp(AppConfig(get_valid_config_dict('salesforce')))
Exemple #14
0
 def setup(self):
     self._app = SlackAccessApp(AppConfig(get_valid_config_dict('slack')))
Exemple #15
0
 def setup(self):
     self._app = SlackIntegrationsApp(
         AppConfig(get_valid_config_dict('slack')))
Exemple #16
0
 def setup(self):
     """Setup before each method"""
     self._app = BoxApp(AppConfig(
         get_valid_config_dict('box_admin_events')))