Skip to content

Commit fe05904

Browse files
committed
fix(#266): more test cases
1 parent 42f8ea3 commit fe05904

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

sr-data/src/tests/test_workflows.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,3 +187,51 @@ def test_returns_false_on_simple_list(self):
187187
),
188188
"Workflow shouldn't be used for releases, but it was"
189189
)
190+
191+
@pytest.mark.fast
192+
def test_outputs_workflow_info_with_nested_expression(self):
193+
info = workflow_info(
194+
"""
195+
name: test
196+
on:
197+
push:
198+
branches:
199+
- master
200+
jobs:
201+
build:
202+
strategy:
203+
matrix:
204+
platform:
205+
- runner: ubuntu-latest
206+
target: x86_64
207+
- runner: ubuntu-latest
208+
target: x86
209+
runs-on: ${{ matrix.platform.runner }}
210+
steps:
211+
- name: Checkout code
212+
uses: actions/checkout@v3
213+
- name: Set up Python
214+
uses: actions/setup-python@v3
215+
with:
216+
python-version: '3.8'
217+
- name: Install dependencies
218+
run: pip install -r requirements.txt
219+
- name: Run tests
220+
run: pytest
221+
"""
222+
)
223+
self.assertEqual(
224+
info["w_oss"],
225+
["ubuntu-latest@x86", "ubuntu-latest@x86_64"],
226+
f"Workflow OSs: '{info}' does not match with expected"
227+
)
228+
self.assertEqual(
229+
info["w_jobs"],
230+
1,
231+
f"Jobs count in workflow: '{info}' does not match with expected"
232+
)
233+
self.assertEqual(
234+
info["w_steps"],
235+
4,
236+
f"Steps count in workflow: '{info}' does not match with expected"
237+
)

0 commit comments

Comments
 (0)