@@ -629,6 +629,40 @@ def test_show_several_args_tty(capsys, rpath, stringio_tty):
629629 assert stringio_tty .getvalue ().startswith ('\033 [33m--- /dev/null' )
630630
631631
632+ @mock .patch ('os.environ' , {'HEADER_NAME_A' : 'foo' , 'HEADER_NAME_B' : 'bar' })
633+ def test_header_names_from_env (capsys , rpath ):
634+ app = nested_diff .diff_tool .App (
635+ args = (
636+ rpath ('shared.lists.a.json' ),
637+ rpath ('shared.lists.b.json' ),
638+ ),
639+ )
640+ exit_code = app .run ()
641+
642+ captured = capsys .readouterr ()
643+ assert captured .err == ''
644+ assert exit_code == 1
645+
646+ assert captured .out .startswith ('--- foo\n +++ bar\n ' )
647+
648+
649+ @mock .patch ('os.environ' , {'HEADER_NAME_A' : 'foo' })
650+ def test_header_names_from_env_partial (capsys , rpath ):
651+ app = nested_diff .diff_tool .App (
652+ args = (
653+ rpath ('shared.lists.a.json' ),
654+ rpath ('shared.lists.b.json' ),
655+ ),
656+ )
657+ exit_code = app .run ()
658+
659+ captured = capsys .readouterr ()
660+ assert captured .err == ''
661+ assert exit_code == 1
662+
663+ assert not captured .out .startswith ('--- ' )
664+
665+
632666def test_values_none (capsys , expected , rpath ):
633667 exit_code = nested_diff .diff_tool .App (
634668 args = (
0 commit comments