    def test_data_collection_time_window_invalid(self):
        """
        target: test time_window() API for invalid scenario
        method: 1. timestamp_col not declared        2. timestamp_col type invalid (not str)
                3. Size/step type invalid            4. Size/step value invalid
        expected: raise exception
        """
        # 1. timestamp_col not declared
        try:
            towhee.pipe.input('d') \
                  .flat_map('d', ('n1', 't'), lambda x: ((a, c) for a, c in x)) \
                  .time_window('n1', 's1', 'a', 3, 1, lambda x: x) \
                  .output('s1')
        except Exception as e:
            assert "not declared" in str(e)

        # 2. timestamp_col type invalid (not str)
        try:
            towhee.pipe.input('d') \
                  .flat_map('d', ('n1', 't'), lambda x: ((a, c) for a, c in x)) \
                  .time_window('n1', 's1', 1000, 3, 1, lambda x: x) \
                  .output('s1')
        except Exception as e:
            assert "not iterable" in str(e)

        # 3. Size/step type invalid
        size_type = ['B', [23], {0}]
        for size in size_type:
            try:
                towhee.pipe.input('d') \
                      .flat_map('d', ('n1', 't'), lambda x: ((a, c) for a, c in x)) \
                      .time_window('n1', 's1', 't', size, 1, lambda x: x) \
                      .output('s1')
            except Exception as e:
                assert "not int" in str(e)
        step_type = ['B', [23], {0}]
        for step in step_type:
            try:
                towhee.pipe.input('d') \
                    .flat_map('d', ('n1', 't'), lambda x: ((a, c) for a, c in x)) \
                    .time_window('n1', 's1', 't', 3, step, lambda x: x) \
                    .output('s1')
            except Exception as e:
                assert "not int" in str(e)

        # 4. Size/step value invalid
        try:
            towhee.pipe.input('d') \
                  .flat_map('d', ('n1', 't'), lambda x: ((a, c) for a, c in x)) \
                  .time_window('n1', 's1', 't', -3, -1, lambda x: x) \
                  .output('s1')
        except Exception as e:
            assert "<=0" in str(e)

        return True
target: test time_window() API for invalid scenario
method: 1. timestamp_col not declared        2. timestamp_col type invalid (not str)
3. Size/step type invalid            4. Size/step value invalid
expected: raise exception
tests/testcases/test_data_collection.py