mirror of
https://github.com/psy0rz/zfs_autobackup.git
synced 2025-04-13 22:47:12 +03:00
fixes and more tests
This commit is contained in:
parent
8176326126
commit
a6cdd4b89e
@ -30,7 +30,7 @@ class TestZfsNode(unittest2.TestCase):
|
||||
|
||||
#free up space
|
||||
r=shelltest("rm /test_target1/waste")
|
||||
r=shelltest("zpool sync")
|
||||
r=shelltest("zfs umount test_target1")
|
||||
|
||||
#should resume and succeed
|
||||
with io.StringIO() as buf:
|
||||
|
@ -1,5 +1,7 @@
|
||||
from basetest import *
|
||||
import time
|
||||
import contextlib
|
||||
import io
|
||||
|
||||
|
||||
|
||||
@ -11,6 +13,19 @@ class TestZfsAutobackup(unittest2.TestCase):
|
||||
|
||||
def test_defaults(self):
|
||||
|
||||
with self.subTest("no datasets selected"):
|
||||
#should resume and succeed
|
||||
|
||||
with io.StringIO() as buf:
|
||||
with contextlib.redirect_stderr(buf):
|
||||
with patch('time.strftime', return_value="20101111000000"):
|
||||
self.assertTrue(ZfsAutobackup("nonexisting test_target1 --verbose --debug".split(" ")).run())
|
||||
|
||||
print(buf.getvalue())
|
||||
#did we really resume?
|
||||
self.assertIn("No source filesystems selected", buf.getvalue())
|
||||
|
||||
|
||||
with self.subTest("defaults with full verbose and debug"):
|
||||
|
||||
with patch('time.strftime', return_value="20101111000000"):
|
||||
|
Loading…
x
Reference in New Issue
Block a user