File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,20 @@ def test_whole_page():
23
23
correct_output = f_rendered .read ()
24
24
assert tldr_output == correct_output
25
25
26
+ def test_markdown_mode ():
27
+ with open ("tests/data/gem.md" , "rb" ) as f_original :
28
+ d_original = f_original .read ()
29
+ old_stdout = sys .stdout
30
+ sys .stdout = io .StringIO ()
31
+ sys .stdout .buffer = types .SimpleNamespace ()
32
+ sys .stdout .buffer .write = lambda x : sys .stdout .write (x .decode ("utf-8" ))
33
+ tldr .output (d_original .splitlines (), plain = True )
34
+
35
+ sys .stdout .seek (0 )
36
+ tldr_output = sys .stdout .read ().encode ("utf-8" )
37
+ sys .stdout = old_stdout
38
+
39
+ assert tldr_output == d_original
26
40
27
41
def test_error_message ():
28
42
with mock .patch ("sys.argv" , ["tldr" , "73eb6f19cd6f" ]):
You can’t perform that action at this time.
0 commit comments