chiark / gitweb /
bundles: test, wip
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 3 May 2021 13:03:15 +0000 (14:03 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 3 May 2021 13:03:22 +0000 (14:03 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
apitest/at-otter.rs
examples/test-bundle.zip [new file with mode: 0644]

index c273ec57bcd53ed907d21b2bacafeb18c1bcf628..f06e9715068e491143e9a82ecf80653fbc502802 100644 (file)
@@ -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 (file)
index 0000000..d7616f7
--- /dev/null
@@ -0,0 +1 @@
+todo!