diff --git a/spec/lib/bundle_context_temporary_spec.rb b/spec/lib/bundle_context_temporary_spec.rb index 43c08e92..1b9bc587 100644 --- a/spec/lib/bundle_context_temporary_spec.rb +++ b/spec/lib/bundle_context_temporary_spec.rb @@ -10,7 +10,7 @@ end it "trims the trailing slash from the bundle directory" do - expect(revs_context.bundle_dir).to eq('spec/test_data/bundle_input_a') + expect(revs_context.bundle_dir).to eq('spec/test_data/flat_dir_images') end it '#setup_other should prune @file_attr' do diff --git a/spec/lib/csv_importer_spec.rb b/spec/lib/csv_importer_spec.rb index 05eac2f2..fe2fe71b 100644 --- a/spec/lib/csv_importer_spec.rb +++ b/spec/lib/csv_importer_spec.rb @@ -1,7 +1,7 @@ RSpec.describe CsvImporter do describe '#parse_to_hash' do let(:manifest) do - described_class.parse_to_hash("#{Rails.root}/spec/test_data/bundle_input_a/manifest.csv") + described_class.parse_to_hash("#{Rails.root}/spec/test_data/flat_dir_images/manifest.csv") end it "loads a CSV as a hash with indifferent access" do diff --git a/spec/lib/pre_assembly/bundle_spec.rb b/spec/lib/pre_assembly/bundle_spec.rb index 374bb2ee..b2ce5f75 100644 --- a/spec/lib/pre_assembly/bundle_spec.rb +++ b/spec/lib/pre_assembly/bundle_spec.rb @@ -254,7 +254,7 @@ let(:full) { revs.path_in_bundle(relative) } it "#path_in_bundle returns expected value" do - expect(revs.path_in_bundle(relative)).to eq('spec/test_data/bundle_input_a/abc/def.jpg') + expect(revs.path_in_bundle(relative)).to eq('spec/test_data/flat_dir_images/abc/def.jpg') end it "#relative_path returns expected value" do expect(revs.relative_path(revs.bundle_dir, full)).to eq(relative) diff --git a/spec/lib/pre_assembly/digital_object_spec.rb b/spec/lib/pre_assembly/digital_object_spec.rb index d8e618e0..5978ba5f 100644 --- a/spec/lib/pre_assembly/digital_object_spec.rb +++ b/spec/lib/pre_assembly/digital_object_spec.rb @@ -9,9 +9,9 @@ end let(:ps) do context_params.merge( - :bundle_dir => 'spec/test_data/bundle_input_g', + :bundle_dir => 'spec/test_data/images_jp2_tif', :content_md_creation => { style: 'default' }, - :progress_log_file => Tempfile.new('bundle_input_g').path, + :progress_log_file => Tempfile.new('images_jp2_tif').path, :project_name => 'ProjectBar', :project_style => {}, :staging_style => 'copy' diff --git a/spec/lib/pre_assembly/object_file_spec.rb b/spec/lib/pre_assembly/object_file_spec.rb index f4e9e96a..8ad9ae9d 100644 --- a/spec/lib/pre_assembly/object_file_spec.rb +++ b/spec/lib/pre_assembly/object_file_spec.rb @@ -1,7 +1,7 @@ RSpec.describe PreAssembly::ObjectFile do before do @f = described_class.new( - :path => 'spec/test_data/bundle_input_a/image1.tif' + :path => 'spec/test_data/flat_dir_images/image1.tif' ) end diff --git a/spec/models/bundle_context_spec.rb b/spec/models/bundle_context_spec.rb index 1a005c7b..7f39cd4c 100644 --- a/spec/models/bundle_context_spec.rb +++ b/spec/models/bundle_context_spec.rb @@ -1,9 +1,9 @@ RSpec.describe BundleContext, type: :model do subject(:bc) do BundleContext.new( - project_name: "SmokeTest", + project_name: "Images jp2 tif", content_structure: 1, - bundle_dir: "spec/test_data/bundle_input_g/", + bundle_dir: "spec/test_data/images_jp2_tif/", staging_style_symlink: false, content_metadata_creation: 1, user: user @@ -66,7 +66,7 @@ context "bundle_dir path does not exist" do it "object does not pass validation" do - expect { bc.bundle_dir = 'does/not/exist' }.to change { bc.valid? }.to(false) + expect { bc.bundle_dir = 'does/not/exist' }.to change { bc.valid? }.to(false) end end @@ -85,7 +85,7 @@ describe "#normalize_bundle_dir" do it "removes the trailing forward slash" do - expect(bc.normalize_bundle_dir).to eq "spec/test_data/bundle_input_g" + expect(bc.normalize_bundle_dir).to eq "spec/test_data/images_jp2_tif" end end @@ -109,7 +109,7 @@ describe "#path_in_bundle" do it "creates a relative path" do - expect(bc.path_in_bundle("manifest.csv")).to eq "spec/test_data/bundle_input_g/manifest.csv" + expect(bc.path_in_bundle("manifest.csv")).to eq "spec/test_data/images_jp2_tif/manifest.csv" end end @@ -119,12 +119,12 @@ describe "manifest_rows" do it "loads the manifest CSV" do - expect(CsvImporter).to receive(:parse_to_hash).with("spec/test_data/bundle_input_g/manifest.csv") + expect(CsvImporter).to receive(:parse_to_hash).with("spec/test_data/images_jp2_tif/manifest.csv") bc.manifest_rows end it "memoizes the manifest rows" do - expect(CsvImporter).to receive(:parse_to_hash).once.with("spec/test_data/bundle_input_g/manifest.csv").and_call_original + expect(CsvImporter).to receive(:parse_to_hash).once.with("spec/test_data/images_jp2_tif/manifest.csv").and_call_original 2.times { bc.manifest_rows } end diff --git a/spec/test_data/bundle_input_a/manifest.csv b/spec/test_data/bundle_input_a/manifest.csv deleted file mode 100644 index 161a0b78..00000000 --- a/spec/test_data/bundle_input_a/manifest.csv +++ /dev/null @@ -1,4 +0,0 @@ -format,sourceid,filename,label,year,inst_notes,prod_notes,has_more_metadata,description -"BW film","foo-1.0","image1.tif","Avus 1937","1937","","","" -"BW film","foo-2.1","image2.tif","Avus 1938","1938-1939","frames 6,7,8 glass slide broken","","X","" -"BW film","foo-2.2","image3.tif","Avus 1938, 1956","1938, 1956","strip 2 is duplicate; don't scan","","","yo, this is a description" diff --git a/spec/test_data/bundle_input_f/manifest.csv b/spec/test_data/bundle_input_f/manifest.csv deleted file mode 100644 index a89c2309..00000000 --- a/spec/test_data/bundle_input_f/manifest.csv +++ /dev/null @@ -1,4 +0,0 @@ -sourceid,folder,label,description -"bar-1.0","obj1","Label 1","This is a description for label 1" -"bar-2.1","obj2","Label 2","This is a description for label 1" -"bar-2.2","obj3","Label 3","This is a description for label 1" \ No newline at end of file diff --git a/spec/test_data/bundle_input_g/gn330dv6119/image1.jp2 b/spec/test_data/bundle_input_g/gn330dv6119/image1.jp2 deleted file mode 100644 index f708f83d..00000000 Binary files a/spec/test_data/bundle_input_g/gn330dv6119/image1.jp2 and /dev/null differ diff --git a/spec/test_data/bundle_input_g/gn330dv6119/image1.tif b/spec/test_data/bundle_input_g/gn330dv6119/image1.tif deleted file mode 100644 index 8f27d489..00000000 Binary files a/spec/test_data/bundle_input_g/gn330dv6119/image1.tif and /dev/null differ diff --git a/spec/test_data/bundle_input_g/gn330dv6119/image2.jp2 b/spec/test_data/bundle_input_g/gn330dv6119/image2.jp2 deleted file mode 100644 index 5cedd5dc..00000000 Binary files a/spec/test_data/bundle_input_g/gn330dv6119/image2.jp2 and /dev/null differ diff --git a/spec/test_data/bundle_input_g/gn330dv6119/image2.tif b/spec/test_data/bundle_input_g/gn330dv6119/image2.tif deleted file mode 100644 index c42191ae..00000000 Binary files a/spec/test_data/bundle_input_g/gn330dv6119/image2.tif and /dev/null differ diff --git a/spec/test_data/bundle_input_g/jy812bp9403/00/image1.tif b/spec/test_data/bundle_input_g/jy812bp9403/00/image1.tif deleted file mode 100644 index c42191ae..00000000 Binary files a/spec/test_data/bundle_input_g/jy812bp9403/00/image1.tif and /dev/null differ diff --git a/spec/test_data/bundle_input_g/jy812bp9403/00/image2.tif b/spec/test_data/bundle_input_g/jy812bp9403/00/image2.tif deleted file mode 100644 index c42191ae..00000000 Binary files a/spec/test_data/bundle_input_g/jy812bp9403/00/image2.tif and /dev/null differ diff --git a/spec/test_data/bundle_input_g/jy812bp9403/05/image1.jp2 b/spec/test_data/bundle_input_g/jy812bp9403/05/image1.jp2 deleted file mode 100644 index d3965bf0..00000000 Binary files a/spec/test_data/bundle_input_g/jy812bp9403/05/image1.jp2 and /dev/null differ diff --git a/spec/test_data/bundle_input_g/manifest.csv b/spec/test_data/bundle_input_g/manifest.csv deleted file mode 100644 index e0810c89..00000000 --- a/spec/test_data/bundle_input_g/manifest.csv +++ /dev/null @@ -1,4 +0,0 @@ -druid,sourceid,folder,label,description -"druid:jy812bp9403","bar-1.0","jy812bp9403","Label 1","This is a description for label 1" -"druid:tz250tk7584","bar-2.1","tz250tk7584","Label 2","This is a description for label 2" -"druid:gn330dv6119","bar-3.1","gn330dv6119","Label 3","This is a description for label 3" \ No newline at end of file diff --git a/spec/test_data/bundle_input_g/mods_template.xml b/spec/test_data/bundle_input_g/mods_template.xml deleted file mode 100644 index c1d61f70..00000000 --- a/spec/test_data/bundle_input_g/mods_template.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - still image - digital image - - Stuff - - - - A test item! - - - - a - <% if manifest_row[:label] %> - [[label]] - <% end %> - - <% if manifest_row[:description] %><%=manifest_row[:description]%><% end %> - [[sourceid]] - diff --git a/spec/test_data/bundle_input_g/tz250tk7584/00/image1.tif b/spec/test_data/bundle_input_g/tz250tk7584/00/image1.tif deleted file mode 100644 index 08b39232..00000000 Binary files a/spec/test_data/bundle_input_g/tz250tk7584/00/image1.tif and /dev/null differ diff --git a/spec/test_data/bundle_input_g/tz250tk7584/00/image2.tif b/spec/test_data/bundle_input_g/tz250tk7584/00/image2.tif deleted file mode 100644 index c42191ae..00000000 Binary files a/spec/test_data/bundle_input_g/tz250tk7584/00/image2.tif and /dev/null differ diff --git a/spec/test_data/bundle_input_a/checksums.txt b/spec/test_data/flat_dir_images/checksums.txt similarity index 100% rename from spec/test_data/bundle_input_a/checksums.txt rename to spec/test_data/flat_dir_images/checksums.txt diff --git a/spec/test_data/bundle_input_a/image1.tif b/spec/test_data/flat_dir_images/image1.tif similarity index 100% rename from spec/test_data/bundle_input_a/image1.tif rename to spec/test_data/flat_dir_images/image1.tif diff --git a/spec/test_data/bundle_input_a/image2.tif b/spec/test_data/flat_dir_images/image2.tif similarity index 100% rename from spec/test_data/bundle_input_a/image2.tif rename to spec/test_data/flat_dir_images/image2.tif diff --git a/spec/test_data/bundle_input_a/image3.tif b/spec/test_data/flat_dir_images/image3.tif similarity index 100% rename from spec/test_data/bundle_input_a/image3.tif rename to spec/test_data/flat_dir_images/image3.tif diff --git a/spec/test_data/flat_dir_images/manifest.csv b/spec/test_data/flat_dir_images/manifest.csv new file mode 100644 index 00000000..f72d2dc8 --- /dev/null +++ b/spec/test_data/flat_dir_images/manifest.csv @@ -0,0 +1,4 @@ +druid,format,sourceid,filename,label,year,inst_notes,prod_notes,has_more_metadata,description +"druid:oo000oo0000","BW film","foo-1.0","image1.tif","Avus 1937","1937","","","" +"druid:oo111oo1111","BW film","foo-2.1","image2.tif","Avus 1938","1938-1939","frames 6,7,8 glass slide broken","","X","" +"druid:oo222oo2222","BW film","foo-2.2","image3.tif","Avus 1938, 1956","1938, 1956","strip 2 is duplicate; don't scan","","","yo, this is a description" diff --git a/spec/test_data/bundle_input_a/manifest_badsourceid_column.csv b/spec/test_data/flat_dir_images/manifest_badsourceid_column.csv similarity index 100% rename from spec/test_data/bundle_input_a/manifest_badsourceid_column.csv rename to spec/test_data/flat_dir_images/manifest_badsourceid_column.csv diff --git a/spec/test_data/bundle_input_a/mods_template.xml b/spec/test_data/flat_dir_images/mods_template.xml similarity index 100% rename from spec/test_data/bundle_input_a/mods_template.xml rename to spec/test_data/flat_dir_images/mods_template.xml diff --git a/spec/test_data/obj_dirs_images/manifest.csv b/spec/test_data/obj_dirs_images/manifest.csv new file mode 100644 index 00000000..269490b3 --- /dev/null +++ b/spec/test_data/obj_dirs_images/manifest.csv @@ -0,0 +1,4 @@ +druid,sourceid,folder,label,description +"druid:oo000oo0000","bar-1.0","obj1","Label 1","This is a description for label 1" +"druid:oo111oo1111","bar-2.1","obj2","Label 2","This is a description for label 1" +"druid:oo222oo2222","bar-2.2","obj3","Label 3","This is a description for label 1" diff --git a/spec/test_data/bundle_input_f/mods_template.xml b/spec/test_data/obj_dirs_images/mods_template.xml similarity index 100% rename from spec/test_data/bundle_input_f/mods_template.xml rename to spec/test_data/obj_dirs_images/mods_template.xml diff --git a/spec/test_data/bundle_input_f/obj1/image1.tif b/spec/test_data/obj_dirs_images/obj1/image1.tif similarity index 100% rename from spec/test_data/bundle_input_f/obj1/image1.tif rename to spec/test_data/obj_dirs_images/obj1/image1.tif diff --git a/spec/test_data/bundle_input_f/obj1/image2.tif b/spec/test_data/obj_dirs_images/obj1/image2.tif similarity index 100% rename from spec/test_data/bundle_input_f/obj1/image2.tif rename to spec/test_data/obj_dirs_images/obj1/image2.tif diff --git a/spec/test_data/bundle_input_f/obj2/image1.tif b/spec/test_data/obj_dirs_images/obj2/image1.tif similarity index 100% rename from spec/test_data/bundle_input_f/obj2/image1.tif rename to spec/test_data/obj_dirs_images/obj2/image1.tif diff --git a/spec/test_data/bundle_input_f/obj2/image2.tif b/spec/test_data/obj_dirs_images/obj2/image2.tif similarity index 100% rename from spec/test_data/bundle_input_f/obj2/image2.tif rename to spec/test_data/obj_dirs_images/obj2/image2.tif diff --git a/spec/test_data/bundle_input_f/obj3/image1.tif b/spec/test_data/obj_dirs_images/obj3/image1.tif similarity index 100% rename from spec/test_data/bundle_input_f/obj3/image1.tif rename to spec/test_data/obj_dirs_images/obj3/image1.tif diff --git a/spec/test_data/bundle_input_f/obj3/image2.tif b/spec/test_data/obj_dirs_images/obj3/image2.tif similarity index 100% rename from spec/test_data/bundle_input_f/obj3/image2.tif rename to spec/test_data/obj_dirs_images/obj3/image2.tif diff --git a/spec/test_data/project_config_files/flat_dir_images.yaml b/spec/test_data/project_config_files/flat_dir_images.yaml new file mode 100644 index 00000000..93b55808 --- /dev/null +++ b/spec/test_data/project_config_files/flat_dir_images.yaml @@ -0,0 +1,36 @@ +# A project which uses a manifest for object discovery, one file per object + +project_style: + content_structure: 'simple_image' + +bundle_dir: 'spec/test_data/flat_dir_images' +staging_dir: 'tmp' +accession_items: ~ + +manifest: 'manifest.csv' +checksums_file: 'checksums.txt' +desc_md_template: 'mods_template.xml' + +progress_log_file: 'log/progress_flat_dir_images.yaml' +project_name: 'Flat Dir Images' + +validate_files: false + +publish_attr: + publish: 'no' + shelve: 'no' + preserve: 'yes' + +content_md_creation: + style: 'none' + +stageable_discovery: + glob: ~ + regex: ~ + +manifest_cols: + object_container: 'filename' + source_id: 'sourceid' + label: 'label' + +content_exclusion: ~ diff --git a/spec/test_data/project_config_files/folder_manifest.yaml b/spec/test_data/project_config_files/folder_manifest.yaml index f969778e..5ce6a3cc 100644 --- a/spec/test_data/project_config_files/folder_manifest.yaml +++ b/spec/test_data/project_config_files/folder_manifest.yaml @@ -4,7 +4,7 @@ project_style: content_structure: 'simple_image' -bundle_dir: 'spec/test_data/bundle_input_f' +bundle_dir: 'spec/test_data/obj_dirs_images' staging_dir: 'tmp' accession_items: ~ diff --git a/spec/test_data/project_config_files/local_dev_folder_manifest_noreg.yaml b/spec/test_data/project_config_files/local_dev_folder_manifest_noreg.yaml index 4669a541..aaebd585 100644 --- a/spec/test_data/project_config_files/local_dev_folder_manifest_noreg.yaml +++ b/spec/test_data/project_config_files/local_dev_folder_manifest_noreg.yaml @@ -5,7 +5,7 @@ project_style: content_structure: 'simple_image' -bundle_dir: 'spec/test_data/bundle_input_g' +bundle_dir: 'spec/test_data/images_jp2_tif' staging_dir: 'tmp' accession_items: ~ diff --git a/spec/test_data/project_config_files/obj_dirs_images.yaml b/spec/test_data/project_config_files/obj_dirs_images.yaml new file mode 100644 index 00000000..f7cc30d2 --- /dev/null +++ b/spec/test_data/project_config_files/obj_dirs_images.yaml @@ -0,0 +1,36 @@ +# An example of a project which has multiple files per object organized into folders. + +project_style: + content_structure: 'simple_image' + +bundle_dir: 'spec/test_data/obj_dirs_images' +staging_dir: 'tmp' +accession_items: ~ + +manifest: 'manifest.csv' +checksums_file: ~ +desc_md_template: 'mods_template.xml' + +progress_log_file: 'log/progress_obj_dirs_images.yaml' +project_name: 'Object Directories with Images' + +validate_files: false + +publish_attr: + publish: ~ + shelve: ~ + preserve: ~ + +content_md_creation: + style: 'none' + +stageable_discovery: + glob: ~ + regex: ~ + +manifest_cols: + object_container: 'folder' + source_id: 'sourceid' + label: 'label' + +content_exclusion: ~ diff --git a/spec/test_data/project_config_files/proj_revs.yaml b/spec/test_data/project_config_files/proj_revs.yaml index a0247919..ac2ad51c 100644 --- a/spec/test_data/project_config_files/proj_revs.yaml +++ b/spec/test_data/project_config_files/proj_revs.yaml @@ -3,7 +3,7 @@ project_style: content_structure: 'simple_image' -bundle_dir: 'spec/test_data/bundle_input_a/' +bundle_dir: 'spec/test_data/flat_dir_images/' staging_dir: 'tmp' accession_items: ~ manifest: 'manifest.csv' diff --git a/spec/test_data/project_config_files/proj_revs_bad_manifest.yaml b/spec/test_data/project_config_files/proj_revs_bad_manifest.yaml index 3be00211..8276b523 100644 --- a/spec/test_data/project_config_files/proj_revs_bad_manifest.yaml +++ b/spec/test_data/project_config_files/proj_revs_bad_manifest.yaml @@ -3,7 +3,7 @@ project_style: content_structure: 'simple_image' -bundle_dir: 'spec/test_data/bundle_input_a/' +bundle_dir: 'spec/test_data/flat_dir_images/' staging_dir: 'tmp' accession_items: ~ diff --git a/spec/test_data/project_config_files/proj_revs_no_cm.yaml b/spec/test_data/project_config_files/proj_revs_no_cm.yaml index f344a9f2..cab6041a 100644 --- a/spec/test_data/project_config_files/proj_revs_no_cm.yaml +++ b/spec/test_data/project_config_files/proj_revs_no_cm.yaml @@ -3,7 +3,7 @@ project_style: content_structure: 'simple_image' -bundle_dir: 'spec/test_data/bundle_input_a' +bundle_dir: 'spec/test_data/flat_dir_images' staging_dir: 'tmp' accession_items: ~ diff --git a/spec/test_data/project_config_files/proj_revs_old_druid.yaml b/spec/test_data/project_config_files/proj_revs_old_druid.yaml index d5ea488e..a045ef6b 100644 --- a/spec/test_data/project_config_files/proj_revs_old_druid.yaml +++ b/spec/test_data/project_config_files/proj_revs_old_druid.yaml @@ -3,7 +3,7 @@ project_style: content_structure: 'simple_image' -bundle_dir: 'spec/test_data/bundle_input_a' +bundle_dir: 'spec/test_data/flat_dir_images' staging_dir: 'tmp' accession_items: ~