Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions tests/test_remix_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@
# in environments where requests is not installed (e.g. minimal CI images).
# remix_api treats requests as optional and guards all usage behind _get_session().
_req_mock = MagicMock()
_ConnErr = type("ConnectionError", (OSError,), {})
_Timeout = type("Timeout", (OSError,), {})
class RequestException(OSError): pass
_req_mock.exceptions.RequestException = RequestException
class ConnectionError(RequestException): pass
_ConnErr = ConnectionError
class Timeout(RequestException): pass
_Timeout = Timeout
_req_mock.exceptions.ConnectionError = _ConnErr
_req_mock.exceptions.Timeout = _Timeout
_req_mock.exceptions.RequestException = type("RequestException", (OSError,), {})

sys.modules.setdefault("requests", _req_mock)

Comment on lines +19 to 21
sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
Expand Down
15 changes: 0 additions & 15 deletions tests/test_texture_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,6 @@ def test_empty_returns_empty(self):
self.assertEqual(_make_processor()._sanitize_filename_stem(""), "")


class TestStripKnownTextureExtensions(unittest.TestCase):
def test_strips_dds(self):
self.assertEqual(TextureProcessor._strip_known_texture_extensions("foo.dds"), "foo")

def test_strips_rtex_dds(self):
self.assertEqual(TextureProcessor._strip_known_texture_extensions("foo.rtex.dds"), "foo")

def test_strips_png(self):
self.assertEqual(TextureProcessor._strip_known_texture_extensions("bar.png"), "bar")

def test_handles_windows_path(self):
result = TextureProcessor._strip_known_texture_extensions(r"C:\textures\foo.dds")
self.assertEqual(result, "foo")


class TestStripIngestChannelSuffix(unittest.TestCase):
def test_strips_single_letter_suffixes(self):
for letter in "anrmheo":
Expand Down
8 changes: 0 additions & 8 deletions texture_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,6 @@ def _sanitize_filename_stem(name):
cleaned = cleaned.strip(" .")
return cleaned[:120]

@staticmethod
def _strip_known_texture_extensions(texture_path_or_name):
if not texture_path_or_name: return ""
base = TextureProcessor.safe_basename(str(texture_path_or_name).replace("\\", "/"))
stem = os.path.splitext(base)[0]
if stem.lower().endswith(".rtex"):
stem = os.path.splitext(stem)[0]
return stem

@staticmethod
def _strip_ingest_channel_suffix(stem):
Expand Down