Exemple #1
0
def test_load_dag_conf_uses_proper_crontab_str():
    source = 'test_source'
    good_crontab_str = '0 * * * *'
    dag_variables = {'test_source': {CRONTAB_STR: good_crontab_str}}
    script_location, dag_id, crontab_str = caw.load_dag_conf(
        source, dag_variables)
    assert crontab_str == good_crontab_str
Exemple #2
0
def test_load_dag_conf_returns_valid_script_location():
    source = 'test_source'
    expected_script_location = os.path.join(RESOURCES, 'FakeSource.py')
    dag_variables = {'test_source': {SCRIPT: expected_script_location}}
    script_location, dag_id, crontab_str = caw.load_dag_conf(
        source, dag_variables)
    assert script_location == expected_script_location
Exemple #3
0
def test_load_dag_conf_validates_crontab_str():
    source = 'test_source'
    bad_crontab_str = 'abc123'
    dag_variables = {'test_source': {CRONTAB_STR: bad_crontab_str}}
    script_location, dag_id, crontab_str = caw.load_dag_conf(
        source, dag_variables)
    assert crontab_str is None
Exemple #4
0
def test_load_dag_conf_validates_script_location():
    source = 'test_source'
    dag_variables = {
        'test_source': {
            SCRIPT: '/this/path/does/not/exist/hopefully'
        }
    }
    script_location, dag_id, crontab_str = caw.load_dag_conf(
        source, dag_variables)
    assert script_location is None
Exemple #5
0
def test_load_dag_conf_handles_missing_crontab_str():
    source = 'test_source'
    dag_variables = {'test_source': {}}
    script_location, dag_id, crontab_str = caw.load_dag_conf(
        source, dag_variables)
    assert crontab_str is None