diff --git a/Libraries/PyKotor/tests/resource/formats/test_tlk.py b/Libraries/PyKotor/tests/resource/formats/test_tlk.py
index a097ac1ce..abfae83e2 100644
--- a/Libraries/PyKotor/tests/resource/formats/test_tlk.py
+++ b/Libraries/PyKotor/tests/resource/formats/test_tlk.py
@@ -78,6 +78,18 @@ def test_xml_io(self):
tlk = read_tlk(data)
self.validate_io(tlk)
+ def test_xml_reader_self_closing_string_has_empty_text(self):
+ """Empty ```` must load as empty dialogue text (not raise)."""
+ xml_doc = (
+ ''
+ ''
+ ''
+ ""
+ )
+ tlk = TLKXMLReader(xml_doc.encode("utf-8")).load()
+ self.assertEqual(tlk[0].text, "")
+ self.assertEqual(str(tlk[0].voiceover), "")
+
def test_json_io(self):
self.assertEqual(detect_tlk(JSON_TEST_DATA.encode("utf-8")), ResourceType.TLK_JSON)
diff --git a/Libraries/PyKotor/tests/test_resource_json_progress.py b/Libraries/PyKotor/tests/test_resource_json_progress.py
new file mode 100644
index 000000000..f1ed4b6b3
--- /dev/null
+++ b/Libraries/PyKotor/tests/test_resource_json_progress.py
@@ -0,0 +1,49 @@
+"""Regression tests for JSON export progress reporting (CI vs TTY)."""
+
+from __future__ import annotations
+
+from io import StringIO
+
+import pytest
+
+from pykotor.tools.resource_json import _supports_live_progress
+
+
+class _FakeTTYStream:
+ """Minimal stream that reports as a TTY (like stderr under ``script``)."""
+
+ def isatty(self) -> bool:
+ return True
+
+
+def test_supports_live_progress_true_when_tty_and_not_ci(monkeypatch: pytest.MonkeyPatch) -> None:
+ monkeypatch.delenv("CI", raising=False)
+ monkeypatch.delenv("GITHUB_ACTIONS", raising=False)
+ assert _supports_live_progress(_FakeTTYStream()) is True
+
+
+@pytest.mark.parametrize(
+ ("env_name", "env_value"),
+ [
+ ("CI", "true"),
+ ("CI", "1"),
+ ("CI", "yes"),
+ ("GITHUB_ACTIONS", "true"),
+ ("GITHUB_ACTIONS", "1"),
+ ],
+)
+def test_supports_live_progress_false_in_ci_even_if_stream_is_tty(
+ monkeypatch: pytest.MonkeyPatch,
+ env_name: str,
+ env_value: str,
+) -> None:
+ monkeypatch.delenv("CI", raising=False)
+ monkeypatch.delenv("GITHUB_ACTIONS", raising=False)
+ monkeypatch.setenv(env_name, env_value)
+ assert _supports_live_progress(_FakeTTYStream()) is False
+
+
+def test_supports_live_progress_false_when_not_tty(monkeypatch: pytest.MonkeyPatch) -> None:
+ monkeypatch.delenv("CI", raising=False)
+ monkeypatch.delenv("GITHUB_ACTIONS", raising=False)
+ assert _supports_live_progress(StringIO()) is False