Beispiel #1
0
 def test_feature_set_csv_converter(self):
     f1 = Feature('foo')
     f2 = Feature('bar')
     f_set = FeatureSet([f1, f2])
     d = f_set.to_dict()
     c = FeatureSetCsvConverter()
     # order doesn't matter, so need to check both orders:
     converted_input = c.convert('xyz', d, '', '')
     self.assertTrue(({
         'xyz': 'foo,bar'
     } == converted_input)
                     | ({
                         'xyz': 'bar,foo'
                     } == converted_input))
Beispiel #2
0
 def test_feature_set_list_converter(self):
     '''
     Tests that we get properly formatted JSON-compatible
     arrays (of strings in this case). Used when we need to
     supply a WDL job with a list of relevant samples as an
     array of strings, for instance.
     '''
     obs1 = Feature('foo')
     obs2 = Feature('bar')
     obs_set = FeatureSet([obs1, obs2])
     d = obs_set.to_dict()
     c = FeatureSetListConverter()
     # order doesn't matter, so need to check both orders:
     converted_input = c.convert('xyz', d, '', '')
     self.assertTrue(({
         'xyz': ['foo', 'bar']
     } == converted_input)
                     | ({
                         'xyz': ['bar', 'foo']
                     } == converted_input))