Ejemplo n.º 1
0
def test_validate_deprecated_config_adds_warning_for_production():
  job = Job(name='hello_world', role='john_doe', cluster='test-cluster', environment='test',
    task=Task(name='main', processes=[Process(cmdline='echo {{_unbound_}}', name='eco')],
    resources=Resources(cpu=0.1, ram=64 * MB, disk=64 * MB)), production='true')
  with mock.patch('apache.aurora.client.config.deprecation_warning') as mock_warning:
    config._validate_deprecated_config(AuroraConfig(job))
    mock_warning.assert_called_once_with(PRODUCTION_DEPRECATED_WARNING)
Ejemplo n.º 2
0
def test_validate_deprecated_config_adds_no_warning_when_tier_is_set():
  job = Job(name='hello_world', role='john_doe', cluster='test-cluster', environment='test',
    task=Task(name='main', processes=[Process(cmdline='echo {{_unbound_}}', name='eco')],
    resources=Resources(cpu=0.1, ram=64 * MB, disk=64 * MB)),
  production='true', tier='preferred')
  with mock.patch('apache.aurora.client.config.deprecation_warning') as mock_warning:
    config._validate_deprecated_config(AuroraConfig(job))
    assert mock_warning.call_count == 0
Ejemplo n.º 3
0
def test_validate_deprecated_config_adds_warning_for_production():
    job = Job(name='hello_world',
              role='john_doe',
              cluster='test-cluster',
              environment='test',
              task=Task(name='main',
                        processes=[
                            Process(cmdline='echo {{_unbound_}}', name='eco')
                        ],
                        resources=Resources(cpu=0.1, ram=64 * MB,
                                            disk=64 * MB)),
              production='true')
    with mock.patch(
            'apache.aurora.client.config.deprecation_warning') as mock_warning:
        config._validate_deprecated_config(AuroraConfig(job))
        mock_warning.assert_called_once_with(PRODUCTION_DEPRECATED_WARNING)
Ejemplo n.º 4
0
def test_validate_deprecated_config_adds_warning_for_production():
    job = Job(
        name="hello_world",
        role="john_doe",
        cluster="test-cluster",
        environment="test",
        task=Task(
            name="main",
            processes=[Process(cmdline="echo {{_unbound_}}", name="eco")],
            resources=Resources(cpu=0.1, ram=64 * MB, disk=64 * MB),
        ),
        production="true",
    )
    with mock.patch("apache.aurora.client.config.deprecation_warning") as mock_warning:
        config._validate_deprecated_config(AuroraConfig(job))
        mock_warning.assert_called_once_with(PRODUCTION_DEPRECATED_WARNING)
Ejemplo n.º 5
0
def test_validate_deprecated_config_adds_no_warning_when_tier_is_set():
    job = Job(name='hello_world',
              role='john_doe',
              cluster='test-cluster',
              environment='test',
              task=Task(name='main',
                        processes=[
                            Process(cmdline='echo {{_unbound_}}', name='eco')
                        ],
                        resources=Resources(cpu=0.1, ram=64 * MB,
                                            disk=64 * MB)),
              production='true',
              tier='preferred')
    with mock.patch(
            'apache.aurora.client.config.deprecation_warning') as mock_warning:
        config._validate_deprecated_config(AuroraConfig(job))
        assert mock_warning.call_count == 0
Ejemplo n.º 6
0
def test_validate_deprecated_config_adds_no_warning_when_tier_is_set():
    job = Job(
        name="hello_world",
        role="john_doe",
        cluster="test-cluster",
        environment="test",
        task=Task(
            name="main",
            processes=[Process(cmdline="echo {{_unbound_}}", name="eco")],
            resources=Resources(cpu=0.1, ram=64 * MB, disk=64 * MB),
        ),
        production="true",
        tier="preferred",
    )
    with mock.patch("apache.aurora.client.config.deprecation_warning") as mock_warning:
        config._validate_deprecated_config(AuroraConfig(job))
        assert mock_warning.call_count == 0