Rye all makefile targets
This commit is contained in:
parent
46a6358c5b
commit
e85157c5a0
5 changed files with 17 additions and 19 deletions
6
Makefile
6
Makefile
|
@ -8,15 +8,15 @@ endif
|
||||||
all: black test typehint lint
|
all: black test typehint lint
|
||||||
|
|
||||||
black:
|
black:
|
||||||
poetry run isort --multi-line 3 --profile black src/ tests/
|
rye run isort --multi-line 3 --profile black src/ tests/
|
||||||
poetry run black --target-version py311 src/ tests/
|
rye run black --target-version py311 src/ tests/
|
||||||
|
|
||||||
test:
|
test:
|
||||||
rye run coverage run -m --source=stacosys pytest tests
|
rye run coverage run -m --source=stacosys pytest tests
|
||||||
rye run coverage report
|
rye run coverage report
|
||||||
|
|
||||||
typehint:
|
typehint:
|
||||||
rye run mypy --ignore-missing-imports stacosys/ tests/
|
rye run mypy --ignore-missing-imports src/ tests/
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
rye run pylint src/
|
rye run pylint src/
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
# from run import stacosys_server
|
|
||||||
#
|
|
||||||
# if __name__ == '__main__':
|
|
||||||
# parser = argparse.ArgumentParser()
|
|
||||||
# parser.add_argument("config", help="config path name")
|
|
||||||
# args = parser.parse_args()
|
|
||||||
# stacosys_server(args.config)
|
|
|
@ -5,7 +5,6 @@ from pydal import DAL, Field
|
||||||
|
|
||||||
|
|
||||||
class Database:
|
class Database:
|
||||||
|
|
||||||
db_dal = DAL()
|
db_dal = DAL()
|
||||||
|
|
||||||
def configure(self, db_uri):
|
def configure(self, db_uri):
|
||||||
|
|
|
@ -30,7 +30,6 @@ class ConfigParameter(Enum):
|
||||||
|
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
|
|
||||||
_cfg = configparser.ConfigParser()
|
_cfg = configparser.ConfigParser()
|
||||||
|
|
||||||
def load(self, config_pathname):
|
def load(self, config_pathname):
|
||||||
|
|
|
@ -83,13 +83,20 @@ def create_comment(url, author_name, content):
|
||||||
|
|
||||||
|
|
||||||
def test_find_recent_published_comments(setup_db):
|
def test_find_recent_published_comments(setup_db):
|
||||||
|
comments = [
|
||||||
comments = [create_comment("/post", "Adam", "Comment 1"), create_comment("/post", "Arf", "Comment 2"),
|
create_comment("/post", "Adam", "Comment 1"),
|
||||||
create_comment("/post", "Arwin", "Comment 3"), create_comment("/post", "Bill", "Comment 4"),
|
create_comment("/post", "Arf", "Comment 2"),
|
||||||
create_comment("/post", "Bo", "Comment 5"), create_comment("/post", "Charles", "Comment 6"),
|
create_comment("/post", "Arwin", "Comment 3"),
|
||||||
create_comment("/post", "Dan", "Comment 7"), create_comment("/post", "Dwayne", "Comment 8"),
|
create_comment("/post", "Bill", "Comment 4"),
|
||||||
create_comment("/post", "Erl", "Comment 9"), create_comment("/post", "Jay", "Comment 10"),
|
create_comment("/post", "Bo", "Comment 5"),
|
||||||
create_comment("/post", "Kenny", "Comment 11"), create_comment("/post", "Lord", "Comment 12")]
|
create_comment("/post", "Charles", "Comment 6"),
|
||||||
|
create_comment("/post", "Dan", "Comment 7"),
|
||||||
|
create_comment("/post", "Dwayne", "Comment 8"),
|
||||||
|
create_comment("/post", "Erl", "Comment 9"),
|
||||||
|
create_comment("/post", "Jay", "Comment 10"),
|
||||||
|
create_comment("/post", "Kenny", "Comment 11"),
|
||||||
|
create_comment("/post", "Lord", "Comment 12"),
|
||||||
|
]
|
||||||
|
|
||||||
rows = dao.find_recent_published_comments()
|
rows = dao.find_recent_published_comments()
|
||||||
assert len(rows) == 0
|
assert len(rows) == 0
|
||||||
|
|
Loading…
Add table
Reference in a new issue