mirror of
https://github.com/venthur/blag.git
synced 2025-11-25 20:52:43 +00:00
reformatted code
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
# remove when we don't support py38 anymore
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
|
||||
from pytest import MonkeyPatch
|
||||
@@ -8,26 +9,26 @@ from blag.quickstart import get_input, quickstart
|
||||
|
||||
|
||||
def test_get_input_default_answer(monkeypatch: MonkeyPatch) -> None:
|
||||
monkeypatch.setattr('builtins.input', lambda x: '')
|
||||
monkeypatch.setattr("builtins.input", lambda x: "")
|
||||
answer = get_input("foo", "bar")
|
||||
assert answer == 'bar'
|
||||
assert answer == "bar"
|
||||
|
||||
|
||||
def test_get_input(monkeypatch: MonkeyPatch) -> None:
|
||||
monkeypatch.setattr('builtins.input', lambda x: 'baz')
|
||||
monkeypatch.setattr("builtins.input", lambda x: "baz")
|
||||
answer = get_input("foo", "bar")
|
||||
assert answer == 'baz'
|
||||
assert answer == "baz"
|
||||
|
||||
|
||||
def test_quickstart(cleandir: str, monkeypatch: MonkeyPatch) -> None:
|
||||
monkeypatch.setattr('builtins.input', lambda x: 'foo')
|
||||
monkeypatch.setattr("builtins.input", lambda x: "foo")
|
||||
quickstart(None)
|
||||
with open('config.ini', 'r') as fh:
|
||||
with open("config.ini", "r") as fh:
|
||||
data = fh.read()
|
||||
assert 'base_url = foo' in data
|
||||
assert 'title = foo' in data
|
||||
assert 'description = foo' in data
|
||||
assert 'author = foo' in data
|
||||
assert "base_url = foo" in data
|
||||
assert "title = foo" in data
|
||||
assert "description = foo" in data
|
||||
assert "author = foo" in data
|
||||
|
||||
for template in (
|
||||
"archive.html",
|
||||
@@ -38,7 +39,7 @@ def test_quickstart(cleandir: str, monkeypatch: MonkeyPatch) -> None:
|
||||
"tag.html",
|
||||
"tags.html",
|
||||
):
|
||||
assert os.path.exists(f'templates/{template}')
|
||||
assert os.path.exists(f"templates/{template}")
|
||||
|
||||
for directory in "build", "content", "static":
|
||||
assert os.path.exists(directory)
|
||||
|
||||
Reference in New Issue
Block a user