Skip to content

Commit

Permalink
Added some test cases to first function in utils.py (#1016)
Browse files Browse the repository at this point in the history
* added some test cases to first function in utils.py

* added space after each comma
  • Loading branch information
thesagarsehgal authored and antmarakis committed Jan 30, 2019
1 parent 4fd3ef5 commit 264d969
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/test_utils.py
Expand Up @@ -35,9 +35,14 @@ def test_first():
assert first('word') == 'w'
assert first('') is None
assert first('', 'empty') == 'empty'
assert first([1, 2, 3, 4, 5]) == 1
assert first([]) == None
assert first(range(10)) == 0
assert first(x for x in range(10) if x > 3) == 4
assert first(x for x in range(10) if x > 100) is None
assert first((1, 2, 3)) == 1
assert first([(1, 2),(1, 3),(1, 4)]) == (1, 2)
assert first({1:"one", 2:"two", 3:"three"}) == 1


def test_is_in():
Expand Down

0 comments on commit 264d969

Please sign in to comment.