ϪfRddlmZddlmZddlmZGddejZy))text) attributes)unittestcXeZdZdZd dZd dZd dZd dZd dZd dZ d d Z d d Z d d Z y) FormattedTextTestsz. Tests for assembling formatted text. Ncp|jtjtjddy)zu Using no formatting attributes produces no VT102 control sequences in the flattened output. Hello, world.N) assertEqualrassembleFormattedTextAnormalselfs >/usr/lib/python3/dist-packages/twisted/conch/test/test_text.py test_trivialzFormattedTextTests.test_trivials+   & &qxx'@ A? cp|jtjtjddy)z The bold formatting attribute, L{A.bold}, emits the VT102 control sequence to enable bold when flattened. r zHello, world.N)r rr r boldrs r test_boldzFormattedTextTests.test_bolds,   & &qvvo'> ?AW rcp|jtjtjddy)z The underline formatting attribute, L{A.underline}, emits the VT102 control sequence to enable underlining when flattened. r zHello, world.N)r rr r underliners rtest_underlinez!FormattedTextTests.test_underline!s,   & &q{{?'C D " rcp|jtjtjddy)z The blink formatting attribute, L{A.blink}, emits the VT102 control sequence to enable blinking when flattened. r zHello, world.N)r rr r blinkrs r test_blinkzFormattedTextTests.test_blink+s,   & &qww'? @BX rcp|jtjtjddy)z The reverse-video formatting attribute, L{A.reverseVideo}, emits the VT102 control sequence to enable reversed video when flattened. r zHello, world.N)r rr r reverseVideors rtest_reverseVideoz$FormattedTextTests.test_reverseVideo4s,   & &q~~o'F G " rc |jtjtjtj dtjd dfdy)z Formatting attributes prefixed with a minus (C{-}) temporarily disable the prefixed attribute, emitting no VT102 control sequence to enable it in the flattened output. Helloz world.zHello world.N)r rr r rrrs r test_minuszFormattedTextTests.test_minus>sM   & &qwww)9(93>?@  6  rc|jtjtjtj j dtj jdfdy)z The foreground color formatting attribute, L{A.fg}, emits the VT102 control sequence to set the selected foreground color when flattened. Hello, world!zHello, world!N)r rr r r fgredgreenrs rtest_foregroundz"FormattedTextTests.test_foregroundKP   & &),addjj.BBC  ,  rc|jtjtjtj j dtj jdfdy)z The background color formatting attribute, L{A.bg}, emits the VT102 control sequence to set the selected background color when flattened. r$r%zHello, world!N)r rr r r bgr'r(rs rtest_backgroundz"FormattedTextTests.test_backgroundWr*rch|j|jg}|jt|dtj |j|jg}|jt|d|j|ddt |j|dddy)zv L{twisted.conch.insults.text.flatten} emits a deprecation warning when imported or accessed. rcategorymessageztwisted.conch.insults.text.flatten was deprecated in Twisted 13.1.0: Use twisted.conch.insults.text.assembleFormattedText instead.N) flushWarningstest_flattenDeprecatedr lenrflattenDeprecationWarning)r warningsShowns rr3z)FormattedTextTests.test_flattenDeprecatedcs **D,G,G+HI  ]+Q/ **D,G,G+HI  ]+Q/ q)*57IJ  ! Y '  r)returnN) __name__ __module__ __qualname____doc__rrrrrr"r)r-r3rrrr s4            rrN) twisted.conch.insultsrtwisted.conch.insults.textrr twisted.trialrTestCaserr=rrrBs$ '6"l **l r