mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
Fixes #2665. Regenerated by tabbott with `lint --fix` after a rebase and change in parameters. Note from tabbott: In a few cases, this converts technical debt in the form of unsorted imports into different technical debt in the form of our largest files having very long, ugly import sequences at the start. I expect this change will increase pressure for us to split those files, which isn't a bad thing. Signed-off-by: Anders Kaseorg <anders@zulip.com>
20 lines
511 B
Python
Executable File
20 lines
511 B
Python
Executable File
import logging
|
|
import os
|
|
import subprocess
|
|
|
|
|
|
class DiffException(Exception):
|
|
pass
|
|
|
|
def diff_strings(output: str, expected_output: str) -> str:
|
|
|
|
mdiff_path = "frontend_tests/zjsunit/mdiff.js"
|
|
if not os.path.isfile(mdiff_path): # nocoverage
|
|
msg = "Cannot find mdiff for markdown diff rendering"
|
|
logging.error(msg)
|
|
raise DiffException(msg)
|
|
|
|
command = ['node', mdiff_path, output, expected_output]
|
|
diff = subprocess.check_output(command).decode('utf-8')
|
|
return diff
|