Add/Update tests/test_config.py by Wolf
This commit is contained in:
21
tests/test_config.py
Normal file
21
tests/test_config.py
Normal file
@@ -0,0 +1,21 @@
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
from wolf.config import Config
|
||||
|
||||
class TestConfig(unittest.TestCase):
|
||||
def test_config_load(self):
|
||||
# Create a temporary config file
|
||||
config_path = Path("test-config.yaml")
|
||||
with open(config_path, "w") as f:
|
||||
f.write("gitea_url: http://localhost:3000\n")
|
||||
f.write("token: test-token\n")
|
||||
|
||||
config = Config(config_path)
|
||||
self.assertEqual(config.get("gitea_url"), "http://localhost:3000")
|
||||
self.assertEqual(config.get("token"), "test-token")
|
||||
|
||||
# Cleanup
|
||||
config_path.unlink()
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user