Beispiel #1
0
 def testFailsOnNonExistentLabel(self):
     try:
         tratihubis._LabelTransformations(self.repo,
                                          'type=defect: no_such_label')
         self.fail()
     except tratihubis._ConfigError, error:
         self.assertTrue('unknown label' in unicode(error))
Beispiel #2
0
 def testCanCreateMultipleTransformation(self):
     transformations = tratihubis._LabelTransformations(self.repo,
             'type=defect: bug, type=enhancement: enhancement, resolution=wontfix: wontfix')
     self.assertEqual(transformations._transformations, [
             ('type', 'defect', 'bug'),
             ('type', 'enhancement', 'enhancement'),
             ('resolution', 'wontfix', 'wontfix')
     ])
Beispiel #3
0
 def testCanCreateMultipleTransformation(self):
     transformations = tratihubis._LabelTransformations(
         self.repo,
         'type=defect: bug, type=enhancement: enhancement, resolution=wontfix: wontfix'
     )
     self.assertEqual(transformations._transformations,
                      [('type', 'defect', 'bug'),
                       ('type', 'enhancement', 'enhancement'),
                       ('resolution', 'wontfix', 'wontfix')])
Beispiel #4
0
 def testCanCreateTransformationWithQuotedValue(self):
     transformations = tratihubis._LabelTransformations(
         self.repo, 'type="software defect": bug')
     self.assertEqual(transformations._transformations,
                      [('type', 'software defect', 'bug')])
Beispiel #5
0
 def testCanCreateSingleTransformation(self):
     transformations = tratihubis._LabelTransformations(
         self.repo, 'type=defect: bug')
     self.assertEqual(transformations._transformations,
                      [('type', 'defect', 'bug')])
Beispiel #6
0
 def testFailsOnNonExistentLabel(self):
     try:
         tratihubis._LabelTransformations(self.repo, 'type=defect: no_such_label')
         self.fail()
     except tratihubis._ConfigError, error:
         self.assertTrue('unknown label' in unicode(error))
Beispiel #7
0
 def testCanCreateTransformationWithQuotedValue(self):
     transformations = tratihubis._LabelTransformations(self.repo, 'type="software defect": bug')
     self.assertEqual(transformations._transformations, [('type', 'software defect', 'bug')])
Beispiel #8
0
 def testCanCreateSingleTransformation(self):
     transformations = tratihubis._LabelTransformations(self.repo, 'type=defect: bug')
     self.assertEqual(transformations._transformations, [('type', 'defect', 'bug')])