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 b2b065cbb8aa2c48c1058ab22efeae3f5bfbe9b2
parent 859079274081b6160aa09a55fa6a67075ff62b37
Author: rsiddharth <s@ricketyspace.net>
Date:   Sun, 13 Nov 2016 00:47:39 +0000

Add `config_dir` function.

* gd_diff.py (config_dir): New function.
* tests/test_gd_diff.py (test_config_dir): Add test function for
  `config_dir`.

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 @@ -209,3 +209,7 @@ def slurp_fields_from_readme(content): field_values[field] = None return field_values + + +def config_dir(): + return os.path.join(os.getenv('HOME'), '.config', 'gns-deb-diff') diff --git a/tests/test_gd_diff.py b/tests/test_gd_diff.py @@ -226,6 +226,16 @@ class TestGdDiff(object): 'Removed example with non-free files.') + def test_config_dir(self): + def env(e): + return self.test_home + + with mock.patch('os.getenv', new=env): + c_dir = config_dir() + assert_equal(c_dir, os.path.join(self.test_home, + '.config', 'gns-deb-diff')) + + def teardown(self): """Teardown method for this class.""" if(path.exists(self.gns_pkgs_dir)):