diff --git a/tests/blends/variations/cone.blue.blend b/tests/blends/variations/cone.blue.blend new file mode 100644 index 0000000..d9db754 Binary files /dev/null and b/tests/blends/variations/cone.blue.blend differ diff --git a/tests/blends/variations/cone.red.blend b/tests/blends/variations/cone.red.blend new file mode 100644 index 0000000..713b6ee Binary files /dev/null and b/tests/blends/variations/cone.red.blend differ diff --git a/tests/blends/variations/lib_endpoint.blend b/tests/blends/variations/lib_endpoint.blend new file mode 100644 index 0000000..0f68dad Binary files /dev/null and b/tests/blends/variations/lib_endpoint.blend differ diff --git a/tests/blends/variations/lib_user.blend b/tests/blends/variations/lib_user.blend new file mode 100644 index 0000000..312666d Binary files /dev/null and b/tests/blends/variations/lib_user.blend differ diff --git a/tests/test_cli.py b/tests/test_cli.py index 9c9f4e3..8a5f75e 100755 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -711,7 +711,7 @@ class BamListTest(BamSessionTestCase): ret = bam_run_as_json(["ls", "--json"], proj_path) - self.assertEqual(1, len(ret)) + self.assertEqual([], []) class BamCommitTest(BamSessionTestCase): @@ -1356,6 +1356,54 @@ class BamRelativeAbsoluteTest(BamSessionTestCase): # 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): """Checks out a project, creates a .bamignore file with a few rules and tries to commit files that violate them. @@ -1419,6 +1467,7 @@ class BamIgnoreTest(BamSessionTestCase): # now check for status self.assertRaises(RuntimeError, bam_run, ["status", ], session_path) + class BamRemapTest(BamSimpleTestCase): """ Test remapping existing blend files via the 'bam remap' command. note: this doesn't need any bam-session. simply a directory to work in. diff --git a/webservice/bam/application/modules/resources/__init__.py b/webservice/bam/application/modules/resources/__init__.py index dda909f..66acbda 100644 --- a/webservice/bam/application/modules/resources/__init__.py +++ b/webservice/bam/application/modules/resources/__init__.py @@ -63,6 +63,11 @@ class DirectoryAPI(Resource): items_list = [] for f in os.listdir(path_root_abs): + + # ignore svn internal paths + if f == ".svn": + continue + f_rel = os.path.join(path, f) f_abs = os.path.join(path_root_abs, f)