We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f99aaa commit bbb333bCopy full SHA for bbb333b
tests/test_main.py
@@ -1,4 +1,5 @@
1
import os
2
+import uuid
3
import json
4
import unittest
5
from unittest.mock import patch
@@ -25,7 +26,12 @@
25
26
# ))
27
# from main import app
28
-TEST_DRAFTS_FILE = "test-drafts.json"
29
+# Generate a unique test drafts file name
30
+TEST_DRAFTS_FILE = f"test-drafts-{uuid.uuid4().hex[:6]}.json"
31
+
32
+# Ensure DRAFTS_FILE path is resolved and the file exists, following XDG Base Directory Specification if necessary.
33
+TEST_DRAFTS_FILE = ensure_drafts_file(TEST_DRAFTS_FILE)
34
+os.remove(TEST_DRAFTS_FILE)
35
36
class TestThreadsCLI(unittest.TestCase):
37
def setUp(self):
0 commit comments