Skip to content

Commit

Permalink
Add some simple tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ian-r-rose committed Mar 27, 2019
1 parent 58ff9a1 commit 6ed63ee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dask/bytes/tests/test_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ def test_parse_sample_bytes():
sample, values = read_bytes('.test.accounts.*', sample='40 B')
assert len(sample) == 40

def test_read_bytes_no_sample():
with filetexts(files, mode='b'):
sample, = read_bytes('.test.accounts.1.json', sample=False)

This comment has been minimized.

Copy link
@martindurant

martindurant Mar 27, 2019

Member

Should be sample, _ = ?
I would think the output is actually None rather than False.

assert sample is False

def test_read_bytes_blocksize_none():
with filetexts(files, mode='b'):
Expand Down
6 changes: 6 additions & 0 deletions dask/dataframe/io/tests/test_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,12 @@ def test_empty_csv_file():
assert list(df.columns) == ['a', 'b']


def test_read_csv_no_sample():
with filetexts(csv_files, mode='b') as fn:
df = dd.read_csv(fn, sample=False)
assert list(df.columns) == ['name', 'amount', 'id']


def test_read_csv_sensitive_to_enforce():
with filetexts(csv_files, mode='b'):
a = dd.read_csv('2014-01-*.csv', enforce=True)
Expand Down

0 comments on commit 6ed63ee

Please sign in to comment.