0
0
Fork 0
This repository has been archived on 2025-05-11. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
Heliotrope/tests/test_arg.py
Ryu Juheon fd200eb2cf
feat: remove js2py dependency (#307)
* feat: remove js2py dependency

* style: apply code stype isort

* feat: remove interpreter

* style: fix type hints

* test: fix image url fixture

* feat: add refresh func and fix some problem

* style: fix type hints

* style: common js is native we refresh gg js

* feat: remove common js request func

* chore(deps): remove bs4
2022-10-28 11:39:27 +09:00

40 lines
1,004 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-english.nozomi"]
assert config.MIRRORING_DELAY == 3600
assert config.REFRESH_GG_JS_DELAY == 86400