def test_sections(self): sy=superyaml(domain=os.getcwd()) d_sy=sy.load('sections.syml',{'these':'some other'}) self.assertEqual(d_sy['these'],'some other') self.assertEqual(d_sy['this_color'],'red', 'this_color=red: got %s' % d_sy['this_color']) self.assertEqual(type(d_sy['section1']['flintstones']), type([]), "got a list for section1->flintstones") self.assertEqual(d_sy['section1']['flintstones'][0], 'fred', 'section1=fred: got %s' % d_sy['section1']['flintstones'][0])
def test_basic(self): sy=superyaml(domain=os.getcwd()) d={'this':'that', 'these':'those'} d_sy=sy.load('basic.syml',d) self.assertEqual(d['this'],'that') self.assertEqual(d['these'],'those')
def test_bowtie(self): sy = superyaml(domain="/proj/hoodlab/share/vcassen/rna-seq/rnaseq/templates") d_sy = sy.load("bowtie.syml", {}) warn(yaml.dump(d_sy)) d_sy = sy.load("bowtie.syml", d_sy) warn(yaml.dump(d_sy)) self.assertEquals(d_sy["exe"], "bowtie", 'got d[exe]=%s, expected "bowtie"' % d_sy["exe"])
def test_composite(self): sy=superyaml(domain='/proj/hoodlab/share/vcassen/rna-seq/rnaseq/templates') readset=sy.load('readset.syml',{}) bowtie=sy.load('bowtie.syml',readset) warn("bowtie 1",yaml.dump(bowtie)) self.assertEquals(bowtie['exe'],'bowtie','got d[exe]=%s, expected "bowtie"' % bowtie['exe']) bowtie.update(readset) bowtie=sy.load('bowtie.syml',bowtie) warn("bowtie 2",yaml.dump(bowtie)) expected=("%(exe)s %(ewbt)s %(args)s" % hashslice(bowtie,'exe','ewbt','args')) + " ${input} ${output}" warn("expected is %s" % expected) self.assertEquals(bowtie['usage'], expected, 'got bowtie[usage]=%s, expected %s' % (bowtie['usage'], expected))
from superyaml import * import yaml sy=superyaml({'config_file': 'linear.yml', }) sy.load() print "sy.config is %s" % yaml.dump(sy.config)
from superyaml import * import yaml sy=superyaml({'config_file': 'cyclic.yml', }) sy.load() # should throw an exception print "sy is %s" % yaml.dump(sy)
def test_internal_substitution(self): sy=superyaml(domain=os.getcwd()) d_sy=sy.load('internal_substitution.syml',{'these':'some other'}) self.assertEqual(d_sy['these'],'some other') self.assertEqual(d_sy['this_color'],'red', 'this_color=red: got %s' % d_sy['this_color'])
def test_basic_substitution(self): sy=superyaml(domain=os.getcwd()) d_sy=sy.load('basic_substitution.syml',{'these':'some other'}) self.assertEqual(d_sy['these'],'some other')
from superyaml import * import yaml sy=superyaml({'config_file': 'repeat.syml', }) sy.load() # should throw an exception print "sy.config is %s" % yaml.dump(sy.config)
from superyaml import * import yaml sy=superyaml({'config_file': 'simple.yml', }) sy.load() print "sy.config is %s" % yaml.dump(sy.config)