diff options
-rw-r--r-- | gd_diff.py | 4 | ||||
-rw-r--r-- | tests/test_gd_diff.py | 10 |
2 files changed, 14 insertions, 0 deletions
@@ -213,3 +213,7 @@ def slurp_fields_from_readme(content): def config_dir(): return os.path.join(os.getenv('HOME'), '.config', 'gns-deb-diff') + + +def config_file(): + return os.path.join(config_dir(), 'config') diff --git a/tests/test_gd_diff.py b/tests/test_gd_diff.py index 0120718..1b54f32 100644 --- a/tests/test_gd_diff.py +++ b/tests/test_gd_diff.py @@ -236,6 +236,16 @@ class TestGdDiff(object): '.config', 'gns-deb-diff')) + def test_config_file(self): + def env(e): + return self.test_home + + with mock.patch('os.getenv', new=env): + c_file = config_file() + assert_equal(c_file, os.path.join(self.test_home, '.config', + 'gns-deb-diff', 'config')) + + def teardown(self): """Teardown method for this class.""" if(path.exists(self.gns_pkgs_dir)): |