示例#1
0
 def instance_specs(specs):
     from bootstrapping_olympics import get_conftools_nuisances
     library = get_conftools_nuisances()
     inuis = lambda x: library.instance_smarter(x)[1] 
     nuisances = map(inuis, specs)
     if len(nuisances) == 1:
         return nuisances[0]
     else:
         return Chain(nuisances)
from bootstrapping_olympics import (get_conftools_agents, get_conftools_robots,
    get_conftools_nuisances, get_conftools_nuisances_causal)
from comptests import comptests_for_all_pairs, comptests_for_all


library_agents = get_conftools_agents()
library_robots = get_conftools_robots()
library_nuisances = get_conftools_nuisances()
library_nuisances_causal = get_conftools_nuisances_causal()

for_all_robots = comptests_for_all(library_robots)
for_all_agents = comptests_for_all(library_agents)
for_all_nuisances = comptests_for_all(library_nuisances)
for_all_nuisances_causal = comptests_for_all(library_nuisances_causal)

for_all_pairs = comptests_for_all_pairs(library_agents, library_robots)
for_all_robot_nuisance_pairs = comptests_for_all_pairs(library_robots, library_nuisances)



# 
# # XXX: this is not used yet
# def wrap_with_desc(function, arguments,
#                    agent=None, robot=None, nuisance=None):
#     ''' Calls function with arguments, and writes debug information
#         if an exception is detected. '''
# 
#     try:
#         function(*arguments)
#     except:
#         msg = ('Error detected when running test (%s); '