~niedbalski/charms/trusty/quantum-gateway/lp-1366598

« back to all changes in this revision

Viewing changes to unit_tests/test_quantum_contexts.py

  • Committer: james.page at ubuntu
  • Date: 2014-09-30 14:47:53 UTC
  • mfrom: (66.1.1 neutron-gateway)
  • Revision ID: james.page@ubuntu.com-20140930144753-tajzqejai3fz8efu
[gnuoy,r=james-page] Add new relation to neutron-api for passing common neutron configuration from a central location - starting with l2population.

Show diffs side-by-side

added added

removed removed

Lines of Context:
353
353
        self.config.return_value = 'ovs'
354
354
        self.assertEquals(quantum_contexts.core_plugin(),
355
355
                          quantum_contexts.NEUTRON_ML2_PLUGIN)
 
356
 
 
357
    def test_neutron_api_settings(self):
 
358
        self.relation_ids.return_value = ['foo']
 
359
        self.related_units.return_value = ['bar']
 
360
        self.test_relation.set({'l2-population': True})
 
361
        self.relation_get.side_effect = self.test_relation.get
 
362
        self.assertEquals(quantum_contexts._neutron_api_settings(),
 
363
                          {'l2_population': True})
 
364
 
 
365
    def test_neutron_api_settings2(self):
 
366
        self.relation_ids.return_value = ['foo']
 
367
        self.related_units.return_value = ['bar']
 
368
        self.test_relation.set({'l2-population': False})
 
369
        self.relation_get.side_effect = self.test_relation.get
 
370
        self.assertEquals(quantum_contexts._neutron_api_settings(),
 
371
                          {'l2_population': False})
 
372
 
 
373
    def test_neutron_api_settings_no_apiplugin(self):
 
374
        self.relation_ids.return_value = []
 
375
        self.assertEquals(quantum_contexts._neutron_api_settings(),
 
376
                          {'l2_population': True})