|
| 1 | +# |
| 2 | +# Copyright Red Hat, Inc. 2012 |
| 3 | +# |
| 4 | +# This work is licensed under the GNU GPLv2 or later. |
| 5 | +# See the COPYING file in the top-level directory. |
| 6 | +# |
| 7 | + |
| 8 | +""" |
| 9 | +Test miscellaneous API bits |
| 10 | +""" |
| 11 | + |
| 12 | +import tests |
| 13 | +import tests.mockbackend |
| 14 | + |
| 15 | + |
| 16 | +def test_externalbugs(): |
| 17 | + # Basic API testing of the ExternalBugs wrappers |
| 18 | + fakebz = tests.mockbackend.make_bz( |
| 19 | + externalbugs_add_args="data/mockargs/test_externalbugs_add.txt", |
| 20 | + externalbugs_add_return={}, |
| 21 | + externalbugs_update_args="data/mockargs/test_externalbugs_update.txt", |
| 22 | + externalbugs_update_return={}, |
| 23 | + externalbugs_remove_args="data/mockargs/test_externalbugs_remove.txt", |
| 24 | + externalbugs_remove_return={}) |
| 25 | + |
| 26 | + fakebz.add_external_tracker( |
| 27 | + bug_ids=[1234, 5678], |
| 28 | + ext_bz_bug_id="externalid", |
| 29 | + ext_type_id="launchpad", |
| 30 | + ext_type_description="some-bug-add-description", |
| 31 | + ext_type_url="https://example.com/launchpad/1234", |
| 32 | + ext_status="CLOSED", |
| 33 | + ext_description="link to launchpad", |
| 34 | + ext_priority="bigly") |
| 35 | + |
| 36 | + fakebz.update_external_tracker( |
| 37 | + ids=["external1", "external2"], |
| 38 | + ext_bz_bug_id="externalid-update", |
| 39 | + ext_type_id="mozilla", |
| 40 | + ext_type_description="some-bug-update", |
| 41 | + ext_type_url="https://mozilla.foo/bar/5678", |
| 42 | + ext_status="OPEN", |
| 43 | + bug_ids=["some", "bug", "id"], |
| 44 | + ext_description="link to mozilla", |
| 45 | + ext_priority="like, really bigly") |
| 46 | + |
| 47 | + fakebz.remove_external_tracker( |
| 48 | + ids="remove1", |
| 49 | + ext_bz_bug_id="99999", |
| 50 | + ext_type_id="footype", |
| 51 | + ext_type_description="foo-desc", |
| 52 | + ext_type_url="foo-url", |
| 53 | + bug_ids="blah") |
0 commit comments