예제 #1
0
def test_loading_target_file_via_property(simple_fields_file,
                                          observer,
                                          constraints):
    scheduler = Scheduler(observer, fields_file=simple_fields_file,
                          constraints=constraints)
    scheduler._observations = dict()
    assert scheduler.observations is not None
예제 #2
0
def test_loading_target_file_check_file(observer,
                                        simple_fields_file,
                                        constraints):
    set_config('scheduler.check_file', False)
    scheduler = Scheduler(observer,
                          fields_file=simple_fields_file,
                          constraints=constraints)
    # Check the hidden property as the public one
    # will populate if not found.
    assert len(scheduler._observations)
예제 #3
0
def test_bad_observer(simple_fields_file, constraints):
    with pytest.raises(TypeError):
        Scheduler(fields_file=simple_fields_file,
                  constraints=constraints)
예제 #4
0
def test_no_observer(simple_fields_file):
    with pytest.raises(TypeError):
        Scheduler(fields_file=simple_fields_file)
예제 #5
0
def test_scheduler_load_no_params():
    with pytest.raises(TypeError):
        Scheduler()
예제 #6
0
def scheduler(field_list, observer, constraints):
    return Scheduler(observer,
                     fields_list=field_list,
                     constraints=constraints)
예제 #7
0
def test_loading_bad_target_file(observer):
    with pytest.raises(FileNotFoundError):
        Scheduler(observer, fields_file='/var/path/foo.bar')