@@ -428,3 +428,32 @@ def test_missing_basefile_pull(mc):
428428 # try to sync again -- it should not crash
429429 mc .pull_project (project_dir )
430430 mc .push_project (project_dir )
431+
432+
433+ def test_empty_file_in_subdir (mc ):
434+ """ Test pull of a project where there is an empty file in a sub-directory """
435+
436+ test_project = 'test_empty_file_in_subdir'
437+ project = API_USER + '/' + test_project
438+ project_dir = os .path .join (TMP_DIR , test_project ) # primary project dir for updates
439+ project_dir_2 = os .path .join (TMP_DIR , test_project + '_2' ) # concurrent project dir
440+ test_data_dir = os .path .join (os .path .dirname (os .path .realpath (__file__ )), test_project )
441+
442+ cleanup (mc , project , [project_dir , project_dir_2 ])
443+ # create remote project
444+ shutil .copytree (test_data_dir , project_dir )
445+ mc .create_project_and_push (test_project , project_dir )
446+
447+ # try to check out the project
448+ mc .download_project (project , project_dir_2 )
449+ assert os .path .exists (os .path .join (project_dir_2 , 'subdir' , 'empty.txt' ))
450+
451+ # add another empty file in a different subdir
452+ os .mkdir (os .path .join (project_dir , 'subdir2' ))
453+ shutil .copy (os .path .join (project_dir , 'subdir' , 'empty.txt' ),
454+ os .path .join (project_dir , 'subdir2' , 'empty2.txt' ))
455+ mc .push_project (project_dir )
456+
457+ # check that pull works fine
458+ mc .pull_project (project_dir_2 )
459+ assert os .path .exists (os .path .join (project_dir_2 , 'subdir2' , 'empty2.txt' ))
0 commit comments