From 5e370ce0e660dbbc534f0572b0183c522f410d43 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 13 Dec 2016 11:02:55 +0100 Subject: [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 --- tests/plugin_tests.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests') 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() -- cgit