diff options
author | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2019-01-07 00:00:00 +0000 |
---|---|---|
committer | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2019-01-07 21:02:14 +0100 |
commit | c71b3281c5b9c190dbe66b864426baddda8ca7f8 (patch) | |
tree | cd7c8b3c59b11f6d8dbc06cb7e953c3275f98834 /tests | |
parent | e03cfd5856d203896e403f61ebc3283006c04d3d (diff) | |
download | dconf-c71b3281c5b9c190dbe66b864426baddda8ca7f8.tar.gz |
tests: Add integration test for dconf blame
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/test-dconf.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test-dconf.py b/tests/test-dconf.py index 88f6769..aa04ec7 100755 --- a/tests/test-dconf.py +++ b/tests/test-dconf.py @@ -105,6 +105,7 @@ class DBusTest(unittest.TestCase): os.mkdir(self.dbus_dir, mode=0o700) os.mkdir(os.path.join(self.config_home, 'dconf')) + os.environ['DCONF_BLAME'] = '' os.environ['XDG_RUNTIME_DIR'] = self.runtime_dir os.environ['XDG_CONFIG_HOME'] = self.config_home @@ -743,6 +744,22 @@ class DBusTest(unittest.TestCase): env=env, stderr=subprocess.PIPE) self.assertRegex(cm.exception.stderr, 'non-writable keys') + def test_dconf_blame(self): + """Blame returns recorded information about write operations. + + Recorded information include sender bus name, sender process id and + object path the write operations was invoked on. + """ + + p = subprocess.Popen([dconf_exe, 'write', '/prime', '307']) + p.wait() + + blame = dconf('blame').stdout + print(blame) + + self.assertRegex(blame, 'Sender: ') + self.assertRegex(blame, 'PID: {}'.format(p.pid)) + self.assertRegex(blame, 'Object path: /ca/desrt/dconf/Writer/user') if __name__ == '__main__': # Make sure we don't pick up mandatory profile. |