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