Skip to content

Commit

Permalink
add tests for is_non_string_iterable
Browse files Browse the repository at this point in the history
  • Loading branch information
FlynnOwen committed Feb 9, 2023
1 parent d122a21 commit b5e2a8a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,14 @@ def test_proportions_from_distribution():
uniform = u.column(1)
assert len(uniform) == 50 and _round_eq(1, sum(uniform))
assert [x in (0, 0.5, 1) for x in ds.sample_proportions(2, ds.make_array(.2, .3, .5))]


def test_is_non_string_iterable():
is_string = 'hello'
assert ds.is_non_string_iterable(is_string) == False

is_list = [1, 2, 3]
assert ds.is_non_string_iterable(is_list) == True

is_int = 1
assert ds.is_non_string_iterable(is_int) == False

0 comments on commit b5e2a8a

Please sign in to comment.