Updated test cases to support older Python version