def setUp(self):
   super().setUp()
   self.ontology = '../../ontology/yaml/resources'
   self.solution = 'tests/samples/solution/building_config_example.yaml'
   self.proposed = 'tests/samples/proposed/building_config_example.yaml'
   self.parse = parse_config.ParseConfig(ontology=self.ontology,
                                         solution=self.solution,
                                         proposed=self.proposed)
 def setUp(self):
     super().setUp()
     ontolgy = '../../ontology/yaml/resources'
     proposed = 'tests/samples/proposed/real_world_proposed.yaml'
     solution = 'tests/samples/solution/real_world_solution.yaml'
     # This circumvents the CLI but it is much more
     # straightforward than invoking via a subprocess
     scorer = parse_config.ParseConfig(ontology=ontolgy,
                                       proposed=proposed,
                                       solution=solution)
     self.output = scorer.execute()
Beispiel #3
0
        '-prop',
        '--proposed',
        dest='proposed',
        required=True,
        help=
        'Absolute path for your proposed configuration file (to be scored)',
        metavar='proposed')

    parser.add_argument(
        '-v',
        '--verbose',
        dest='verbose',
        required=False,
        default=False,
        # Defining booleans in argparse is not intuitive!
        type=lambda x: (str(x).lower() in ['true', '1', 'yes']),
        help='Output additional details about the scoring process',
        metavar='verbose')

    return parser


if __name__ == '__main__':
    pp = pprint.PrettyPrinter()
    args = parse_args().parse_args(sys.argv[1:])  # pylint: disable=too-many-function-args
    scorer = parse_config.ParseConfig(ontology=args.ontology,
                                      solution=args.solution,
                                      proposed=args.proposed,
                                      verbose=args.verbose)
    pp.pprint(scorer.execute())