fixes and more tests
This commit is contained in:
@ -30,7 +30,7 @@ class TestZfsNode(unittest2.TestCase):
|
|||||||
|
|
||||||
#free up space
|
#free up space
|
||||||
r=shelltest("rm /test_target1/waste")
|
r=shelltest("rm /test_target1/waste")
|
||||||
r=shelltest("zpool sync")
|
r=shelltest("zfs umount test_target1")
|
||||||
|
|
||||||
#should resume and succeed
|
#should resume and succeed
|
||||||
with io.StringIO() as buf:
|
with io.StringIO() as buf:
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
from basetest import *
|
from basetest import *
|
||||||
import time
|
import time
|
||||||
|
import contextlib
|
||||||
|
import io
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -11,6 +13,19 @@ class TestZfsAutobackup(unittest2.TestCase):
|
|||||||
|
|
||||||
def test_defaults(self):
|
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 self.subTest("defaults with full verbose and debug"):
|
||||||
|
|
||||||
with patch('time.strftime', return_value="20101111000000"):
|
with patch('time.strftime', return_value="20101111000000"):
|
||||||
|
|||||||
Reference in New Issue
Block a user