Skip to content

Commit

Permalink
Merge pull request #910 from MITLibraries/fix-metadata-csv-location
Browse files Browse the repository at this point in the history
Update location of metadata CSV in SIPs
  • Loading branch information
jazairi authored Feb 16, 2022
2 parents 515661d + 2fdd768 commit abc21b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/models/submission_information_package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def data
file_locations = {}
thesis.files.map { |f| file_locations["data/#{f.filename}"] = f.blob }

file_locations['data/metadata.csv'] = metadata
file_locations['data/metadata/metadata.csv'] = metadata

file_locations
end
Expand All @@ -55,7 +55,7 @@ def set_manifest
new_manifest = thesis.files.map { |f| "#{base64_to_hex(f.checksum)} data/#{f.filename}" }

# metadata file
new_manifest << "#{ArchivematicaMetadata.new(thesis).md5} data/metadata.csv"
new_manifest << "#{ArchivematicaMetadata.new(thesis).md5} data/metadata/metadata.csv"

self.manifest = new_manifest.join("\n")
end
Expand Down
4 changes: 2 additions & 2 deletions test/models/submission_information_package_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class SubmissionInformationPackageTest < ActiveSupport::TestCase
thesis = theses(:published)
checksums = []
checksums << "#{base64_to_hex(thesis.files.first.checksum)} data/a_pdf.pdf"
checksums << "#{ArchivematicaMetadata.new(thesis).md5} data/metadata.csv"
checksums << "#{ArchivematicaMetadata.new(thesis).md5} data/metadata/metadata.csv"
sip = thesis.submission_information_packages.create
assert_equal checksums.join("\n"), sip.manifest
end
Expand Down Expand Up @@ -102,7 +102,7 @@ class SubmissionInformationPackageTest < ActiveSupport::TestCase
t = theses(:published)
sip = t.submission_information_packages.create
expected = ArchivematicaMetadata.new(t).to_csv
assert_equal expected, sip.data['data/metadata.csv']
assert_equal expected, sip.data['data/metadata/metadata.csv']
end

test 'a SIP is valid if its thesis is baggable' do
Expand Down

0 comments on commit abc21b3

Please sign in to comment.