|
5 | 5 | """ |
6 | 6 |
|
7 | 7 | import json |
8 | | -import os |
9 | | -import pytest |
10 | | -from unittest.mock import patch, MagicMock |
11 | 8 |
|
12 | 9 |
|
13 | 10 | class TestTriggerTimeTags: |
@@ -130,34 +127,6 @@ def test_get_origin_run_tags_handles_missing_run(self): |
130 | 127 | result = _get_origin_run_tags("NonExistentFlow", "nonexistent_run_id") |
131 | 128 | assert result == [] |
132 | 129 |
|
133 | | - def test_get_origin_run_tags_with_mock(self): |
134 | | - """Test that user_tags from origin run are returned.""" |
135 | | - from metaflow.cli_components.run_cmds import _get_origin_run_tags |
136 | | - |
137 | | - mock_run = MagicMock() |
138 | | - mock_run.user_tags = {"experiment_v2", "batch_1"} |
139 | | - |
140 | | - with patch( |
141 | | - "metaflow.cli_components.run_cmds.Run", |
142 | | - return_value=mock_run, |
143 | | - create=True, |
144 | | - ) as mock_cls: |
145 | | - # We need to patch where it's imported |
146 | | - with patch( |
147 | | - "metaflow.client.core.Run", |
148 | | - return_value=mock_run, |
149 | | - ): |
150 | | - # The function does a local import, so we need to patch at module level |
151 | | - pass |
152 | | - |
153 | | - # Since the function uses a local import, let's test through the actual |
154 | | - # function with a mock at the right level |
155 | | - with patch.dict("sys.modules", {}): |
156 | | - # This is tricky with local imports. Test the contract instead: |
157 | | - # _get_origin_run_tags should return a list |
158 | | - result = _get_origin_run_tags("SomeFlow", "some_run_id") |
159 | | - assert isinstance(result, list) |
160 | | - |
161 | 130 | def test_resume_tags_merge_logic(self): |
162 | 131 | """Verify that origin tags are merged with CLI tags correctly.""" |
163 | 132 | # Simulates the merge logic in resume() |
|
0 commit comments