|
@@ 445-464 (lines=20) @@
|
| 442 |
|
assert docs[1] == ['.test hello'] |
| 443 |
|
|
| 444 |
|
|
| 445 |
|
def test_clean_callable_example_first_only_multi_commands(tmpconfig, func): |
| 446 |
|
module.commands('test')(func) |
| 447 |
|
module.commands('unit')(func) |
| 448 |
|
module.example('.test hello')(func) |
| 449 |
|
module.example('.test bonjour')(func) |
| 450 |
|
|
| 451 |
|
loader.clean_callable(func, tmpconfig) |
| 452 |
|
|
| 453 |
|
assert hasattr(func, '_docs') |
| 454 |
|
assert len(func._docs) == 2 |
| 455 |
|
assert 'test' in func._docs |
| 456 |
|
assert 'unit' in func._docs |
| 457 |
|
|
| 458 |
|
test_docs = func._docs['test'] |
| 459 |
|
unit_docs = func._docs['unit'] |
| 460 |
|
assert len(test_docs) == 2 |
| 461 |
|
assert test_docs == unit_docs |
| 462 |
|
|
| 463 |
|
assert test_docs[0] == inspect.cleandoc(func.__doc__).splitlines() |
| 464 |
|
assert test_docs[1] == ['.test hello'] |
| 465 |
|
|
| 466 |
|
|
| 467 |
|
def test_clean_callable_example_user_help(tmpconfig, func): |
|
@@ 408-426 (lines=19) @@
|
| 405 |
|
assert docs[1] == [] |
| 406 |
|
|
| 407 |
|
|
| 408 |
|
def test_clean_callable_example_multi_commands(tmpconfig, func): |
| 409 |
|
module.commands('test')(func) |
| 410 |
|
module.commands('unit')(func) |
| 411 |
|
module.example('.test hello')(func) |
| 412 |
|
|
| 413 |
|
loader.clean_callable(func, tmpconfig) |
| 414 |
|
|
| 415 |
|
assert hasattr(func, '_docs') |
| 416 |
|
assert len(func._docs) == 2 |
| 417 |
|
assert 'test' in func._docs |
| 418 |
|
assert 'unit' in func._docs |
| 419 |
|
|
| 420 |
|
test_docs = func._docs['test'] |
| 421 |
|
unit_docs = func._docs['unit'] |
| 422 |
|
assert len(test_docs) == 2 |
| 423 |
|
assert test_docs == unit_docs |
| 424 |
|
|
| 425 |
|
assert test_docs[0] == inspect.cleandoc(func.__doc__).splitlines() |
| 426 |
|
assert test_docs[1] == ['.test hello'] |
| 427 |
|
|
| 428 |
|
|
| 429 |
|
def test_clean_callable_example_first_only(tmpconfig, func): |