Refactor: Convert server-dependent flow tests to offline mocked tests
Metadata
Reference Issue: #1649 New Tests Added: Yes (10 new offline mocked test functions) Documentation Updated: No Change Log Entry: "Refactor test_flow.py: Convert 11 server-dependent tests to offline mocked tests, improving test speed and CI/CD reliability"
Details:
What does this PR implement? This PR converts 11 server-dependent tests (marked with @pytest.mark.production_server() or @pytest.mark.test_server()) in test_flow.py to offline unit tests using unittest.mock. The tests now use XML fixture files and mock requests.Session HTTP calls.
What changed:
Created 11 XML fixture files in flows Converted 10 tests to module-level mocked functions (test_get_flow, test_get_structure, test_tagging, etc.) Preserved 1 integration test (test_sklearn_to_upload_to_flow) with @pytest.mark.test_server() for end-to-end validation All 16 tests pass successfully.
Testing
.venv/bin/python -m pytest tests/test_flows/test_flow.py -v
@geetu040 Please review