🎨 Format Python code with Black
This commit is contained in:
parent
84788f4db2
commit
10b972894e
1 changed files with 9 additions and 2 deletions
|
@ -12,11 +12,16 @@ TEST_APP_NAME = "gotosocial_ynh"
|
||||||
TEST_APP_REPO = "https://github.com/yunohost-apps/gotosocial_ynh"
|
TEST_APP_REPO = "https://github.com/yunohost-apps/gotosocial_ynh"
|
||||||
TEST_APP_COMMIT_ID = "8f788213b363a46a5b6faa8f844d86d4adac9446"
|
TEST_APP_COMMIT_ID = "8f788213b363a46a5b6faa8f844d86d4adac9446"
|
||||||
|
|
||||||
|
|
||||||
def diff_files(file_a: Path, file_b: Path) -> bool:
|
def diff_files(file_a: Path, file_b: Path) -> bool:
|
||||||
lines_a = file_a.open(encoding="utf-8").readlines()
|
lines_a = file_a.open(encoding="utf-8").readlines()
|
||||||
lines_b = file_b.open(encoding="utf-8").readlines()
|
lines_b = file_b.open(encoding="utf-8").readlines()
|
||||||
|
|
||||||
diffs = list(difflib.unified_diff(lines_a, lines_b, fromfile='README.before.md', tofile='README.after.md'))
|
diffs = list(
|
||||||
|
difflib.unified_diff(
|
||||||
|
lines_a, lines_b, fromfile="README.before.md", tofile="README.after.md"
|
||||||
|
)
|
||||||
|
)
|
||||||
print("".join(diffs))
|
print("".join(diffs))
|
||||||
return len(diffs) == 0
|
return len(diffs) == 0
|
||||||
|
|
||||||
|
@ -27,7 +32,9 @@ def test_running_make_readme():
|
||||||
DIRECTORY = tempdir / TEST_APP_NAME
|
DIRECTORY = tempdir / TEST_APP_NAME
|
||||||
|
|
||||||
subprocess.check_call(["git", "clone", "-q", TEST_APP_REPO, DIRECTORY])
|
subprocess.check_call(["git", "clone", "-q", TEST_APP_REPO, DIRECTORY])
|
||||||
subprocess.check_call(["git", "checkout", "-q", TEST_APP_COMMIT_ID], cwd=DIRECTORY)
|
subprocess.check_call(
|
||||||
|
["git", "checkout", "-q", TEST_APP_COMMIT_ID], cwd=DIRECTORY
|
||||||
|
)
|
||||||
|
|
||||||
# Now run test...
|
# Now run test...
|
||||||
subprocess.check_call([CWD.parent / "make_readme.py", DIRECTORY])
|
subprocess.check_call([CWD.parent / "make_readme.py", DIRECTORY])
|
||||||
|
|
Loading…
Reference in a new issue