Compare commits
10 Commits
25fffb6fea
...
59782f54ca
| Author | SHA1 | Date | |
|---|---|---|---|
| 59782f54ca | |||
| 039d3fe3dc | |||
| 30a62fcced | |||
| a571307d77 | |||
| 19c2b16301 | |||
| ce4d45a434 | |||
| 829bfa31cd | |||
| 454ce84d71 | |||
| bbcff17558 | |||
| 6ad404899e |
@ -393,9 +393,9 @@ class Message():
|
||||
try:
|
||||
data = yaml.load(fd, Loader=yaml.FullLoader)
|
||||
data[cls.file_yaml_key] = file_path
|
||||
return cls.from_dict(data)
|
||||
except Exception:
|
||||
raise MessageError(f"'{file_path}' does not contain a valid message")
|
||||
return cls.from_dict(data)
|
||||
|
||||
def to_str(self, with_tags: bool = False, with_file: bool = False, source_code_only: bool = False) -> str:
|
||||
"""
|
||||
|
||||
@ -2,7 +2,6 @@ import unittest
|
||||
import pathlib
|
||||
import tempfile
|
||||
import time
|
||||
import yaml
|
||||
from io import StringIO
|
||||
from unittest.mock import patch
|
||||
from chatmastermind.tags import TagLine
|
||||
@ -185,10 +184,6 @@ class TestChatDB(unittest.TestCase):
|
||||
for file in self.trash_files:
|
||||
with open(pathlib.Path(self.db_path.name) / file, 'w') as f:
|
||||
f.write('test trash')
|
||||
# also create a file with actual yaml content
|
||||
with open(pathlib.Path(self.db_path.name) / 'content.yaml', 'w') as f:
|
||||
yaml.dump({'key': 'value'}, f)
|
||||
self.trash_files.append('content.yaml')
|
||||
self.maxDiff = None
|
||||
|
||||
def message_list(self, tmp_dir: tempfile.TemporaryDirectory) -> list[pathlib.Path]:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user