def test_bridge_g02(self): """ bridge_g02 """ bridge = { "br": [ { "name": "s0b1", "interface": [ "s0e2" ], "STP": True, "hello_time": 5, "max_message_age": 5, "forward_delay": 5 } ] } self.maxDiff = None e = ml_w_bridge.set(None, bridge) self.assertTrue(e[0], e[1]) f = open(os.path.join("running", "bridge.txt"), "r") e = f.readlines() f.close() if "json" == ml_system.CFG_TYPE: self.assertEqual(e, ['{"br": [{"STP": true, "name": "s0b1", "hello_time": 5, "interface": ["s0e2"], "max_message_age": 5, "forward_delay": 5}]}']) if "jcfg" == ml_system.CFG_TYPE: self.assertEqual(e, ['bridge {\n', ' br-array {\n', ' br { #1\n', ' name s0b1\n', ' interface-array {\n', ' interface s0e2 #1\n', ' }\n', ' hello_time 5\n', ' max_message_age 5\n', ' forward_delay 5\n', ' }\n', ' }\n', '}\n'])
def run(self): e = ml_w_bridge.set(None, bridge, threading.RLock())