Skip to content

Commit

Permalink
Fixed backslashes in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Baintner committed Dec 17, 2023
1 parent 281f0bd commit 18982dc
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions path_utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,26 @@ def test_normalize_drive_letter(self):

def test_get_rel_blend_path(self):
"""Test that the relative path to the blend file is correct."""
self.assertEqual(path_utils.get_rel_blend_path(
path = path_utils.get_rel_blend_path(
"C:/Users/peter/Nextcloud/20_prod/24_shots/SH050/SH050_render.blend",
"C:/Users/peter/Nextcloud/20_prod/24_shots"),
"SH050\\SH050_render.blend")
self.assertEqual(path_utils.get_rel_blend_path('C:/something/completely/different.blend',
"C:/Users/peter/Nextcloud/20_prod/24_shots"
), 'C:/something/completely/different.blend')
self.assertEqual(path_utils.get_rel_blend_path('different.blend',
"C:/Users/peter/Nextcloud/20_prod/24_shots"
), 'different.blend')
"C:/Users/peter/Nextcloud/20_prod/24_shots")
self.assertEqual(path, "SH050\\SH050_render.blend")

path = path_utils.get_rel_blend_path('C:/something/completely/different.blend',
"C:/Users/peter/Nextcloud/20_prod/24_shots")
self.assertEqual(path.replace("\\", "/"), 'C:/something/completely/different.blend')

path = path_utils.get_rel_blend_path(
'different.blend', "C:/Users/peter/Nextcloud/20_prod/24_shots")
self.assertEqual(path, 'different.blend')

def test_get_abs_blend_path(self):
"""Test that the absolute path to the blend file is correct."""
self.assertEqual(path_utils.get_abs_blend_path(
'SH050\\SH050_render.blend', 'C:/Users/peter/Nextcloud/20_prod/24_shots'),
'C:\\Users\\peter\\Nextcloud\\20_prod\\24_shots\\SH050\\SH050_render.blend')
path = path_utils.get_abs_blend_path(
'SH050\\SH050_render.blend', 'C:/Users/peter/Nextcloud/20_prod/24_shots')
self.assertEqual(
path.replace("\\", "/"), 'C:/Users/peter/Nextcloud/20_prod/24_shots/SH050/SH050_render.blend')

self.assertEqual(path_utils.get_abs_blend_path(
'C:/something/completely/different.blend', 'C:/Users/peter/Nextcloud/20_prod/24_shots'),
'C:/something/completely/different.blend')
path = path_utils.get_abs_blend_path(
'C:/something/completely/different.blend', 'C:/Users/peter/Nextcloud/20_prod/24_shots')
self.assertEqual(path.replace("\\", "/"), 'C:/something/completely/different.blend')

0 comments on commit 18982dc

Please sign in to comment.