From 5fe96733a600c5872f79f1f051158098f6f377ab Mon Sep 17 00:00:00 2001 From: Simeon Warner Date: Mon, 21 Oct 2024 13:27:07 -0400 Subject: [PATCH] Rebuild demo output --- docs/demo_build_v1_0_spec_examples.md | 6 +-- docs/demo_build_v1_1_spec_examples.md | 6 +-- docs/demo_ocfl_object_script.md | 65 ++++++++++++++++++++++++--- docs/demo_using_bagit_bags.md | 4 +- tests/test_demo_ocfl_object_script.py | 5 +-- 5 files changed, 69 insertions(+), 17 deletions(-) diff --git a/docs/demo_build_v1_0_spec_examples.md b/docs/demo_build_v1_0_spec_examples.md index 53e6675..8b5a773 100644 --- a/docs/demo_build_v1_0_spec_examples.md +++ b/docs/demo_build_v1_0_spec_examples.md @@ -100,7 +100,7 @@ This is inventory should match the example with 3 versions in python ocfl-object.py extract --objver v2 --objdir fixtures/1.1/good-objects/spec-ex-full --dstdir tmp/v2 -v @@ -149,6 +149,17 @@ INFO:root:Extracted v2 into tmp/v2 Extracted content for v2 in tmp/v2 ``` +and the extracted files are: + +``` +> find tmp/v2 -print +tmp/v2 +tmp/v2/empty.txt +tmp/v2/empty2.txt +tmp/v2/foo +tmp/v2/foo/bar.xml +``` + ### 5.3 Extract head version (v3) of content in the same OCFL v1.1 object @@ -158,6 +169,48 @@ INFO:root:Extracted v3 into tmp/head Extracted content for v3 in tmp/head ``` +and the extracted files are: + +``` +> find tmp/v3 -print +find: tmp/v3: No such file or directory +``` + +(last command exited with return code 1) + + +### 5.4 Extract foo/bar.xml of v3 into a new directory + +``` +> python ocfl-object.py extract --objver v3 --objdir fixtures/1.1/good-objects/spec-ex-full --logical-path foo/bar.xml --dstdir tmp/files -v +Extracted foo/bar.xml in v3 to tmp/files +``` + +and the extracted file is: + +``` +> find tmp/files -print +tmp/files +tmp/files/bar.xml +``` + + +### 5.5 Extract image.tiff of v3 (default) into the same directory + +``` +> python ocfl-object.py extract --objdir fixtures/1.1/good-objects/spec-ex-full --logical-path image.tiff --dstdir tmp/files -v +Extracted image.tiff in v3 to tmp/files +``` + +and the directory now contains two extracted files: + +``` +> find tmp/files -print +tmp/files +tmp/files/image.tiff +tmp/files/bar.xml +``` + ## 6. Test error conditions. diff --git a/docs/demo_using_bagit_bags.md b/docs/demo_using_bagit_bags.md index 8837138..409023b 100644 --- a/docs/demo_using_bagit_bags.md +++ b/docs/demo_using_bagit_bags.md @@ -161,8 +161,8 @@ Taking the newly created OCFL object `/tmp/obj` we can `--extract` the `v4` cont INFO:root:Extracted v4 into tmp/extracted_v4 INFO:bagit:Creating bag for directory tmp/extracted_v4 INFO:bagit:Creating data directory -INFO:bagit:Moving my_content to /privatetmp/extracted_v4/tmp7apb1l_h/my_content -INFO:bagit:Moving /privatetmp/extracted_v4/tmp7apb1l_h to data +INFO:bagit:Moving my_content to /privatetmp/extracted_v4/tmp1ilh36tg/my_content +INFO:bagit:Moving /privatetmp/extracted_v4/tmp1ilh36tg to data INFO:bagit:Using 1 processes to generate manifests: sha512 INFO:bagit:Generating manifest lines for file data/my_content/dracula.txt INFO:bagit:Generating manifest lines for file data/my_content/dunwich.txt diff --git a/tests/test_demo_ocfl_object_script.py b/tests/test_demo_ocfl_object_script.py index e2dbf73..aecf9f6 100644 --- a/tests/test_demo_ocfl_object_script.py +++ b/tests/test_demo_ocfl_object_script.py @@ -117,9 +117,8 @@ def test04_extract(self): text="and the extracted file is:") self.assertEqual(os.path.getsize(os.path.join(self.tmpdir, "files/bar.xml")), 272) # Extract individual file into dir that exists - out = self.run_script("Extract image.tiff of v3 into the same directory", + out = self.run_script("Extract image.tiff of v3 (default) into the same directory", ["python", "ocfl-object.py", "extract", - "--objver", "v3", "--objdir", "fixtures/1.1/good-objects/spec-ex-full", "--logical-path", "image.tiff", "--dstdir", "TMPDIR/files", @@ -127,7 +126,7 @@ def test04_extract(self): self.assertIn('Extracted image.tiff in v3', out) out = self.run_script(None, ["find", "TMPDIR/files", "-print"], - text="and the directort now contains two extracted files:") + text="and the directory now contains two extracted files:") self.assertEqual(os.path.getsize(os.path.join(self.tmpdir, "files/image.tiff")), 2021) def test20_errors(self):