Ejemplo n.º 1
0
    def test_custom_object_is_iterable(self):
        class IterateMe(object):
            l = list()
            def __iter__(self):
                return iter(l)

        assert_that(IterateMe(), is_(iterable()))
Ejemplo n.º 2
0
 def test_number_is_not_iterable(self):
     assert_that(0, is_not(iterable()))
Ejemplo n.º 3
0
 def test_object_is_not_iterable(self):
     assert_that(object(), is_not(iterable()))
Ejemplo n.º 4
0
 def test_unicode_is_iterable(self):
     assert_that(u'', is_(iterable()))
Ejemplo n.º 5
0
 def test_iterator_is_iterable(self):
     assert_that(iter([]), is_(iterable()))
Ejemplo n.º 6
0
 def test_string_is_iterable(self):
     assert_that('', is_(iterable()))
Ejemplo n.º 7
0
 def test_generator_is_iterable(self):
     assert_that((i for i in []), is_(iterable()))
Ejemplo n.º 8
0
 def test_set_is_iterable(self):
     assert_that(set(), is_(iterable()))
Ejemplo n.º 9
0
 def test_tuple_is_iterable(self):
     assert_that(tuple(), is_(iterable()))
Ejemplo n.º 10
0
 def test_dict_is_iterable(self):
     assert_that(dict(), is_(iterable()))
Ejemplo n.º 11
0
 def test_list_is_iterable(self):
     assert_that(list(), is_(iterable()))