diff options
author | Martin Pitt <martin.pitt@ubuntu.com> | 2015-01-21 09:45:15 +0100 |
---|---|---|
committer | Martin Pitt <martin.pitt@ubuntu.com> | 2015-01-21 09:45:15 +0100 |
commit | 56401ac57a543395d06690768e63b92633ad15dd (patch) | |
tree | 4db6ddad9134268f0f5fc7dd1857c8e8a7ccc2ec /test/sysv-generator-test.py | |
parent | e28aa588f04ace17ca94e9e0667819bea265fbd9 (diff) |
systemd-sysv-generator test: don't parse symlinks
Generated services which are symlinks should be tested/handled differently from
files, so ignore them in run_generator()'s result parsing.
Diffstat (limited to 'test/sysv-generator-test.py')
-rw-r--r-- | test/sysv-generator-test.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/test/sysv-generator-test.py b/test/sysv-generator-test.py index 028de91eab..492e99d834 100644 --- a/test/sysv-generator-test.py +++ b/test/sysv-generator-test.py @@ -74,6 +74,8 @@ class SysvGeneratorTest(unittest.TestCase): results = {} for service in glob(self.out_dir + '/*.service'): + if os.path.islink(service): + continue cp = RawConfigParser() cp.optionxform = lambda o: o # don't lower-case option names with open(service) as f: @@ -260,8 +262,9 @@ class SysvGeneratorTest(unittest.TestCase): '''multiple Provides: names''' self.add_sysv('foo', {'Provides': 'foo bar baz'}) - s = self.run_generator()[1]['foo.service'] - self.assertEqual(set(s.options('Unit')), + err, results = self.run_generator() + self.assertEqual(list(results), ['foo.service']) + self.assertEqual(set(results['foo.service'].options('Unit')), set(['Documentation', 'SourcePath', 'Description'])) # should create symlinks for the alternative names for f in ['bar.service', 'baz.service']: |