def test_with_generator(self): gen = (0 for i in range(3)) # generators/iterators should not be modified. assert _typelist(gen) == gen
def test_with_single_type(self): assert _typelist(int) == [0]
def test_with_single_object(self): assert _typelist(0) == [0]
def test_with_list_of_types(self): assert _typelist([int, int, int]) == [0, 0, 0]
def test_with_list_of_objects(self): assert _typelist([0, 0, 0]) == [0, 0, 0]
def read(self, response_type): response = self._protocol.parse_response(self._protocol.get_response()) return _load(_typelist(response_type), response)