Skip to content

Splunk component filter support#25071

Merged
MartinHjelmare merged 5 commits into
home-assistant:devfrom
asleeis:splunk-component-filter-support
Jul 12, 2019
Merged

Splunk component filter support#25071
MartinHjelmare merged 5 commits into
home-assistant:devfrom
asleeis:splunk-component-filter-support

Conversation

@asleeis
Copy link
Copy Markdown
Contributor

@asleeis asleeis commented Jul 10, 2019

Description:

Adding "filter" support for the Splunk component. Filter implementation is modeled after the current HomeKit component filter support. This is the THIRD PR for this. First attempt was screwy in terms of commit information, and couldn't figure out how to resolve with prior PR, so started over. Second had a long pause while I found the time to figure out how to write the test cases. This time, everything should be ready to go with little delay (hopefully).

Pull request with documentation for home-assistant.io (if applicable): TBD; need to create; will update

Example entry for configuration.yaml (if applicable):

splunk:
  token: XXXXXXXXXXX
  host: splunk.example.com
  port: 8088
  ssl: true
  verify_ssl: false
  name: homeassistant
  filter:
    exclude_domains:
      - automation

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • No changes to communication code.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

asleeis added 2 commits July 10, 2019 14:56
…unk component, and the code to enforce the filter.
…ly to more easily write a test case where I can mock the point where the post would occur and validate that filtering is working correctly.

* Test cases created for full config check and to test the filtering
Comment thread homeassistant/components/splunk/__init__.py
Comment thread tests/components/splunk/test_init.py Outdated
timeout=10, verify=True)
self.mock_post.reset_mock()

def _setup_with_filter(self, mock_requests):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mock_requests isn't used in this function. We don't need to pass it here. It's active in the test, that's enough.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Missed that. I originally started trying to model my setup after another used for this component. I eventually deviated and went a whole other way (taking out use of mock_requests). Updated.

Copy link
Copy Markdown
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@MartinHjelmare MartinHjelmare merged commit f705a1e into home-assistant:dev Jul 12, 2019
@asleeis
Copy link
Copy Markdown
Contributor Author

asleeis commented Jul 12, 2019

Sweet. Thanks!

@asleeis asleeis deleted the splunk-component-filter-support branch July 12, 2019 22:50
@lock lock Bot locked and limited conversation to collaborators Jul 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants