コード例 #1
0
 def __init__(self, omt_path):
     self.omt_path = omt_path
     self.omt_root = dirname(omt_path)
     self.omt = load_yaml(omt_path)
     if 'mep' in self.omt:
         self.mep_path = join(self.omt_root, self.omt['mep'])
         self.mep = load_yaml(self.mep_path)
     else:
         self.mep_path = None
         self.mep = None
コード例 #2
0
 def __init__(self, omt_path):
     self.omt_path = omt_path
     self.omt_root = dirname(omt_path)
     self.omt = load_yaml(omt_path)
     if 'mep' in self.omt:
         self.mep_path = join(self.omt_root, self.omt['mep'])
         self.mep = load_yaml(self.mep_path)
     else:
         self.mep_path = None
         self.mep = None
コード例 #3
0
def test_all():
    cwd = Path(getcwd())
    all_omts = [p.as_posix() for p in cwd.glob('**/*.omt')]
    th = TallyHolder()
    if environ.get('TRAVIS'):
        if not environ.get('OMV_ENGINE'):
            tallies = [parse_omt(t) for t in all_omts]
        else:
            engine = environ.get('OMV_ENGINE').lower()
            tallies = [parse_omt(t)
                       for t in all_omts
                       if load_yaml(t)['engine'].lower() == engine]
    else:
        tallies = [parse_omt(t) for t in all_omts]
        
    for t in tallies:
        th.add(t)

    results = [t.all_passed() for t in tallies]
    inform('')
    inform("%i test(s) run" % len(tallies),
           overline='-', underline='-', center=True)
    inform('')
    if all(results):
        inform("All tests passing!", underline='=', center=True)
    else:
        failed = [trim_path(t.omt) for t in tallies if not t.all_passed()]
        inform("Some test(s) failed: ",  failed, underline='=')
    
    if is_verbose():
        print('\n'+th.summary()+'\n')

    assert all(results)