Esempio n. 1
0
    def test_some_related_units(self):
        self.related_units.return_value = ['unit1']
        self.relation_ids.return_value = ['rid1']
        self.test_relation.set({'host': '11.11.11.11', 'port': '8080'})
        ctxt = context.MidonetContext()()
        expect = {'midonet_api_ip': '11.11.11.11', 'midonet_api_port': '8080'}

        self.assertEquals(expect, ctxt)
Esempio n. 2
0
    def test_midonet_no_related_units(self):
        self.related_units.return_value = []
        ctxt = context.MidonetContext()()
        expect = {}

        self.assertEquals(expect, ctxt)