@@ -1728,16 +1728,21 @@ def test_clone_project(client, data, username, expected):
17281728 assert resp .json ["code" ] == "StorageLimitHit"
17291729 assert resp .json ["detail" ] == "You have reached a data limit (StorageLimitHit)"
17301730 if expected == 200 :
1731+ excluded_filenames = current_app .config .get ("EXCLUDED_CLONE_FILENAMES" )
1732+
17311733 proj = data .get ("project" , test_project ).strip ()
17321734 template = Project .query .filter_by (
17331735 name = test_project , workspace_id = test_workspace_id
17341736 ).first ()
17351737 project = Project .query .filter_by (
17361738 name = proj , workspace_id = test_workspace_id
17371739 ).first ()
1740+ template_files_filtered = [
1741+ f for f in template .files if f .path not in excluded_filenames
1742+ ]
17381743 assert not any (
17391744 x .checksum != y .checksum and x .path != y .path
1740- for x , y in zip (project .files , template . files )
1745+ for x , y in zip (project .files , template_files_filtered )
17411746 )
17421747 assert os .path .exists (
17431748 os .path .join (project .storage .project_dir , project .files [0 ].location )
@@ -1755,6 +1760,12 @@ def test_clone_project(client, data, username, expected):
17551760 item for item in changes if item .change == PushChangeType .UPDATE .value
17561761 ]
17571762 assert pv .device_id == json_headers ["X-Device-Id" ]
1763+
1764+ assert not any (f .path == excluded_filenames [0 ] for f in project .files )
1765+ assert not os .path .exists (
1766+ os .path .join (project .storage .project_dir , excluded_filenames [0 ])
1767+ )
1768+ assert len (project .files ) == len (template .files ) - 1
17581769 # cleanup
17591770 shutil .rmtree (project .storage .project_dir )
17601771
@@ -2000,7 +2011,7 @@ def test_get_projects_by_uuids(client):
20002011 {"page" : 1 , "per_page" : 5 , "desc" : False },
20012012 200 ,
20022013 "v1" ,
2003- {"added" : 12 , "removed" : 0 , "updated" : 0 , "updated_diff" : 0 },
2014+ {"added" : 13 , "removed" : 0 , "updated" : 0 , "updated_diff" : 0 },
20042015 ),
20052016 (
20062017 {"page" : 2 , "per_page" : 3 , "desc" : True },
0 commit comments