Example #1
0
def test_get_cluster_no_dashboards():
    with mock.patch('paasta_tools.cli.cmds.metastatus.load_system_paasta_config',
                    autospec=True) as mock_load_system_paasta_config:
        mock_load_system_paasta_config.return_value = SystemPaastaConfig(
            {}, 'fake_directory')
        output_text = metastatus.get_cluster_dashboards('fake_cluster')
        assert 'No dashboards configured' in output_text
def test_get_cluster_dashboards():
    output_text = metastatus.get_cluster_dashboards('fake-cluster')
    assert 'http://paasta-fake-cluster.yelp:5050' in output_text
    assert 'http://paasta-fake-cluster.yelp:5052' in output_text
    assert 'http://paasta-fake-cluster.yelp:5053' in output_text
    assert 'http://paasta-fake-cluster.yelp:%s' % DEFAULT_SYNAPSE_PORT in output_text
    assert 'http://chronos.paasta-fake-cluster.yelp/' in output_text
    assert 'http://mesos.paasta-fake-cluster.yelp/' in output_text
    assert 'http://marathon.paasta-fake-cluster.yelp/' in output_text
Example #3
0
def test_get_cluster_dashboards_unknown_cluster():
    with mock.patch('paasta_tools.cli.cmds.metastatus.load_system_paasta_config',
                    autospec=True) as mock_load_system_paasta_config:
        mock_load_system_paasta_config.return_value = SystemPaastaConfig({
            'dashboard_links': {
                'another_fake_cluster': {
                    'URL': 'http://paasta-fake_cluster.yelp:5050',
                },
            },
        }, 'fake_directory')
        output_text = metastatus.get_cluster_dashboards('fake_cluster')
        assert 'No dashboards configured for fake_cluster' in output_text