Пример #1
0
def test_annotation_method():
	ext = AnnotationExtension()
	ctx = Context()
	args = []
	kwargs = {'a': '27', 'b': '42'}
	
	ext.mutate(ctx, Endpoint().endpoint, args, kwargs)
	
	assert kwargs == {'a': 27, 'b': 42}
Пример #2
0
def test_annotation_method():
    ext = AnnotationExtension()
    ctx = Context()
    args = []
    kwargs = {'a': '27', 'b': '42'}

    ext.mutate(ctx, Endpoint().endpoint, args, kwargs)

    assert kwargs == {'a': 27, 'b': 42}
Пример #3
0
def test_annotation_positional():
	ext = AnnotationExtension()
	ctx = Context()
	args = ['27', '42']
	kwargs = {}
	
	ext.mutate(ctx, endpoint, args, kwargs)
	
	assert args == [27, 42]
	assert kwargs == {}
Пример #4
0
def test_annotation_positional():
    ext = AnnotationExtension()
    ctx = Context()
    args = ['27', '42']
    kwargs = {}

    ext.mutate(ctx, endpoint, args, kwargs)

    assert args == [27, 42]
    assert kwargs == {}
Пример #5
0
def test_annotation_bare():
	ext = AnnotationExtension()
	ctx = Context()
	args = []
	kwargs = {'a': '27', 'b': '42'}
	
	ext.mutate(ctx, bare_endpoint, args, kwargs)
	
	assert kwargs == {'a': '27', 'b': '42'}
	
	assert ext.transform(ctx, bare_endpoint, None) is None
Пример #6
0
def test_annotation_bare():
    ext = AnnotationExtension()
    ctx = Context()
    args = []
    kwargs = {'a': '27', 'b': '42'}

    ext.mutate(ctx, bare_endpoint, args, kwargs)

    assert kwargs == {'a': '27', 'b': '42'}

    assert ext.transform(ctx, bare_endpoint, None) is None