@@ -1731,16 +1731,21 @@ def test_clone_project(client, data, username, expected):
17311731 assert resp .json ["code" ] == "StorageLimitHit"
17321732 assert resp .json ["detail" ] == "You have reached a data limit (StorageLimitHit)"
17331733 if expected == 200 :
1734+ excluded_filenames = current_app .config .get ("EXCLUDED_CLONE_FILENAMES" )
1735+
17341736 proj = data .get ("project" , test_project ).strip ()
17351737 template = Project .query .filter_by (
17361738 name = test_project , workspace_id = test_workspace_id
17371739 ).first ()
17381740 project = Project .query .filter_by (
17391741 name = proj , workspace_id = test_workspace_id
17401742 ).first ()
1743+ template_files_filtered = [
1744+ f for f in template .files if f .path not in excluded_filenames
1745+ ]
17411746 assert not any (
17421747 x .checksum != y .checksum and x .path != y .path
1743- for x , y in zip (project .files , template . files )
1748+ for x , y in zip (project .files , template_files_filtered )
17441749 )
17451750 assert os .path .exists (
17461751 os .path .join (project .storage .project_dir , project .files [0 ].location )
@@ -1758,6 +1763,12 @@ def test_clone_project(client, data, username, expected):
17581763 item for item in changes if item .change == PushChangeType .UPDATE .value
17591764 ]
17601765 assert pv .device_id == json_headers ["X-Device-Id" ]
1766+
1767+ assert not any (f .path == excluded_filenames [0 ] for f in project .files )
1768+ assert not os .path .exists (
1769+ os .path .join (project .storage .project_dir , excluded_filenames [0 ])
1770+ )
1771+ assert len (project .files ) == len (template .files ) - 1
17611772 # cleanup
17621773 shutil .rmtree (project .storage .project_dir )
17631774
@@ -1988,7 +1999,7 @@ def test_get_projects_by_uuids(client):
19881999 {"page" : 1 , "per_page" : 5 , "desc" : False },
19892000 200 ,
19902001 "v1" ,
1991- {"added" : 12 , "removed" : 0 , "updated" : 0 , "updated_diff" : 0 },
2002+ {"added" : 13 , "removed" : 0 , "updated" : 0 , "updated_diff" : 0 },
19922003 ),
19932004 (
19942005 {"page" : 2 , "per_page" : 3 , "desc" : True },
0 commit comments