示例#1
0
    def __init__(self, opts):
        """constructor provides access to the configuration options"""
        super(FunctionComponent, self).__init__(opts)
        # check_config is handling all of the error checking
        config_opts = check_config(opts)
        self.atd_url = config_opts.get("atd_url")
        self.atd_username = config_opts.get("atd_username")
        self.atd_password = config_opts.get("atd_password")
        self.timeout_mins = config_opts.get("timeout_mins")
        self.polling_interval = config_opts.get("polling_interval")
        self.vm_profile_list = config_opts.get("vm_profile_list")
        self.filePriority = config_opts.get("filePriority")
        self.trust_cert = config_opts.get("trust_cert")

        # Verify can make connection to ATD with given config values
        _get_atd_session_headers(self)
示例#2
0
    def test_helper_get_atd_session_headers(self, mocked_requests_get):
        sim_content = {"results": {"session": "session_key", "userId": "1"}}
        mocked_requests_get.return_value = self._generateResponse(
            sim_content, 200)
        creds = MockCredsAfterCheck()

        atd_session_headers = _get_atd_session_headers(creds)

        # Assert headers returned are correct
        assert atd_session_headers == self.sim_session_headers