Example #1
0
def test_get_instance_config_unknown(mock_validate_service_instance, ):
    with raises(NotImplementedError):
        mock_validate_service_instance.return_value = 'some bogus unsupported framework'
        get_instance_config(
            service='fake_service',
            instance='fake_instance',
            cluster='fake_cluster',
            soa_dir='fake_soa_dir',
        )
        assert mock_validate_service_instance.call_count == 1
Example #2
0
def test_get_instance_config_unknown(
    mock_validate_service_instance,
):
    with raises(NotImplementedError):
        mock_validate_service_instance.return_value = 'some bogus unsupported framework'
        get_instance_config(
            service='fake_service',
            instance='fake_instance',
            cluster='fake_cluster',
            soa_dir='fake_soa_dir',
        )
        assert mock_validate_service_instance.call_count == 1
Example #3
0
def test_get_instance_Config_chronos(
    mock_load_chronos_job_config,
    mock_validate_service_instance,
):
    mock_validate_service_instance.return_value = 'chronos'
    mock_load_chronos_job_config.return_value = 'fake_service_config'
    actual = get_instance_config(
        service='fake_service',
        instance='fake_instance',
        cluster='fake_cluster',
        soa_dir='fake_soa_dir',
    )
    assert mock_validate_service_instance.call_count == 1
    assert mock_load_chronos_job_config.call_count == 1
    assert actual == 'fake_service_config'
Example #4
0
def test_get_instance_config_marathon(
    mock_load_marathon_service_config,
    mock_validate_service_instance,
):
    mock_validate_service_instance.return_value = 'marathon'
    mock_load_marathon_service_config.return_value = 'fake_service_config'
    actual = get_instance_config(
        service='fake_service',
        instance='fake_instance',
        cluster='fake_cluster',
        soa_dir='fake_soa_dir',
    )
    assert mock_validate_service_instance.call_count == 1
    assert mock_load_marathon_service_config.call_count == 1
    assert actual == 'fake_service_config'
Example #5
0
def test_get_instance_Config_chronos(
    mock_load_chronos_job_config,
    mock_validate_service_instance,
):
    mock_validate_service_instance.return_value = 'chronos'
    mock_load_chronos_job_config.return_value = 'fake_service_config'
    actual = get_instance_config(
        service='fake_service',
        instance='fake_instance',
        cluster='fake_cluster',
        soa_dir='fake_soa_dir',
    )
    assert mock_validate_service_instance.call_count == 1
    assert mock_load_chronos_job_config.call_count == 1
    assert actual == 'fake_service_config'
Example #6
0
def test_get_instance_config_marathon(
    mock_load_marathon_service_config,
    mock_validate_service_instance,
):
    mock_validate_service_instance.return_value = 'marathon'
    mock_load_marathon_service_config.return_value = 'fake_service_config'
    actual = get_instance_config(
        service='fake_service',
        instance='fake_instance',
        cluster='fake_cluster',
        soa_dir='fake_soa_dir',
    )
    assert mock_validate_service_instance.call_count == 1
    assert mock_load_marathon_service_config.call_count == 1
    assert actual == 'fake_service_config'