Пример #1
0
    def setUp(self):
        super(TestBenchmarkCli, self).setUp()
        for m in TO_PATCH:
            setattr(self, m, self._patch(m))
        self.fake_relation = FakeRelation(FAKE_RELATION)

        self.relation_get.side_effect = self.fake_relation.get
        self.relation_ids.side_effect = self.fake_relation.relation_ids
Пример #2
0
 def test_get_cert_from_relation_deprecated(self):
     self.config_get.return_value = None
     rel = FakeRelation(IDENTITY_OLD_STYLE_CERTS)
     self.relation_ids.side_effect = rel.relation_ids
     self.relation_list.side_effect = rel.relation_units
     self.relation_get.side_effect = rel.get
     result = apache_utils.get_cert()
     self.assertEquals(('keystone_provided_cert', 'keystone_provided_key'),
                       result)
Пример #3
0
 def setUp(self):
     super(UnisonHelperTests, self).setUp()
     for m in TO_PATCH:
         setattr(self, m, self._patch(m))
     self.fake_relation = FakeRelation(FAKE_RELATION)
     self.unit_private_ip.return_value = FAKE_LOCAL_UNIT
     self.relation_get.side_effect = self.fake_relation.get
     self.relation_ids.side_effect = self.fake_relation.relation_ids
     self.related_units.side_effect = self.fake_relation.related_units
Пример #4
0
    def setUp(self):
        super(TestBenchmark, self).setUp()
        for m in TO_PATCH:
            setattr(self, m, self._patch(m))
        self.fake_relation = FakeRelation(FAKE_RELATION)
        # self.hook_name.return_value = 'benchmark-relation-changed'

        self.relation_get.side_effect = self.fake_relation.get
        self.relation_ids.side_effect = self.fake_relation.relation_ids
Пример #5
0
 def setUp(self):
     super(TestPeerStorage, self).setUp()
     for m in TO_PATCH:
         setattr(self, m, self._patch(m))
     self.fake_relation_name = FAKE_RELATION_NAME
     self.fake_relation = FakeRelation(FAKE_RELATION)
     self.local_unit.return_value = FAKE_LOCAL_UNIT
     self.relation_get.return_value = {
         'key1': 'value1',
         'key2': 'value2',
         'private-address': '127.0.0.1',
         'public-address': '91.189.90.159'
     }