def test_more_sites(self): cfg = facade.Facade({ "local": { "role": DrRole.RECOVERY.value, }, "remote_sites": [ { "role": DrRole.PRIMARY.value, "nodes": [ { "name": "nodeA1" }, { "name": "nodeA2" }, ], }, { "role": DrRole.RECOVERY.value, "nodes": [ { "name": "nodeB1" }, { "name": "nodeB2" }, ], }, ], }) self.assertEqual( cfg.get_remote_site_list(), [ facade.DrSite(role=DrRole.PRIMARY, node_name_list=["nodeA1", "nodeA2"]), facade.DrSite(role=DrRole.RECOVERY, node_name_list=["nodeB1", "nodeB2"]), ], )
def test_no_nodes(self): cfg = facade.Facade({ "local": { "role": DrRole.PRIMARY.value, }, "remote_sites": [ { "role": DrRole.RECOVERY.value, "nodes": [], }, ], }) self.assertEqual(cfg.get_remote_site_list(), [ facade.DrSite(role=DrRole.RECOVERY, node_name_list=[]), ])