diff options
author | Michael Adam <obnox@samba.org> | 2016-12-13 11:02:55 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2017-03-28 14:12:07 +0100 |
commit | 5e370ce0e660dbbc534f0572b0183c522f410d43 (patch) | |
tree | c9378daf8a9c785f028db034a86506f213c34dd4 /tests | |
parent | 5de1a92338343252a15ce6ed9e4a1a538c89f264 (diff) | |
download | sos-5e370ce0e660dbbc534f0572b0183c522f410d43.tar.gz |
[plugins] add tests for add_copy_spec_limit()
- a test with a single file without limit
- a test with a single glob without limit
Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/plugin_tests.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/plugin_tests.py b/tests/plugin_tests.py index 00f221d3..d3e67b57 100644 --- a/tests/plugin_tests.py +++ b/tests/plugin_tests.py @@ -253,6 +253,10 @@ class AddCopySpecTests(unittest.TestCase): # add_copy_spec_limit() + def test_single_file_no_limit(self): + self.mp.add_copy_spec_limit("tests/tail_test.txt") + self.assert_expect_paths() + def test_single_file_under_limit(self): self.mp.add_copy_spec_limit("tests/tail_test.txt", 1) self.assert_expect_paths() @@ -273,6 +277,15 @@ class AddCopySpecTests(unittest.TestCase): self.assertFalse(self.mp.add_copy_spec_limit('', 1)) self.assertFalse(self.mp.add_copy_spec_limit(None, 1)) + def test_glob_file_limit_no_limit(self): + self.mp.sysroot = '/' + tmpdir = tempfile.mkdtemp() + fn = create_file(2, dir=tmpdir) + fn2 = create_file(2, dir=tmpdir) + self.mp.add_copy_spec_limit(tmpdir + "/*") + self.assertEquals(len(self.mp.copy_paths), 2) + shutil.rmtree(tmpdir) + def test_glob_file_over_limit(self): self.mp.sysroot = '/' tmpdir = tempfile.mkdtemp() |