mirror of
https://github.com/donnemartin/data-science-ipython-notebooks.git
synced 2024-03-22 13:30:56 +08:00
Added snippet to test if an object is iterable.
This commit is contained in:
parent
a7262a50a2
commit
52552208c1
|
@ -1,5 +1,6 @@
|
|||
from nose.tools import assert_equal
|
||||
from nose.tools import raises
|
||||
from pydatasnippets.util import Util
|
||||
|
||||
|
||||
class TestUtil():
|
||||
|
@ -35,5 +36,6 @@ class TestUtil():
|
|||
def test_attributes_fail(self):
|
||||
return getattr('foo', 'bar')
|
||||
|
||||
|
||||
|
||||
def test_is_iterable(self):
|
||||
assert_equal(Util.is_iterable('foo'), True)
|
||||
assert_equal(Util.is_iterable(7), False)
|
||||
|
|
Loading…
Reference in New Issue
Block a user