Пример #1
0
def test_crs_callback(data):
    ctx = MockContext()
    ctx.obj['like'] = {'crs': 'foo'}
    assert info.crs_handler(ctx, MockOption('crs'), 'like') == 'foo'
Пример #2
0
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
Пример #3
0
def test_crs_callback(data):
    ctx = MockContext()
    ctx.obj["like"] = {"crs": "foo"}
    assert info.crs_handler(ctx, MockOption("crs"), "like") == "foo"
Пример #4
0
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
Пример #5
0
def test_crs_callback(data):
    ctx = MockContext()
    ctx.obj['like'] = {'crs': 'foo'}
    assert info.crs_handler(ctx, MockOption('crs'), 'like') == 'foo'
Пример #6
0
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