Skip to content

Commit

Permalink
fix test, fix software version in premis event
Browse files Browse the repository at this point in the history
  • Loading branch information
shsdev committed Nov 26, 2024
1 parent 9635541 commit 5716998
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions eatb/metadata/premis_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ def to_string(self):
return etree.tostring(self.root, encoding='UTF-8', pretty_print=True, xml_declaration=True)

def create(self, path, type, subtype):
premis_file_name = "premis_earkweb_%s_%s_%s.xml" % (ts_date(fmt=DT_ISO_FORMAT_FILENAME), type, subtype)
premis_file_name = f"premis_{type}_{subtype}_{ts_date(fmt=DT_ISO_FORMAT_FILENAME)}.xml"
path_premis = os.path.join(self.working_dir, path, premis_file_name)
with open(path_premis, 'w') as output_file:
with open(path_premis, 'w', encoding="utf-8") as output_file:
output_file.write(self.to_string().decode('UTF-8'))


6 changes: 2 additions & 4 deletions tests/test_ocfl_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@

OCFL_TEST_RESOURCES = os.path.join(ROOT, 'tests/test_resources/ocfl-storage/')
EXAMPLE_WORKING_DIR = os.path.join(OCFL_TEST_RESOURCES, 'working-dir')
# TMP_DIRECTORY = '/tmp/temp-' + randomutils.randomword(10) + "/"
TMP_DIRECTORY = '/home/shs/earkweb/tmp' + randomutils.randomword(10) + "/"
TMP_DIRECTORY = '/tmp/temp-' + randomutils.randomword(10) + "/"
TMP_WORKING_DIRECTORY = TMP_DIRECTORY + 'workingdir'
TMP_AIP_DIRECTORY = TMP_DIRECTORY + 'aipdir'
AIP_DATA_DIR = os.path.join(TMP_AIP_DIRECTORY, "data")
Expand Down Expand Up @@ -55,8 +54,7 @@ def setUpClass(cls):

@classmethod
def tearDownClass(cls):
pass
#shutil.rmtree(TMP_DIRECTORY)
shutil.rmtree(TMP_DIRECTORY)

def test_1_tmp_working_dir_file_access(self):
"""Test file access in temporary package"""
Expand Down

0 comments on commit 5716998

Please sign in to comment.