    def test_data_collection_window_invalid(self):
        """
        target: test window() API for invalid scenario
        method: 1. input/output_schema type invalid     2. Size type invalid(not int)
                3. Size value invalid(<0)               4. Step type invalid(not int)
                5. Step value invalid(<0)
        expected: raise exception
        """
        # 1. input_schema/output_schema type invalid
        try:
            towhee.pipe.input('n1', 'n2') \
                       .window(('n1', 'n'), ('s1', 's'), 2, 2, lambda x, y: (sum(x), sum(y))) \
                       .output('s1', 's2')
        except Exception as e:
            assert "not declared" in str(e)

        # 2. Size type invalid (not int)
        size_type = ['B', [23], {0}]
        for size in size_type:
            try:
                towhee.pipe.input('n1', 'n2') \
                      .window(('n1', 'n2'), ('s1', 's2'), size, 2, lambda x, y: (sum(x), sum(y))) \
                      .output('s1', 's2')
            except Exception as e:
                assert "not int" in str(e)

        # 3. Size value invalid (<0)
        # If size value > the length of input data, towhee compute with size = the length of input data
        try:
            towhee.pipe.input('n1', 'n2') \
                       .window(('n1', 'n2'), ('s1', 's2'), -10, 2, lambda x, y: (sum(x), sum(y))) \
                       .output('s1', 's2')
        except Exception as e:
            assert "<=0" in str(e)

        # 4. Step type invalid(not int)
        step_type = ['B', [23], {0}]
        for step in step_type:
            try:
                towhee.pipe.input('n1', 'n2') \
                    .window(('n1', 'n2'), ('s1', 's2'), 2, step, lambda x, y: (sum(x), sum(y))) \
                    .output('s1', 's2')
            except Exception as e:
                assert "not int" in str(e)

        # 5. Step value invalid(<0)
        try:
            towhee.pipe.input('n1', 'n2') \
                       .window(('n1', 'n2'), ('s1', 's2'), 2, -1, lambda x, y: (sum(x), sum(y))) \
                       .output('s1', 's2')
        except Exception as e:
            assert "<=0" in str(e)

        return True
target: test window() API for invalid scenario
method: 1. input/output_schema type invalid     2. Size type invalid(not int)
3. Size value invalid(<0)               4. Step type invalid(not int)
5. Step value invalid(<0)
expected: raise exception
tests/testcases/test_data_collection.py