summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTomasz Miąsko <tomasz.miasko@gmail.com>2018-11-14 00:00:00 +0000
committerTomasz Miąsko <tomasz.miasko@gmail.com>2018-11-15 23:43:53 +0100
commit66d32800f57a075603dc3e9e40793077a9bbafcf (patch)
tree7d3cf6cb7a32f0c5d1ddd5a736b50870e60e99a9 /tests
parentd9748d753f34a030ee483e7723037ec4d335fae3 (diff)
downloaddconf-66d32800f57a075603dc3e9e40793077a9bbafcf.tar.gz
tests: dconf ignores files starting with a dot
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test-dconf.py32
1 files changed, 29 insertions, 3 deletions
diff --git a/tests/test-dconf.py b/tests/test-dconf.py
index e7ff747..64d3337 100755
--- a/tests/test-dconf.py
+++ b/tests/test-dconf.py
@@ -98,6 +98,7 @@ class DBusTest(unittest.TestCase):
os.mkdir(self.runtime_dir, mode=0o700)
os.mkdir(self.config_home, mode=0o700)
os.mkdir(self.dbus_dir, mode=0o700)
+ os.mkdir(os.path.join(self.config_home, 'dconf'))
os.environ['XDG_RUNTIME_DIR'] = self.runtime_dir
os.environ['XDG_CONFIG_HOME'] = self.config_home
@@ -475,9 +476,6 @@ class DBusTest(unittest.TestCase):
user_d = os.path.join(self.temporary_dir.name, 'user.d')
os.mkdir(user_d, mode=0o700)
- # Required from compile utility specifically.
- os.mkdir(os.path.join(self.config_home, 'dconf'), mode=0o700)
-
def write_config_d(name):
keyfile = dedent('''
[org]
@@ -542,6 +540,34 @@ class DBusTest(unittest.TestCase):
dconf('reset', '-f', '/non-existing/directory/')
self.assertEqual(saved_mtime, os.path.getmtime(config))
+ def test_compile_dotfiles(self):
+ """Compile ignores files starting with a dot."""
+
+ user_d = os.path.join(self.temporary_dir.name, 'user.d')
+ os.mkdir(user_d)
+
+ a_conf = dedent('''\
+ [math]
+ a=42
+ ''')
+
+ a_conf_swp = dedent('''\
+ [math]
+ b=13
+ ''')
+
+ with open(os.path.join(user_d, 'a.conf'), 'w') as file:
+ file.write(a_conf)
+
+ with open(os.path.join(user_d, '.a.conf.swp'), 'w') as file:
+ file.write(a_conf_swp)
+
+ dconf('compile',
+ os.path.join(self.config_home, 'dconf', 'user'),
+ user_d)
+
+ self.assertEqual(a_conf, dconf('dump', '/').stdout)
+
if __name__ == '__main__':
# Make sure we don't pick up mandatory profile.