From 09b5d429019dceb9ff5e5c80a819200df0610bb1 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 3 May 2021 14:03:15 +0100 Subject: [PATCH] bundles: test, wip Signed-off-by: Ian Jackson --- apitest/at-otter.rs | 11 +++++++++++ examples/test-bundle.zip | 1 + 2 files changed, 12 insertions(+) create mode 100644 examples/test-bundle.zip diff --git a/apitest/at-otter.rs b/apitest/at-otter.rs index c273ec57..f06e9715 100644 --- a/apitest/at-otter.rs +++ b/apitest/at-otter.rs @@ -690,6 +690,16 @@ impl Ctx { self.otter(&command).context(perm).context(game)?; } } + + #[throws(Explode)] + fn bundles(&mut self) { + let bundle_file = self.su().ds.subst("@src@/examples/test-bundle.zip")?; + let ds = self.su().ds.also(&[("bundle", bundle_file)]); + self.otter(&ds.ss("upload-bundle @table@ @bundle@")?)?; + let mut bundles = self.otter(&ds.ss("list-bundles @table@")?)?; + let bundles = String::from(&mut bundles); + assert!(bundles.starts_with("00000.zip Loaded")); + } } #[throws(AE)] @@ -697,6 +707,7 @@ fn tests(mut c: Ctx) { test!(c, "library-load", c.chdir_root(|c| c.library_load() )); test!(c, "hidden-hand", c.hidden_hand() ?); test!(c, "specs", c.chdir_root(|c| c.specs() )); + test!(c, "bundles", c.bundles() ?); } #[throws(AE)] diff --git a/examples/test-bundle.zip b/examples/test-bundle.zip new file mode 100644 index 00000000..d7616f71 --- /dev/null +++ b/examples/test-bundle.zip @@ -0,0 +1 @@ +todo! -- 2.30.2