* fix(interpreter): remove statement (#168) * refactor(table): hitomi changes applied * refactor(domain): hitomi changes applied * refactor(table): hitomi changes applied * refactor(types): hitomi changes applied * chore(vscode): add snippets * refactor(orm): hitomi changes applied * feat(odm): migration to mongodb (#169) * feat(odm): migration to mongodb * feat(config): add config for atlas search * feat: apply changed * chore(deps): add dependency * test: apply changed * test(config): apply changed * chore(deps): bump up version motor * feat!(parser): remove parser * feat(interpreter): add get thumbnail method * feat!(info): using galleryinfo * feat(functions): add getthumbnail method * feat!(hitomi): remove get info method * fix(image): now return only webp or avif * refactor(info): apply hitomi changed * refactor(mirroring): apply hitomi changed * fix(types): thumbnail is file * test(common): edit dict * style: apply code style * feat(info): add from dict method * style(info): fix type issue * test(arg): fix test * style(info): apply isort * fix(domain): init false * test(common): edit info * test(conftest): edit image url * test(mirroring): fix test * fix(function): add base * test(conftest): edit image url fixture * test(conftest): fix conftest * test(conftest): fix conftest
40 lines
1,005 B
Python
40 lines
1,005 B
Python
from heliotrope.argparser import parse_args
|
|
from heliotrope.config import HeliotropeConfig
|
|
|
|
|
|
def test_parse_args():
|
|
config = HeliotropeConfig()
|
|
args = parse_args(
|
|
[
|
|
"--host",
|
|
"127.0.0.1",
|
|
"--port",
|
|
"8000",
|
|
"--workers",
|
|
"1",
|
|
]
|
|
)
|
|
config.update_with_args(args)
|
|
assert args.host == "127.0.0.1"
|
|
assert args.port == 8000
|
|
assert args.workers == 1
|
|
|
|
|
|
def test_parse_args_with_config():
|
|
config = HeliotropeConfig()
|
|
args = parse_args(
|
|
[
|
|
"--config",
|
|
"tests/config.json",
|
|
]
|
|
)
|
|
config.update_with_args(args)
|
|
|
|
assert (
|
|
config.GALLERYINFO_DB_URL
|
|
== "postgresql+asyncpg://postgres:test@localhost/test_heliotrope"
|
|
)
|
|
assert config.INFO_DB_URL == "mongodb://root:test@127.0.0.1"
|
|
assert config.INDEX_FILE == "index-korean.nozomi"
|
|
assert config.MIRRORING_DELAY == 3600
|
|
assert config.REFRESH_COMMON_JS_DELAY == 86400
|