Skip to content

Commit

Permalink
rearrange args
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Durant committed Apr 20, 2018
1 parent 7c74b89 commit a15821d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
3 changes: 0 additions & 3 deletions intake_splunk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ def open(self, query, url, auth, chunksize=5000, **kwargs):
"""
from intake_splunk.core import SplunkSource
base_kwargs, source_kwargs = self.separate_base_kwargs(kwargs)
query = source_kwargs.pop('query', "")
url = source_kwargs.pop('url', "")
auth = source_kwargs.pop('auth', tuple())
return SplunkSource(query, url, auth,
metadata=base_kwargs['metadata'],
**source_kwargs)
17 changes: 9 additions & 8 deletions tests/test_intake_splunk.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
import os

import pytest
import pandas as pd

import intake
from intake_splunk.core import SplunkSource
from .util import start_splunk, stop_docker

CONNECT = {'host': 'localhost', 'port': 9200}
TEST_DATA_DIR = os.path.dirname(__file__)
TEST_DATA = 'sample1.csv'
df = pd.read_csv(os.path.join(TEST_DATA_DIR, TEST_DATA))


@pytest.fixture(scope='module')
def engine():
Expand All @@ -31,3 +24,11 @@ def test_basic(engine):
c = SplunkSource(test_query, engine, ('admin', 'changeme'), 100)
d = c.to_dask()
assert len(d.compute())


def test_open(engine):
# should always return something
test_query = 'index=_internal'
c = intake.open_splunk(test_query, engine, ('admin', 'changeme'), 100)
d = c.to_dask()
assert len(d.compute())

0 comments on commit a15821d

Please sign in to comment.