Add iteration suffix stripping node
This commit is contained in:
@@ -17,6 +17,7 @@ from dumas_json_nodes import (
|
||||
DumasJSONObjectToStringNode,
|
||||
DumasJSONStringToObjectNode,
|
||||
DumasJSONSetValueNode,
|
||||
DumasStripIterationSuffixNode,
|
||||
)
|
||||
|
||||
class DumasJSONNodeTests(unittest.TestCase):
|
||||
@@ -41,6 +42,27 @@ class DumasJSONNodeTests(unittest.TestCase):
|
||||
|
||||
self.assertEqual(result, ('{\n "a": 2,\n "b": 1\n}',))
|
||||
|
||||
def test_strip_iteration_suffix_removes_trailing_iteration_before_extension(self):
|
||||
node = DumasStripIterationSuffixNode()
|
||||
|
||||
result = node.strip_iteration_suffix("asset_build_003.png")
|
||||
|
||||
self.assertEqual(result, ("asset_build.png",))
|
||||
|
||||
def test_strip_iteration_suffix_removes_trailing_iteration_without_extension(self):
|
||||
node = DumasStripIterationSuffixNode()
|
||||
|
||||
result = node.strip_iteration_suffix("asset_build_003")
|
||||
|
||||
self.assertEqual(result, ("asset_build",))
|
||||
|
||||
def test_strip_iteration_suffix_leaves_names_without_numeric_suffix_unchanged(self):
|
||||
node = DumasStripIterationSuffixNode()
|
||||
|
||||
result = node.strip_iteration_suffix("my_asset_final.png")
|
||||
|
||||
self.assertEqual(result, ("my_asset_final.png",))
|
||||
|
||||
def test_get_value_reads_nested_paths(self):
|
||||
node = DumasJSONGetValueNode()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user