mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-23 15:48:11 +02:00
feat: + Config.options
This commit is contained in:
parent
f31b60309a
commit
291af5ad01
2 changed files with 29 additions and 9 deletions
|
|
@ -4,7 +4,9 @@
|
|||
@Time : 2023/5/1 11:19
|
||||
@Author : alexanderwu
|
||||
@File : test_config.py
|
||||
@Modified By: mashenquan, 2013/8/20, add `test_options`
|
||||
"""
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
|
|
@ -29,3 +31,14 @@ def test_config_yaml_file_not_exists():
|
|||
with pytest.raises(Exception) as exc_info:
|
||||
config.get('OPENAI_BASE_URL')
|
||||
assert str(exc_info.value) == "Key 'OPENAI_BASE_URL' not found in environment variables or in the YAML file"
|
||||
|
||||
|
||||
def test_options():
|
||||
filename = Path(__file__).resolve().parent.parent.parent.parent / "config/config.yaml"
|
||||
config = Config(filename)
|
||||
opts = config.options
|
||||
assert opts
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
test_options()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue