|
|
@@ -245,7 +245,7 @@ class TestAllCommands(CommandTester): |
|
|
|
eq_(len(list(client2.stream_extract("/newton/prep"))), 0) |
|
|
|
|
|
|
|
# this should copy a bunch |
|
|
|
self.ok(f"-u {self.url} -U {self.url2} /newton*") |
|
|
|
self.ok(f"-u {self.url} -U {self.url2} /*") |
|
|
|
self.contain("Creating destination stream /newton/prep-copy", False) |
|
|
|
eq_(client1.stream_list(), client2.stream_list()) |
|
|
|
eq_(list(client1.stream_extract("/newton/prep")), |
|
|
@@ -553,6 +553,33 @@ class TestAllCommands(CommandTester): |
|
|
|
|
|
|
|
def test_08_cleanup(self): |
|
|
|
self.main = nilmtools.cleanup.main |
|
|
|
client = nilmdb.client.Client(url=self.url) |
|
|
|
|
|
|
|
# This mostly just gets coverage, doesn't carefully verify behavior |
|
|
|
self.fail(f"") |
|
|
|
self.ok(f"--help") |
|
|
|
|
|
|
|
self.fail(f"tests/data/cleanup-bad.cfg") |
|
|
|
self.contain("unknown units") |
|
|
|
|
|
|
|
client.stream_create("/empty/foo", "uint16_1") |
|
|
|
self.ok(f"tests/data/cleanup.cfg") |
|
|
|
self.contain("'/nonexistent/bar' did not match any existing streams") |
|
|
|
self.contain("no config for existing stream '/empty/foo'") |
|
|
|
self.contain("nothing to do (only 0.00 weeks of data present)") |
|
|
|
self.contain("specify --yes to actually perform") |
|
|
|
|
|
|
|
self.ok(f"--yes tests/data/cleanup.cfg") |
|
|
|
self.contain("removing data before") |
|
|
|
self.contain("removing from /sf/raw") |
|
|
|
|
|
|
|
self.ok(f"--estimate tests/data/cleanup.cfg") |
|
|
|
self.contain("Total estimated disk usage") |
|
|
|
self.contain("MiB") |
|
|
|
self.contain("GiB") |
|
|
|
|
|
|
|
self.ok(f"--yes tests/data/cleanup-nodecim.cfg") |
|
|
|
self.ok(f"--estimate tests/data/cleanup-nodecim.cfg") |
|
|
|
|
|
|
|
def test_09_trainola(self): |
|
|
|
self.main = nilmtools.trainola.main |
|
|
|