@@ -54,3 +54,41 @@ def test_post_issue_expect_failed_authentication(self):
5454 """Post an issue but receive a 401 error response"""
5555 with self .assertRaises (HTTPError ):
5656 self .jira .create_issue (fields = {"issuetype" : "fail" , "summary" : "authentication" , "project" : "project" })
57+
58+ def test_get_issue_property_keys (self ):
59+ """Can retrieve issue property keys"""
60+ resp = self .jira .get_issue_property_keys ("FOO-123" )
61+ self .assertEqual (resp ["keys" ][0 ]["key" ], "Bar1" )
62+ self .assertEqual (
63+ resp ["keys" ][0 ]["self" ], "https://sample.atlassian.net/rest/api/2/issue/FOO-123/properties/Bar1"
64+ )
65+
66+ def test_get_issue_property_keys_not_found (self ):
67+ with self .assertRaises (HTTPError ):
68+ self .jira .get_issue_property_keys ("BAR-11" )
69+
70+ def test_set_issue_property_create (self ):
71+ self .jira .set_issue_property ("FOO-123" , "Bar2New" , data = {"test.id" : "123456" , "test.mem" : "250M" })
72+
73+ def test_set_issue_property_update (self ):
74+ self .jira .set_issue_property ("FOO-123" , "Bar1" , data = {"test.id" : "123456" , "test.mem" : "250M" })
75+
76+ def test_get_issue_property (self ):
77+ resp = self .jira .get_issue_property ("FOO-123" , "Bar1" )
78+ self .assertEqual (resp ["value" ]["test.id" ], "123" )
79+ self .assertEqual (resp ["value" ]["test.time" ], "1m" )
80+
81+ def test_get_issue_property_not_found (self ):
82+ with self .assertRaises (HTTPError ):
83+ self .jira .get_issue_property ("FOO-123" , "NotFoundBar1" )
84+ with self .assertRaises (HTTPError ):
85+ self .jira .get_issue_property ("FOONotFound-123" , "NotFoundBar1" )
86+
87+ def test_delete_issue_property (self ):
88+ self .jira .delete_issue_property ("FOO-123" , "Bar1" )
89+
90+ def test_delete_issue_property_not_found (self ):
91+ with self .assertRaises (HTTPError ):
92+ self .jira .get_issue_property ("FOO-123" , "NotFoundBar1" )
93+ with self .assertRaises (HTTPError ):
94+ self .jira .get_issue_property ("FOONotFound-123" , "NotFoundBar1" )
0 commit comments