| |
@@ -16,7 +16,7 @@
|
| |
from testing.test_controllers import add_release, add_milestone, \
|
| |
add_bug, add_update
|
| |
from blockerbugs.controllers.api import errors
|
| |
- from blockerbugs.controllers.api.api import _get_bugtypes, _UNKNOWN_BUG_SVG_TEXT
|
| |
+ from blockerbugs.controllers.api.api import _get_bugtypes, _UNKNOWN_BUG_SVG_TEXT, _BUG_CLOSED
|
| |
|
| |
|
| |
class TestRestAPI(object):
|
| |
@@ -35,6 +35,7 @@
|
| |
'99-beta')
|
| |
bug1 = add_bug(9000, 'testbug1', cls.milestone)
|
| |
bug1.accepted_fe = True
|
| |
+ bug1.status = 'CLOSED'
|
| |
bug2 = add_bug(9002, 'testbug2', cls.milestone)
|
| |
bug2.accepted_blocker = False
|
| |
bug2.proposed_fe = True
|
| |
@@ -163,3 +164,19 @@
|
| |
|
| |
assert self.milestone.name not in data
|
| |
assert _UNKNOWN_BUG_SVG_TEXT in data
|
| |
+
|
| |
+ def test_get_bugimg_open_bug(self):
|
| |
+ url = '/api/v0/bugimg/9002'
|
| |
+ resp = self.client.get(url)
|
| |
+ assert resp.status_code == httplib.OK
|
| |
+ data = str(resp.data)
|
| |
+
|
| |
+ assert _BUG_CLOSED not in data
|
| |
+
|
| |
+ def test_get_bugimg_closed_bug(self):
|
| |
+ url = '/api/v0/bugimg/9000'
|
| |
+ resp = self.client.get(url)
|
| |
+ assert resp.status_code == httplib.OK
|
| |
+ data = str(resp.data)
|
| |
+
|
| |
+ assert _BUG_CLOSED in data
|
| |
If bug is closed, show this information in the svg image.
https://pagure.io/fedora-qa/blockerbugs/issue/116#comment-687478