Code Duplication    Length = 19-20 lines in 2 locations

test/test_loader.py 2 locations

@@ 423-442 (lines=20) @@
420
    assert docs[1] == ['.test hello']
421
422
423
def test_clean_callable_example_first_only_multi_commands(tmpconfig, func):
424
    module.commands('test')(func)
425
    module.commands('unit')(func)
426
    module.example('.test hello')(func)
427
    module.example('.test bonjour')(func)
428
429
    loader.clean_callable(func, tmpconfig)
430
431
    assert hasattr(func, '_docs')
432
    assert len(func._docs) == 2
433
    assert 'test' in func._docs
434
    assert 'unit' in func._docs
435
436
    test_docs = func._docs['test']
437
    unit_docs = func._docs['unit']
438
    assert len(test_docs) == 2
439
    assert test_docs == unit_docs
440
441
    assert test_docs[0] == inspect.cleandoc(func.__doc__).splitlines()
442
    assert test_docs[1] == ['.test hello']
443
444
445
def test_clean_callable_example_user_help(tmpconfig, func):
@@ 386-404 (lines=19) @@
383
    assert docs[1] == []
384
385
386
def test_clean_callable_example_multi_commands(tmpconfig, func):
387
    module.commands('test')(func)
388
    module.commands('unit')(func)
389
    module.example('.test hello')(func)
390
391
    loader.clean_callable(func, tmpconfig)
392
393
    assert hasattr(func, '_docs')
394
    assert len(func._docs) == 2
395
    assert 'test' in func._docs
396
    assert 'unit' in func._docs
397
398
    test_docs = func._docs['test']
399
    unit_docs = func._docs['unit']
400
    assert len(test_docs) == 2
401
    assert test_docs == unit_docs
402
403
    assert test_docs[0] == inspect.cleandoc(func.__doc__).splitlines()
404
    assert test_docs[1] == ['.test hello']
405
406
407
def test_clean_callable_example_first_only(tmpconfig, func):