Beispiel #1
0
 def _assertIsCompatibleWith(self, tfReq, reqList):
     for start in [None, []]:
         for end in [None, []]:
             for val in [None, []]:
                 for strand in [None, []]:
                     for id, edges, weights in [(None, None, None), ([], None, None), ([], [], None), ([], [], [])]:
                         for extra in [None, {"a": [], "b": []}]:
                             if [] in [start, end, val]:
                                 tf = TrackFormat(start, end, val, strand, id, edges, weights, extra)
                                 propList = [
                                     tf.isDense(),
                                     tf.isValued(),
                                     tf.isInterval(),
                                     tf.isLinked(),
                                     tf.hasStrand(),
                                     tf.hasId(),
                                     tf.isWeighted(),
                                     tf.hasExtra(),
                                     tf.getValTypeName() if tf.getValTypeName() != "" else False,
                                     tf.getWeightTypeName() if tf.getWeightTypeName() != "" else False,
                                     tf.getExtraNames() if tf.getExtraNames() != [] else False,
                                 ]
                                 isCompatible = not False in [
                                     (r == None or r == p) for r, p in zip(reqList, propList)
                                 ]
                                 self.assertEqual(isCompatible, tfReq.isCompatibleWith(tf))
Beispiel #2
0
 def _assertIsCompatibleWith(self, tfReq, reqList):
     for start in [None, []]:
         for end in [None, []]:
             for val in [None, []]:
                 for strand in [None, []]:
                     for id, edges, weights in [(None, None, None),
                                                ([], None, None),
                                                ([], [], None),
                                                ([], [], [])]:
                         for extra in [None, {'a': [], 'b': []}]:
                             if [] in [start, end, val]:
                                 tf = TrackFormat(start, end, val, strand,
                                                  id, edges, weights, extra)
                                 propList = [tf.isDense(), tf.isValued(), tf.isInterval(), tf.isLinked(), tf.hasStrand(), tf.hasId(), tf.isWeighted(), tf.hasExtra(), \
                                             tf.getValTypeName() if tf.getValTypeName() != '' else False, \
                                             tf.getWeightTypeName() if tf.getWeightTypeName() != '' else False, \
                                             tf.getExtraNames() if tf.getExtraNames() != [] else False]
                                 isCompatible = (not False in [
                                     (r == None or r == p)
                                     for r, p in zip(reqList, propList)
                                 ])
                                 self.assertEqual(
                                     isCompatible,
                                     tfReq.isCompatibleWith(tf))