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