mirror of
https://github.com/openai/codex.git
synced 2026-04-24 06:35:50 +00:00
tests(tasklib): fix validation exception and add test package init
This commit is contained in:
3
agentydragon/tools/manager_utils/tests/__init__.py
Normal file
3
agentydragon/tools/manager_utils/tests/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
"""
|
||||
Test package for manager_utils
|
||||
"""
|
||||
@@ -3,10 +3,9 @@ from pathlib import Path
|
||||
import toml
|
||||
import pytest
|
||||
|
||||
from agentydragon.tools.manager_utils.tasklib import TaskMeta, load_task, save_task
|
||||
from ..tasklib import TaskMeta, load_task, save_task
|
||||
|
||||
SAMPLE = ''''''
|
||||
++
|
||||
SAMPLE = """+++
|
||||
id = "99"
|
||||
title = "Sample Task"
|
||||
status = "Not started"
|
||||
@@ -15,7 +14,7 @@ last_updated = "2023-01-01T12:00:00"
|
||||
++
|
||||
|
||||
# Body here
|
||||
'''
|
||||
"""
|
||||
|
||||
def test_load_and_save(tmp_path):
|
||||
md = tmp_path / '99-sample.md'
|
||||
@@ -29,6 +28,8 @@ def test_load_and_save(tmp_path):
|
||||
data = toml.loads(text.split('+++')[1])
|
||||
assert data['status'] == 'Done'
|
||||
|
||||
from pydantic import ValidationError
|
||||
|
||||
def test_meta_model_validation():
|
||||
with pytest.raises(ValueError):
|
||||
with pytest.raises(ValidationError):
|
||||
TaskMeta(id='a', title='t', status='bogus', dependencies='', last_updated='bad')
|
||||
|
||||
Reference in New Issue
Block a user