From 2143d22ae5a63d50a7e6fb8303c465c04cac1512 Mon Sep 17 00:00:00 2001 From: Edwin Eefting Date: Sun, 17 May 2020 17:11:52 +0200 Subject: [PATCH] test stuff --- basetest.py | 6 +++--- test_zfsautobackup.py | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/basetest.py b/basetest.py index c402cea..791c606 100644 --- a/basetest.py +++ b/basetest.py @@ -30,9 +30,9 @@ def prepare_zpools(): subprocess.check_call("modprobe brd rd_size=512000", shell=True) #remove old stuff - subprocess.call("zpool destroy test_source1", shell=True) - subprocess.call("zpool destroy test_source2", shell=True) - subprocess.call("zpool destroy test_target1", shell=True) + subprocess.call("zpool destroy test_source1 2>/dev/null", shell=True) + subprocess.call("zpool destroy test_source2 2>/dev/null", shell=True) + subprocess.call("zpool destroy test_target1 2>/dev/null", shell=True) #create pools subprocess.check_call("zpool create test_source1 /dev/ram0", shell=True) diff --git a/test_zfsautobackup.py b/test_zfsautobackup.py index 21e4aaa..239121b 100644 --- a/test_zfsautobackup.py +++ b/test_zfsautobackup.py @@ -8,4 +8,8 @@ class TestZfsAutobackup(unittest.TestCase): return super().setUp() def test_defaults(self): - self.assertFalse(ZfsAutobackup("test test_target1".split(" ")).run()) + with self.subTest("defaults with full verbose and debug"): + self.assertFalse(ZfsAutobackup("test test_target1 --verbose --debug".split(" ")).run()) + + with self.subTest("bare defaults"): + self.assertFalse(ZfsAutobackup("test test_target1".split(" ")).run())