Example #1
0
 def testLegendLabelNoQualifiers(self):
     """
     The legendLabel method must return a correct description for a feature
     that has no qualifiers.
     """
     location = FeatureLocation(100, 200)
     seqFeature = SeqFeature(location=location, type='site')
     feature = Feature(seqFeature)
     self.assertEqual('100-200 site.', feature.legendLabel())
Example #2
0
 def testLegendLabelNoQualifiers(self):
     """
     The legendLabel method must return a correct description for a feature
     that has no qualifiers.
     """
     location = FeatureLocation(100, 200)
     seqFeature = SeqFeature(location=location, type='site')
     feature = Feature(seqFeature)
     self.assertEqual('100-200 site.', feature.legendLabel())
Example #3
0
 def testLegendLabel(self):
     """
     The legendLabel method must return a description.
     """
     location = FeatureLocation(100, 200)
     qualifiers = {
         'note': ['Capsid protein'],
     }
     seqFeature = SeqFeature(location=location, type='site',
                             qualifiers=qualifiers)
     feature = Feature(seqFeature)
     self.assertEqual('100-200 site. note: Capsid protein',
                      feature.legendLabel())
 def testLegendLabel(self):
     """
     The legendLabel method must return a description.
     """
     location = FeatureLocation(100, 200)
     qualifiers = {
         'note': ['Capsid protein'],
     }
     seqFeature = SeqFeature(location=location, type='site',
                             qualifiers=qualifiers)
     feature = Feature(seqFeature)
     self.assertEqual('100-200 site. note: Capsid protein',
                      feature.legendLabel())
Example #5
0
 def testLegendLabelTruncatesValues(self):
     """
     The legendLabel method must return a description with qualifier
     values truncated to length 30 (including the trailing ...).
     """
     location = FeatureLocation(100, 200)
     qualifiers = {
         'note': ['x' * 40],
     }
     seqFeature = SeqFeature(location=location,
                             type='site',
                             qualifiers=qualifiers)
     feature = Feature(seqFeature)
     xs = 'x' * 27 + '...'
     self.assertEqual('100-200 site. note: %s' % xs, feature.legendLabel())
Example #6
0
 def testLegendLabelTruncatesValues(self):
     """
     The legendLabel method must return a description with qualifier
     values truncated to length 30 (including the trailing ...).
     """
     location = FeatureLocation(100, 200)
     qualifiers = {
         'note': ['x' * 40],
     }
     seqFeature = SeqFeature(location=location, type='site',
                             qualifiers=qualifiers)
     feature = Feature(seqFeature)
     xs = 'x' * 27 + '...'
     self.assertEqual('100-200 site. note: %s' % xs,
                      feature.legendLabel())