def test_crs_callback(data): ctx = MockContext() ctx.obj['like'] = {'crs': 'foo'} assert info.crs_handler(ctx, MockOption('crs'), 'like') == 'foo'
def test_crs_callback_pass(data): """Always return None if the value is None""" ctx = MockContext() ctx.obj['like'] = {'crs': 'foo'} assert info.crs_handler(ctx, MockOption('crs'), None) is None
def test_crs_callback(data): ctx = MockContext() ctx.obj["like"] = {"crs": "foo"} assert info.crs_handler(ctx, MockOption("crs"), "like") == "foo"
def test_crs_callback_pass(data): """Always return None if the value is None""" ctx = MockContext() ctx.obj["like"] = {"crs": "foo"} assert info.crs_handler(ctx, MockOption("crs"), None) is None