ignore ".svn" when returning lists
also add variation blend files (WIP)
This commit is contained in:
BIN
tests/blends/variations/cone.blue.blend
Normal file
BIN
tests/blends/variations/cone.blue.blend
Normal file
Binary file not shown.
BIN
tests/blends/variations/cone.red.blend
Normal file
BIN
tests/blends/variations/cone.red.blend
Normal file
Binary file not shown.
BIN
tests/blends/variations/lib_endpoint.blend
Normal file
BIN
tests/blends/variations/lib_endpoint.blend
Normal file
Binary file not shown.
BIN
tests/blends/variations/lib_user.blend
Normal file
BIN
tests/blends/variations/lib_user.blend
Normal file
Binary file not shown.
@@ -711,7 +711,7 @@ class BamListTest(BamSessionTestCase):
|
|||||||
|
|
||||||
ret = bam_run_as_json(["ls", "--json"], proj_path)
|
ret = bam_run_as_json(["ls", "--json"], proj_path)
|
||||||
|
|
||||||
self.assertEqual(1, len(ret))
|
self.assertEqual([], [])
|
||||||
|
|
||||||
|
|
||||||
class BamCommitTest(BamSessionTestCase):
|
class BamCommitTest(BamSessionTestCase):
|
||||||
@@ -1356,6 +1356,54 @@ class BamRelativeAbsoluteTest(BamSessionTestCase):
|
|||||||
# self.assertEqual(ret[0], ["house_rel.blend", "file"])
|
# self.assertEqual(ret[0], ["house_rel.blend", "file"])
|
||||||
|
|
||||||
|
|
||||||
|
class BamVariation(BamSessionTestCase):
|
||||||
|
"""
|
||||||
|
"""
|
||||||
|
def __init__(self, *args):
|
||||||
|
self.init_defaults()
|
||||||
|
super().__init__(*args)
|
||||||
|
|
||||||
|
def test_variation(self):
|
||||||
|
"""
|
||||||
|
"""
|
||||||
|
|
||||||
|
session_name = "mysession"
|
||||||
|
proj_path, session_path = self.init_session(session_name)
|
||||||
|
variation_path = os.path.join(session_path, "variations")
|
||||||
|
|
||||||
|
if 1:
|
||||||
|
import shutil
|
||||||
|
# path cant already exist, ugh
|
||||||
|
shutil.copytree(
|
||||||
|
os.path.join(CURRENT_DIR, "blends", "variations"),
|
||||||
|
variation_path,
|
||||||
|
)
|
||||||
|
stdout, stderr = bam_run(["commit", "-m", "test message"], session_path)
|
||||||
|
self.assertEqual("", stderr)
|
||||||
|
|
||||||
|
|
||||||
|
listing = bam_run_as_json(["ls", "variations", "--json"], session_path)
|
||||||
|
self.assertEqual(
|
||||||
|
listing,
|
||||||
|
[["cone.blue.blend", "file"],
|
||||||
|
["cone.red.blend", "file"],
|
||||||
|
["lib_endpoint.blend", "file"]],
|
||||||
|
["lib_user.blend", "file"]],
|
||||||
|
)
|
||||||
|
|
||||||
|
f_variation = os.path.join(variation_path, "lib_user.json")
|
||||||
|
|
||||||
|
# now create variation file & commit it
|
||||||
|
file_quick_write(
|
||||||
|
session_path,
|
||||||
|
f,
|
||||||
|
"",
|
||||||
|
append=True)
|
||||||
|
|
||||||
|
|
||||||
|
# import time; time.sleep(10000000)
|
||||||
|
|
||||||
|
|
||||||
class BamIgnoreTest(BamSessionTestCase):
|
class BamIgnoreTest(BamSessionTestCase):
|
||||||
"""Checks out a project, creates a .bamignore file with a few rules
|
"""Checks out a project, creates a .bamignore file with a few rules
|
||||||
and tries to commit files that violate them.
|
and tries to commit files that violate them.
|
||||||
@@ -1419,6 +1467,7 @@ class BamIgnoreTest(BamSessionTestCase):
|
|||||||
# now check for status
|
# now check for status
|
||||||
self.assertRaises(RuntimeError, bam_run, ["status", ], session_path)
|
self.assertRaises(RuntimeError, bam_run, ["status", ], session_path)
|
||||||
|
|
||||||
|
|
||||||
class BamRemapTest(BamSimpleTestCase):
|
class BamRemapTest(BamSimpleTestCase):
|
||||||
""" Test remapping existing blend files via the 'bam remap' command.
|
""" Test remapping existing blend files via the 'bam remap' command.
|
||||||
note: this doesn't need any bam-session. simply a directory to work in.
|
note: this doesn't need any bam-session. simply a directory to work in.
|
||||||
|
@@ -63,6 +63,11 @@ class DirectoryAPI(Resource):
|
|||||||
items_list = []
|
items_list = []
|
||||||
|
|
||||||
for f in os.listdir(path_root_abs):
|
for f in os.listdir(path_root_abs):
|
||||||
|
|
||||||
|
# ignore svn internal paths
|
||||||
|
if f == ".svn":
|
||||||
|
continue
|
||||||
|
|
||||||
f_rel = os.path.join(path, f)
|
f_rel = os.path.join(path, f)
|
||||||
f_abs = os.path.join(path_root_abs, f)
|
f_abs = os.path.join(path_root_abs, f)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user