Change type msg_location to an Enum instead of Literal to be able to get all values easy and improve type checks.
This commit is contained in:
@@ -4,7 +4,7 @@ import tempfile
|
||||
import yaml
|
||||
from pathlib import Path
|
||||
from chatmastermind.message import Message, Question
|
||||
from chatmastermind.chat import ChatDB, ChatError
|
||||
from chatmastermind.chat import ChatDB, ChatError, msg_location
|
||||
from chatmastermind.configuration import Config
|
||||
from chatmastermind.commands.hist import convert_messages
|
||||
|
||||
@@ -41,7 +41,7 @@ class TestConvertMessages(unittest.TestCase):
|
||||
def test_convert_messages(self) -> None:
|
||||
self.args.convert = 'yaml'
|
||||
convert_messages(self.args, self.config)
|
||||
msgs = self.chat.msg_gather(loc='disk', glob='*.*')
|
||||
msgs = self.chat.msg_gather(loc=msg_location.DISK, glob='*.*')
|
||||
# Check if the number of messages is the same as before
|
||||
self.assertEqual(len(msgs), len(self.messages))
|
||||
# Check if all messages have the requested suffix
|
||||
|
||||
Reference in New Issue
Block a user