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
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)
def test_bad_observer(simple_fields_file, constraints): with pytest.raises(TypeError): Scheduler(fields_file=simple_fields_file, constraints=constraints)
def test_no_observer(simple_fields_file): with pytest.raises(TypeError): Scheduler(fields_file=simple_fields_file)
def test_scheduler_load_no_params(): with pytest.raises(TypeError): Scheduler()
def scheduler(field_list, observer, constraints): return Scheduler(observer, fields_list=field_list, constraints=constraints)
def test_loading_bad_target_file(observer): with pytest.raises(FileNotFoundError): Scheduler(observer, fields_file='/var/path/foo.bar')