author David Douard <david.douard@logilab.fr>
Thu, 13 Nov 2014 14:47:40 +0100
changeset 1747 7a6574304c4c
parent 1746 4d9ae2462503
permissions -rw-r--r--
[apycotlib] the get_configuration view now returns only the configuration of the given entity for TestConfig or ProjectEnvironment

from apycotlib import atest, writer, ERROR

class apycot_environment(object):
    def __init__(self, plan):
        self.plan = plan

    def __enter__(self):
        w  = writer.TestDataWriter(self.plan.cnxh, self.plan.plandata['eid'])
        test = atest.Test(self.plan.plandata, w)
        self.test = test
        return test

    def __exit__(self, exc_type, exc_val, exc_tb):
        if exc_type is not None:
            self.test.global_status = ERROR