def test_load_system_paasta_config(): json_load_return_value = {'foo': 'bar'} expected = utils.SystemPaastaConfig(json_load_return_value, '/some/fake/dir') file_mock = mock.MagicMock(spec=file) with contextlib.nested( mock.patch('os.path.isdir', return_value=True), mock.patch('os.access', return_value=True), mock.patch('paasta_tools.utils.open', create=True, return_value=file_mock), mock.patch('paasta_tools.utils.get_readable_files_in_glob', autospec=True, return_value=['/some/fake/dir/some_file.json']), mock.patch('paasta_tools.utils.json.load', autospec=True, return_value=json_load_return_value) ) as ( os_is_dir_patch, os_access_patch, open_file_patch, mock_get_readable_files_in_glob, json_patch, ): actual = utils.load_system_paasta_config() assert actual == expected # Kinda weird but without this load_system_paasta_config() can (and # did! during development) return a plain dict without the test # complaining. assert actual.__class__ == expected.__class__ open_file_patch.assert_any_call('/some/fake/dir/some_file.json') json_patch.assert_any_call(file_mock.__enter__()) assert json_patch.call_count == 1
def system_paasta_config(): return utils.SystemPaastaConfig( { "docker_registry": "fake", "volumes": [], "dockercfg_location": "/foo/bar", }, "/fake/system/configs")
def test_SystemPaastaConfig_get_registry(): fake_config = utils.SystemPaastaConfig({ 'docker_registry': 'fake_registry' }, '/some/fake/dir') expected = 'fake_registry' actual = fake_config.get_docker_registry() assert actual == expected
def test_SystemPaastaConfig_get_zk(): fake_config = utils.SystemPaastaConfig({ 'zookeeper': 'zk://fake_zookeeper_host' }, '/some/fake/dir') expected = 'fake_zookeeper_host' actual = fake_config.get_zk_hosts() assert actual == expected
def test_report_status_obeys_cluster_whitelist( mock_stdout, mock_report_invalid_whitelist_values, mock_report_status_for_cluster, ): service = 'fake_service' cluster_whitelist = ['cluster1'] instance_whitelist = [] deploy_pipeline = actual_deployments = [ 'cluster1.main', 'cluster2.main', 'cluster3.main' ] fake_system_paasta_config = utils.SystemPaastaConfig({}, '/fake/config') report_status( service=service, deploy_pipeline=deploy_pipeline, actual_deployments=actual_deployments, cluster_whitelist=cluster_whitelist, instance_whitelist=instance_whitelist, system_paasta_config=fake_system_paasta_config, ) mock_report_invalid_whitelist_values.assert_called_once_with( cluster_whitelist, ['cluster1', 'cluster2', 'cluster3'], 'cluster') mock_report_status_for_cluster.assert_called_once_with( service=service, cluster='cluster1', deploy_pipeline=deploy_pipeline, actual_deployments=actual_deployments, instance_whitelist=instance_whitelist, system_paasta_config=fake_system_paasta_config, verbose=0)
def test_report_status_for_cluster_displays_multiple_lines_from_execute_paasta_serviceinit_on_remote_master( mock_stdout, mock_report_invalid_whitelist_values, mock_execute_paasta_serviceinit_on_remote_master, ): # paasta_status with no args displays deploy info - vanilla case service = 'fake_service' planned_deployments = ['cluster.instance'] actual_deployments = {'cluster.instance': 'this_is_a_sha'} instance_whitelist = [] fake_system_paasta_config = utils.SystemPaastaConfig({}, '/fake/config') fake_status = 'status: SOMETHING FAKE\nand then something fake\non another line!\n\n\n' mock_execute_paasta_serviceinit_on_remote_master.return_value = fake_status expected_output = (" status: SOMETHING FAKE\n" " and then something fake\n" " on another line!\n") status.report_status_for_cluster( service=service, cluster='cluster', deploy_pipeline=planned_deployments, actual_deployments=actual_deployments, instance_whitelist=instance_whitelist, system_paasta_config=fake_system_paasta_config, ) output = mock_stdout.getvalue() assert expected_output in output
def test_report_status_for_cluster_obeys_instance_whitelist( mock_stdout, mock_report_invalid_whitelist_values, mock_execute_paasta_serviceinit_on_remote_master, ): service = 'fake_service' planned_deployments = [ 'fake_cluster.fake_instance_a', 'fake_cluster.fake_instance_b' ] actual_deployments = { 'fake_cluster.fake_instance_a': 'sha', 'fake_cluster.fake_instance_b': 'sha', } instance_whitelist = ['fake_instance_a'] fake_system_paasta_config = utils.SystemPaastaConfig({}, '/fake/config') status.report_status_for_cluster( service=service, cluster='fake_cluster', deploy_pipeline=planned_deployments, actual_deployments=actual_deployments, instance_whitelist=instance_whitelist, system_paasta_config=fake_system_paasta_config, ) mock_execute_paasta_serviceinit_on_remote_master.assert_called_once_with( 'status', 'fake_cluster', 'fake_service', 'fake_instance_a', fake_system_paasta_config, stream=True, verbose=0, ignore_ssh_output=True)
def test_report_status_for_cluster_displays_deployed_service( mock_stdout, mock_report_invalid_whitelist_values, mock_execute_paasta_serviceinit_on_remote_master, ): # paasta_status with no args displays deploy info - vanilla case service = 'fake_service' planned_deployments = ['fake_cluster.fake_instance'] actual_deployments = {'fake_cluster.fake_instance': 'sha'} instance_whitelist = [] fake_system_paasta_config = utils.SystemPaastaConfig({}, '/fake/config') fake_status = 'status: SOMETHING FAKE' mock_execute_paasta_serviceinit_on_remote_master.return_value = fake_status expected_output = ("\n" "cluster: fake_cluster\n" " %s\n" % (fake_status)) status.report_status_for_cluster( service=service, cluster='fake_cluster', deploy_pipeline=planned_deployments, actual_deployments=actual_deployments, instance_whitelist=instance_whitelist, system_paasta_config=fake_system_paasta_config, ) output = mock_stdout.getvalue() assert expected_output in output mock_execute_paasta_serviceinit_on_remote_master.assert_called_once_with( 'status', 'fake_cluster', 'fake_service', 'fake_instance', fake_system_paasta_config, stream=True, verbose=0)
def setup_system_paasta_config(): marathon_connection_string = _get_marathon_connection_string() zk_connection_string = _get_zookeeper_connection_string( 'mesos-testcluster') chronos_connection_string = _get_chronos_connection_string() system_paasta_config = utils.SystemPaastaConfig( { 'cluster': 'testcluster', 'deployd_log_level': 'DEBUG', 'docker_volumes': [], 'docker_registry': 'docker-dev.yelpcorp.com', 'zookeeper': zk_connection_string, 'synapse_port': 3212, 'marathon_config': { 'url': marathon_connection_string, 'user': None, 'password': None, }, 'chronos_config': { 'user': None, 'password': None, 'url': [chronos_connection_string], }, }, '/some_fake_path_to_config_dir/') return system_paasta_config
def test_report_status_returns_one_when_clusters_pass( mock_report_invalid_whitelist_values, mock_report_status_for_cluster, capfd, ): service = 'fake_service' cluster_whitelist = [] instance_whitelist = [] deploy_pipeline = actual_deployments = [ 'cluster1.main', 'cluster2.main', 'cluster3.main' ] fake_system_paasta_config = utils.SystemPaastaConfig({}, '/fake/config') mock_report_status_for_cluster.side_effect = [0, 0, 255] return_value = report_status( service=service, deploy_pipeline=deploy_pipeline, actual_deployments=actual_deployments, cluster_whitelist=cluster_whitelist, instance_whitelist=instance_whitelist, system_paasta_config=fake_system_paasta_config, ) assert return_value == 1 assert mock_report_status_for_cluster.call_count == 3
def test_load_system_paasta_config_merge_lexographically(): fake_file_a = {'foo': 'this value will be overriden', 'fake': 'fake_data'} fake_file_b = {'foo': 'overriding value'} expected = utils.SystemPaastaConfig( { 'foo': 'overriding value', 'fake': 'fake_data' }, '/some/fake/dir') file_mock = mock.MagicMock(spec=file) with contextlib.nested( mock.patch('os.path.isdir', return_value=True), mock.patch('os.access', return_value=True), mock.patch('paasta_tools.utils.open', create=True, return_value=file_mock), mock.patch('paasta_tools.utils.get_readable_files_in_glob', autospec=True, return_value=['a', 'b']), mock.patch('paasta_tools.utils.json.load', autospec=True, side_effect=[fake_file_a, fake_file_b])) as ( os_is_dir_patch, os_access_patch, open_file_patch, mock_get_readable_files_in_glob, json_patch, ): actual = utils.load_system_paasta_config() assert actual == expected
def test_status_pending_pipeline_build_message( mock_get_actual_deployments, mock_get_deploy_info, mock_figure_out_service_name, mock_load_system_paasta_config, capfd, ): # If deployments.json is missing SERVICE, output the appropriate message service = 'fake_service' mock_figure_out_service_name.return_value = service pipeline = [{'instancename': 'cluster.instance'}] mock_get_deploy_info.return_value = {'pipeline': pipeline} fake_system_paasta_config = utils.SystemPaastaConfig({}, '/fake/config') mock_load_system_paasta_config.return_value = fake_system_paasta_config actual_deployments = {} mock_get_actual_deployments.return_value = actual_deployments expected_output = missing_deployments_message(service) args = MagicMock() args.service = service args.deploy_group = None paasta_status(args) output, _ = capfd.readouterr() assert expected_output in output
def test_SystemPaastaConfig_get_volumes(): fake_config = utils.SystemPaastaConfig({ 'volumes': [{'fake_path': "fake_other_path"}], }, '/some/fake/dir') expected = [{'fake_path': "fake_other_path"}] actual = fake_config.get_volumes() assert actual == expected
def test_SystemPaastaConfig_get_cluster(): fake_config = utils.SystemPaastaConfig({ 'cluster': 'peanut', }, '/some/fake/dir') expected = 'peanut' actual = fake_config.get_cluster() assert actual == expected
def test_status_calls_sergeants( mock_report_status, mock_get_planned_deployments, mock_get_actual_deployments, mock_figure_out_service_name, mock_load_system_paasta_config, mock_list_services, mock_get_instance_configs_for_service, capfd, ): service = 'fake_service' cluster = 'fake_cluster' mock_figure_out_service_name.return_value = service mock_list_services.return_value = [service] mock_instance_config = make_fake_instance_conf(cluster, service, 'fi') mock_instance_config.get_service.return_value = service mock_instance_config.get_cluster.return_value = cluster mock_get_instance_configs_for_service.return_value = [mock_instance_config] planned_deployments = [ 'cluster1.instance1', 'cluster1.instance2', 'cluster2.instance1', ] mock_get_planned_deployments.return_value = planned_deployments actual_deployments = { 'fake_service:paasta-cluster.instance': 'this_is_a_sha', } mock_get_actual_deployments.return_value = actual_deployments fake_system_paasta_config = utils.SystemPaastaConfig({}, '/fake/config') mock_load_system_paasta_config.return_value = fake_system_paasta_config mock_report_status.return_value = 1776 args = MagicMock() args.service = service args.clusters = None args.instances = None args.verbose = False args.owner = None args.deploy_group = None args.soa_dir = '/fake/soa/dir' return_value = paasta_status(args) assert return_value == 1776 mock_get_actual_deployments.assert_called_once_with( service, '/fake/soa/dir') mock_report_status.assert_called_once_with( service=service, deploy_pipeline=planned_deployments, actual_deployments=actual_deployments, cluster=cluster, instance_whitelist={'fi'}, system_paasta_config=fake_system_paasta_config, verbose=False, use_api_endpoint=False, )
def system_paasta_config(): return utils.SystemPaastaConfig( { "docker_registry": "fake", "volumes": [], }, "/fake/system/configs", )
def setup_system_paasta_config(): zk_connection_string = _get_zookeeper_connection_string( 'mesos-testcluster') chronos_connection_string = _get_chronos_connection_string() system_paasta_config = utils.SystemPaastaConfig( { 'cluster': 'testcluster', 'deployd_log_level': 'DEBUG', 'docker_volumes': [], 'docker_registry': 'docker-dev.yelpcorp.com', 'zookeeper': zk_connection_string, 'synapse_port': 3212, 'marathon_servers': [ # if you're updating this list, you should update # paasta_tools/yelp_package/dockerfiles/itest/api/marathon.json as well { 'url': _get_marathon_connection_string('marathon'), 'user': None, 'password': None, }, { 'url': _get_marathon_connection_string('marathon1'), 'user': None, 'password': None, }, { 'url': _get_marathon_connection_string('marathon2'), 'user': None, 'password': None, }, ], 'chronos_config': { 'user': None, 'password': None, 'url': [chronos_connection_string], }, 'dashboard_links': { 'testcluster': { 'Marathon RO': [ 'http://accessible-marathon', 'http://accessible-marathon1', 'http://accessible-marathon2', ], }, }, }, '/some_fake_path_to_config_dir/', ) return system_paasta_config
def test_report_status_handle_none_whitelist( mock_stdout, mock_report_invalid_whitelist_values, mock_report_status_for_cluster, ): service = 'fake_service' cluster_whitelist = [] instance_whitelist = [] deploy_pipeline = actual_deployments = [ 'cluster1.main', 'cluster2.main', 'cluster3.main'] fake_system_paasta_config = utils.SystemPaastaConfig({}, '/fake/config') report_status( service=service, deploy_pipeline=deploy_pipeline, actual_deployments=actual_deployments, cluster_whitelist=cluster_whitelist, instance_whitelist=instance_whitelist, system_paasta_config=fake_system_paasta_config, ) mock_report_status_for_cluster.assert_any_call( service=service, cluster='cluster1', deploy_pipeline=deploy_pipeline, actual_deployments=actual_deployments, instance_whitelist=instance_whitelist, system_paasta_config=fake_system_paasta_config, verbose=0, use_api_endpoint=False ) mock_report_status_for_cluster.assert_any_call( service=service, cluster='cluster2', deploy_pipeline=deploy_pipeline, actual_deployments=actual_deployments, instance_whitelist=instance_whitelist, system_paasta_config=fake_system_paasta_config, verbose=0, use_api_endpoint=False ) mock_report_status_for_cluster.assert_any_call( service=service, cluster='cluster3', deploy_pipeline=deploy_pipeline, actual_deployments=actual_deployments, instance_whitelist=instance_whitelist, system_paasta_config=fake_system_paasta_config, verbose=0, use_api_endpoint=False )
def setup_system_paasta_config(): zk_connection_string = _get_zookeeper_connection_string("mesos-testcluster") chronos_connection_string = _get_chronos_connection_string() system_paasta_config = utils.SystemPaastaConfig( { "cluster": "testcluster", "deployd_log_level": "DEBUG", "docker_volumes": [], "docker_registry": "docker-dev.yelpcorp.com", "zookeeper": zk_connection_string, "synapse_port": 3212, "marathon_servers": [ # if you're updating this list, you should update # paasta_tools/yelp_package/dockerfiles/itest/api/marathon.json as well { "url": _get_marathon_connection_string("marathon"), "user": None, "password": None, }, { "url": _get_marathon_connection_string("marathon1"), "user": None, "password": None, }, { "url": _get_marathon_connection_string("marathon2"), "user": None, "password": None, }, ], "chronos_config": { "user": None, "password": None, "url": [chronos_connection_string], }, "dashboard_links": { "testcluster": { "Marathon RO": [ "http://accessible-marathon", "http://accessible-marathon1", "http://accessible-marathon2", ] } }, }, "/some_fake_path_to_config_dir/", ) return system_paasta_config
def setup_marathon_client(): marathon_connection_string = _get_marathon_connection_string() zk_connection_string = _get_zookeeper_connection_string('mesos-testcluster') marathon_config = marathon_tools.MarathonConfig({ 'url': marathon_connection_string, 'user': None, 'password': None, }, '/some_fake_path_to_marathon.json') client = marathon_tools.get_marathon_client(marathon_config.get_url(), marathon_config.get_username(), marathon_config.get_password()) system_paasta_config = utils.SystemPaastaConfig({ 'cluster': 'testcluster', 'docker_volumes': [], 'docker_registry': u'docker-dev.yelpcorp.com', 'zookeeper': zk_connection_string }, '/some_fake_path_to_config_dir/') return (client, marathon_config, system_paasta_config)
def test_status_calls_sergeants( mock_report_status, mock_get_planned_deployments, mock_get_actual_deployments, mock_figure_out_service_name, mock_load_system_paasta_config, capfd, ): service = 'fake_service' mock_figure_out_service_name.return_value = service planned_deployments = [ 'cluster1.instance1', 'cluster1.instance2', 'cluster2.instance1' ] mock_get_planned_deployments.return_value = planned_deployments actual_deployments = { 'fake_service:paasta-cluster.instance': 'this_is_a_sha' } mock_get_actual_deployments.return_value = actual_deployments fake_system_paasta_config = utils.SystemPaastaConfig({}, '/fake/config') mock_load_system_paasta_config.return_value = fake_system_paasta_config mock_report_status.return_value = sentinel.return_value args = MagicMock() args.service = service args.clusters = None args.instances = None args.verbose = False args.soa_dir = '/fake/soa/dir' return_value = paasta_status(args) assert return_value == sentinel.return_value mock_figure_out_service_name.assert_called_once_with(args, '/fake/soa/dir') mock_get_actual_deployments.assert_called_once_with( service, '/fake/soa/dir') mock_report_status.assert_called_once_with( service=service, deploy_pipeline=planned_deployments, actual_deployments=actual_deployments, cluster_whitelist=[], instance_whitelist=[], system_paasta_config=fake_system_paasta_config, verbose=0, use_api_endpoint=False)
def test_report_status_for_cluster_instance_sorts_in_deploy_order( mock_report_invalid_whitelist_values, mock_execute_paasta_serviceinit_on_remote_master, capfd, ): # paasta_status with no args displays deploy info service = 'fake_service' planned_deployments = [ 'fake_cluster.fake_instance_a', 'fake_cluster.fake_instance_b', ] actual_deployments = { 'fake_cluster.fake_instance_a': '533976a9', 'fake_cluster.fake_instance_b': '533976a9', } instance_whitelist = [] fake_system_paasta_config = utils.SystemPaastaConfig({}, '/fake/config') fake_status = 'status: SOMETHING FAKE' mock_execute_paasta_serviceinit_on_remote_master.return_value = ( sentinel.return_value, fake_status, ) expected_output = ("\n" "cluster: fake_cluster\n" " %s\n" % (fake_status)) status.report_status_for_cluster( service=service, cluster='fake_cluster', deploy_pipeline=planned_deployments, actual_deployments=actual_deployments, instance_whitelist=instance_whitelist, system_paasta_config=fake_system_paasta_config, ) output, _ = capfd.readouterr() assert expected_output in output mock_execute_paasta_serviceinit_on_remote_master.assert_called_once_with( 'status', 'fake_cluster', 'fake_service', 'fake_instance_a,fake_instance_b', fake_system_paasta_config, stream=True, verbose=0, ignore_ssh_output=True, )
def test_print_cluster_status_calls_execute_paasta_serviceinit_on_remote_master( mock_report_invalid_whitelist_values, mock_execute_paasta_serviceinit_on_remote_master, verbosity_level, capfd, ): service = 'fake_service' planned_deployments = [ 'a_cluster.a_instance', 'a_cluster.b_instance', ] actual_deployments = { 'a_cluster.a_instance': 'this_is_a_sha', } instance_whitelist = [] fake_system_paasta_config = utils.SystemPaastaConfig({}, '/fake/config') fake_output = "Marathon: 5 instances" mock_execute_paasta_serviceinit_on_remote_master.return_value = ( sentinel.return_value, fake_output, ) expected_output = " %s\n" % fake_output status.report_status_for_cluster( service=service, cluster='a_cluster', deploy_pipeline=planned_deployments, actual_deployments=actual_deployments, instance_whitelist=instance_whitelist, system_paasta_config=fake_system_paasta_config, verbose=verbosity_level, ) assert mock_execute_paasta_serviceinit_on_remote_master.call_count == 1 mock_execute_paasta_serviceinit_on_remote_master.assert_any_call( 'status', 'a_cluster', service, 'a_instance', fake_system_paasta_config, stream=True, verbose=verbosity_level, ignore_ssh_output=True, ) output, _ = capfd.readouterr() assert expected_output in output
def test_status_with_owner( mock_report_status, mock_load_system_paasta_config, mock_get_actual_deployments, mock_figure_out_service_name, mock_list_services, mock_get_instance_configs_for_service, capfd, ): fake_system_paasta_config = utils.SystemPaastaConfig({}, '/fake/config') mock_load_system_paasta_config.return_value = fake_system_paasta_config mock_list_services.return_value = ['fakeservice', 'otherservice'] cluster = 'fake_cluster' mock_inst_1 = make_fake_instance_conf(cluster, 'fakeservice', 'instance1', team='faketeam') mock_inst_2 = make_fake_instance_conf(cluster, 'otherservice', 'instance3', team='faketeam') mock_get_instance_configs_for_service.return_value = [ mock_inst_1, mock_inst_2, ] mock_get_actual_deployments.return_value = { 'fakeservice.instance1': 'sha1', 'fakeservice.instance2': 'sha2', 'otherservice.instance3': 'sha3', 'otherservice.instance1': 'sha4', } mock_report_status.return_value = 0 args = MagicMock() args.service = None args.instances = None args.clusters = None args.deploy_group = None args.owner = 'faketeam' args.soa_dir = '/fake/soa/dir' return_value = paasta_status(args) assert return_value == 0 assert mock_report_status.call_count == 2
def test_print_cluster_status_missing_deploys_in_red( mock_stdout, mock_report_invalid_whitelist_values, mock_execute_paasta_serviceinit_on_remote_master, ): # paasta_status displays missing deploys in red service = 'fake_service' planned_deployments = [ 'a_cluster.a_instance', 'a_cluster.b_instance', ] actual_deployments = { 'a_cluster.a_instance': '533976a981679d586bed1cfb534fdba4b4e2c815', } instance_whitelist = [] fake_status = 'status: SOMETHING FAKE' fake_system_paasta_config = utils.SystemPaastaConfig({}, '/fake/config') mock_execute_paasta_serviceinit_on_remote_master.return_value = ( sentinel.return_value, fake_status, ) expected_output = ( "\n" "cluster: a_cluster\n" " instance: %s\n" " Git sha: None (not deployed yet)\n" " %s\n" % ( PaastaColors.red('b_instance'), fake_status, ) ) status.report_status_for_cluster( service=service, cluster='a_cluster', deploy_pipeline=planned_deployments, actual_deployments=actual_deployments, instance_whitelist=instance_whitelist, system_paasta_config=fake_system_paasta_config, ) output = mock_stdout.getvalue() assert expected_output in output
def test_report_status_calls_report_invalid_whitelist_values( mock_stdout, mock_report_invalid_whitelist_values, mock_execute_paasta_serviceinit_on_remote_master, ): service = 'fake_service' planned_deployments = ['cluster.instance1', 'cluster.instance2'] actual_deployments = {} instance_whitelist = [] fake_system_paasta_config = utils.SystemPaastaConfig({}, '/fake/config') status.report_status_for_cluster( service=service, cluster='cluster', deploy_pipeline=planned_deployments, actual_deployments=actual_deployments, instance_whitelist=instance_whitelist, system_paasta_config=fake_system_paasta_config, ) mock_report_invalid_whitelist_values.assert_called_once_with( instance_whitelist, ['instance1', 'instance2'], 'instance', )
def test_status_pending_pipeline_build_message( mock_get_actual_deployments, mock_get_deploy_info, mock_figure_out_service_name, mock_load_system_paasta_config, mock_list_services, mock_get_instance_configs_for_service, capfd, ): # If deployments.json is missing SERVICE, output the appropriate message service = 'fake_service' mock_figure_out_service_name.return_value = service mock_list_services.return_value = [service] pipeline = [{'instancename': 'cluster.instance'}] mock_get_deploy_info.return_value = {'pipeline': pipeline} fake_system_paasta_config = utils.SystemPaastaConfig({}, '/fake/config') mock_load_system_paasta_config.return_value = fake_system_paasta_config mock_instance_config = make_fake_instance_conf('cluster', service, 'instancename') mock_get_instance_configs_for_service.return_value = [mock_instance_config] actual_deployments = {} mock_get_actual_deployments.return_value = actual_deployments expected_output = missing_deployments_message(service) args = MagicMock() args.service = service args.deploy_group = None args.clusters = None args.instances = None args.owner = None args.soa_dir = utils.DEFAULT_SOA_DIR paasta_status(args) output, _ = capfd.readouterr() assert expected_output in output
def fake_system_paasta_config(self): return utils.SystemPaastaConfig({"synapse_port": 123456}, "/fake/configs")
def test_SystemPaastaConfig_get_registry_dne(): fake_config = utils.SystemPaastaConfig({}, '/some/fake/dir') with raises(utils.PaastaNotConfiguredError): fake_config.get_docker_registry()
def test_SystemPaastaConfig_get_zk_dne(): fake_config = utils.SystemPaastaConfig({}, '/some/fake/dir') with raises(utils.PaastaNotConfiguredError): fake_config.get_zk_hosts()