Example #1
0
 def test_failure(self):
     """Assert the method raises the correct exception no TPR is present."""
     bug_json = {'issue': {
         'custom_fields': [
             {'id': 1, 'value': 'foo'},
             {'id': 3, 'value': 'bar'},
             {'id': 9, 'value': 'biz'},
         ],
         'id': 1234,
     }}
     with self.assertRaises(exceptions.BugTPRMissingError):
         selectors._get_tpr(bug_json)
Example #2
0
 def test_success(self):
     """Assert the method returns the target platform release if present."""
     version_str = utils.uuid4()
     bug_json = {'issue': {'custom_fields': [
         {'id': 1, 'value': 'foo'},
         {'id': 4, 'value': version_str},
         {'id': 9, 'value': 'bar'},
     ]}}
     random.shuffle(bug_json['issue']['custom_fields'])
     self.assertEqual(selectors._get_tpr(bug_json), version_str)
 def test_failure(self):
     """Assert the method raises the correct exception no TPR is present."""
     bug_json = {
         'issue': {
             'custom_fields': [
                 {
                     'id': 1,
                     'value': 'foo'
                 },
                 {
                     'id': 3,
                     'value': 'bar'
                 },
                 {
                     'id': 9,
                     'value': 'biz'
                 },
             ],
             'id':
             1234,
         }
     }
     with self.assertRaises(exceptions.BugTPRMissingError):
         selectors._get_tpr(bug_json)
Example #4
0
 def test_failure(self):
     """Assert the method raises the correct exception no TPR is present."""
     bug_json = {
         "issue": {
             "custom_fields": [
                 {
                     "id": 1,
                     "value": "foo"
                 },
                 {
                     "id": 3,
                     "value": "bar"
                 },
                 {
                     "id": 9,
                     "value": "biz"
                 },
             ],
             "id":
             1234,
         }
     }
     with self.assertRaises(exceptions.BugTPRMissingError):
         selectors._get_tpr(bug_json)
 def test_success(self):
     """Assert the method returns the target platform release if present."""
     version_str = utils.uuid4()
     bug_json = {
         'issue': {
             'custom_fields': [
                 {
                     'id': 1,
                     'value': 'foo'
                 },
                 {
                     'id': 4,
                     'value': version_str
                 },
                 {
                     'id': 9,
                     'value': 'bar'
                 },
             ]
         }
     }
     random.shuffle(bug_json['issue']['custom_fields'])
     self.assertEqual(selectors._get_tpr(bug_json), version_str)
Example #6
0
 def test_success(self):
     """Assert the method returns the target platform release if present."""
     version_str = utils.uuid4()
     bug_json = {
         "issue": {
             "custom_fields": [
                 {
                     "id": 1,
                     "value": "foo"
                 },
                 {
                     "id": 4,
                     "value": version_str
                 },
                 {
                     "id": 9,
                     "value": "bar"
                 },
             ]
         }
     }
     random.shuffle(bug_json["issue"]["custom_fields"])
     self.assertEqual(selectors._get_tpr(bug_json), version_str)