コード例 #1
0
    def setUp(self):
        self.clients = DotDict()

        self.rr = Mock()
        self.RR2 = EnhancedResourceRegistryClient(self.rr)

        self.clients.resource_registry = self.rr

        self.policy = ResourceLCSPolicy(self.clients)
コード例 #2
0
class TestResourceLCSPolicy(PyonTestCase):
    def setUp(self):
        self.clients = DotDict()

        self.rr = Mock()
        self.RR2 = EnhancedResourceRegistryClient(self.rr)

        self.clients.resource_registry = self.rr

        self.policy = ResourceLCSPolicy(self.clients)

    def test_events(self):
        self.rr.read.return_value = Mock()

        #if True: self.fail("%s" % LCE.keys())
        for event in LCE.values():
            self.rr.reset_mock()
            success, msg = self.policy.check_lcs_precondition_satisfied(
                "rsrc_id", event)
            self.assertTrue(success)
            self.assertEqual("ResourceLCSPolicy base class not overridden!",
                             msg)
コード例 #3
0
class TestResourceLCSPolicy(PyonTestCase):

    def setUp(self):
        self.clients = DotDict()

        self.rr = Mock()
        self.RR2 = EnhancedResourceRegistryClient(self.rr)

        self.clients.resource_registry = self.rr

        self.policy = ResourceLCSPolicy(self.clients)



    def test_events(self):
        self.rr.read.return_value = "this is a resource"

        #if True: self.fail("%s" % LCE.keys())
        for event in LCE.values():
            self.rr.reset_mock()
            success, msg = self.policy.check_lcs_precondition_satisfied("rsrc_id", event)
            self.assertTrue(success)
            self.assertEqual("ResourceLCSPolicy base class not overridden!", msg)