def test_get_zookeeper_topology(): m = mock.mock_open() with contextlib.nested( mock.patch('synapse_tools.configure_synapse.open', m, create=True), mock.patch('yaml.load', return_value=[['foo', 42]])): zk_topology = configure_synapse.get_zookeeper_topology() assert zk_topology == ['foo:42'] m.assert_called_with('/nail/etc/zookeeper_discovery/infrastructure/local.yaml')
def test_get_zookeeper_topology(): m = mock.mock_open() with contextlib.nested( mock.patch('synapse_tools.configure_synapse.open', m, create=True), mock.patch('yaml.load', return_value=[['foo', 42]])): zk_topology = configure_synapse.get_zookeeper_topology( '/path/to/fake/file') assert zk_topology == ['foo:42'] m.assert_called_with('/path/to/fake/file')
def test_get_zookeeper_topology(): m = mock.mock_open() with contextlib.nested( mock.patch('synapse_tools.configure_synapse.open', m, create=True), mock.patch('yaml.load', return_value=[['foo', 42]])): zk_topology = configure_synapse.get_zookeeper_topology() assert zk_topology == ['foo:42'] m.assert_called_with( '/nail/etc/zookeeper_discovery/infrastructure/local.yaml')