(load_fixture, responses, fixture_name, expected_label)
| 354 | PullRequestState.review.value), |
| 355 | ]) |
| 356 | def test_open_pull_request(load_fixture, responses, fixture_name, expected_label): |
| 357 | responses.add( |
| 358 | responses.GET, |
| 359 | github_url('/repositories/169101701/pulls/26'), |
| 360 | json=load_fixture('pull-request-26.json'), |
| 361 | status=200 |
| 362 | ) |
| 363 | responses.add( |
| 364 | responses.GET, |
| 365 | github_url('/repos/ursa-labs/ursabot/issues/26/labels'), |
| 366 | json=[], |
| 367 | status=200 |
| 368 | ) |
| 369 | responses.add( |
| 370 | responses.POST, |
| 371 | github_url( |
| 372 | '/repos/ursa-labs/ursabot/issues/26/labels' |
| 373 | ), |
| 374 | status=201 |
| 375 | ) |
| 376 | payload = load_fixture(fixture_name) |
| 377 | |
| 378 | bot = PullRequestWorkflowBot('pull_request_target', payload) |
| 379 | bot.handle() |
| 380 | |
| 381 | # Setting awaiting committer review or awaiting review label |
| 382 | post = responses.calls[-1] |
| 383 | assert json.loads(post.request.body) == [expected_label] |
| 384 | |
| 385 | |
| 386 | @pytest.mark.parametrize(('fixture_name', 'expected_label'), [ |
nothing calls this directly
no test coverage detected