gns-deb-diff

automate the documentation of the differences between gNewSense and Debian.
git clone git://git.ricketyspace.net/gns-deb-diff.git
Log | Files | Refs

commit da1c3d97e01882c90f276173df54b4bdfbc58452
parent b2b065cbb8aa2c48c1058ab22efeae3f5bfbe9b2
Author: rsiddharth <s@ricketyspace.net>
Date:   Sun, 13 Nov 2016 00:51:22 +0000

Add `config_file` function.

* gd_diff.py (config_file): New function.
* tests/test_gd_diff.py (test_config_file): Test function for
`config_file` function.

Diffstat:
gd_diff.py | 4++++
tests/test_gd_diff.py | 10++++++++++
2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/gd_diff.py b/gd_diff.py @@ -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 @@ -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)):