def test_without_file_and_without_input_file(self): "ForcingOptions: xxx.file is not set and -i is not set" try: opt = PISM.ForcingOptions(ctx.ctx, "surface.given") assert False, "failed to stop with an error message" except RuntimeError: pass
def test_with_file(self): "ForcingOptions: xxx.file is set" ctx.config.set_string("surface.given.file", self.filename) opt = PISM.ForcingOptions(ctx.ctx, "surface.given") assert opt.filename == self.filename assert opt.periodic == False
def test_without_file(self): "ForcingOptions: xxx.file is not set" ctx.config.set_string("input.file", self.filename) opt = PISM.ForcingOptions(ctx.ctx, "surface.given") assert opt.filename == self.filename assert opt.period == 0 assert opt.reference_time == 0
def test_negative_period(self): "ForcingOptions: negative period" ctx.config.set_string("input.file", self.filename) ctx.config.set_number("surface.given.period", -1) try: opt = PISM.ForcingOptions(ctx.ctx, "surface.given") assert False, "failed to catch negative xxx.period" except RuntimeError: pass