예제 #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)
예제 #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
예제 #3
0
파일: test_config.py 프로젝트: zmyer/aurora
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)
예제 #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)
예제 #5
0
파일: test_config.py 프로젝트: zmyer/aurora
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
예제 #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