mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-26 09:47:58 +00:00
Add more tests to PatternTestCase. The first two fail with the
current code.
This commit is contained in:
parent
4271ffa25f
commit
59c8008436
1 changed files with 9 additions and 4 deletions
|
@ -50,7 +50,7 @@ def test(self):
|
||||||
class PatternTestCase(AtticTestCase):
|
class PatternTestCase(AtticTestCase):
|
||||||
|
|
||||||
files = [
|
files = [
|
||||||
'/etc/passwd', '/etc/hosts',
|
'/etc/passwd', '/etc/hosts', '/home',
|
||||||
'/home/user/.profile', '/home/user/.bashrc',
|
'/home/user/.profile', '/home/user/.bashrc',
|
||||||
'/home/user2/.profile', '/home/user2/public_html/index.html',
|
'/home/user2/.profile', '/home/user2/public_html/index.html',
|
||||||
'/var/log/messages', '/var/log/dmesg',
|
'/var/log/messages', '/var/log/dmesg',
|
||||||
|
@ -63,11 +63,16 @@ def evaluate(self, paths, excludes):
|
||||||
def test(self):
|
def test(self):
|
||||||
self.assert_equal(self.evaluate(['/'], ['/home']),
|
self.assert_equal(self.evaluate(['/'], ['/home']),
|
||||||
['/etc/passwd', '/etc/hosts', '/var/log/messages', '/var/log/dmesg'])
|
['/etc/passwd', '/etc/hosts', '/var/log/messages', '/var/log/dmesg'])
|
||||||
|
self.assert_equal(self.evaluate(['/'], ['/home/']),
|
||||||
|
['/etc/passwd', '/etc/hosts', '/home', '/var/log/messages', '/var/log/dmesg'])
|
||||||
|
self.assert_equal(self.evaluate(['/home/u'], []), [])
|
||||||
|
self.assert_equal(self.evaluate(['/home/'], ['/home/user2']),
|
||||||
|
['/home', '/home/user/.profile', '/home/user/.bashrc'])
|
||||||
self.assert_equal(self.evaluate(['/'], ['*.profile', '/var/log']),
|
self.assert_equal(self.evaluate(['/'], ['*.profile', '/var/log']),
|
||||||
['/etc/passwd', '/etc/hosts', '/home/user/.bashrc', '/home/user2/public_html/index.html'])
|
['/etc/passwd', '/etc/hosts', '/home', '/home/user/.bashrc', '/home/user2/public_html/index.html'])
|
||||||
self.assert_equal(self.evaluate(['/'], ['/home/*/public_html', '*.profile', '*/log/*']),
|
self.assert_equal(self.evaluate(['/'], ['/home/*/public_html', '*.profile', '*/log/*']),
|
||||||
['/etc/passwd', '/etc/hosts', '/home/user/.bashrc'])
|
['/etc/passwd', '/etc/hosts', '/home', '/home/user/.bashrc'])
|
||||||
self.assert_equal(self.evaluate(['/etc', '/var'], ['dmesg']),
|
self.assert_equal(self.evaluate(['/etc/', '/var'], ['dmesg']),
|
||||||
['/etc/passwd', '/etc/hosts', '/var/log/messages', '/var/log/dmesg'])
|
['/etc/passwd', '/etc/hosts', '/var/log/messages', '/var/log/dmesg'])
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue