def test_custom_object_is_iterable(self): class IterateMe(object): l = list() def __iter__(self): return iter(l) assert_that(IterateMe(), is_(iterable()))
def test_number_is_not_iterable(self): assert_that(0, is_not(iterable()))
def test_object_is_not_iterable(self): assert_that(object(), is_not(iterable()))
def test_unicode_is_iterable(self): assert_that(u'', is_(iterable()))
def test_iterator_is_iterable(self): assert_that(iter([]), is_(iterable()))
def test_string_is_iterable(self): assert_that('', is_(iterable()))
def test_generator_is_iterable(self): assert_that((i for i in []), is_(iterable()))
def test_set_is_iterable(self): assert_that(set(), is_(iterable()))
def test_tuple_is_iterable(self): assert_that(tuple(), is_(iterable()))
def test_dict_is_iterable(self): assert_that(dict(), is_(iterable()))
def test_list_is_iterable(self): assert_that(list(), is_(iterable()))