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 97941fe44cffb1bfaa19f7928675e75264b18b5a
parent 70faab1b096d5ceca88bf972e918c5ee9610be89
Author: rsiddharth <s@ricketyspace.net>
Date:   Thu,  8 Dec 2016 03:39:04 +0000

Add `generate_wiki_page` function.

* gd_diff.py (generate_wiki_page): New function.
* tests/test_gd_diff.py (test_generate_wiki_page): Test for
`generate_wiki_page`.

Diffstat:
gd_diff.py | 9+++++++++
tests/test_gd_diff.py | 12++++++++++++
2 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/gd_diff.py b/gd_diff.py @@ -386,3 +386,12 @@ def gns_wiki_header(): """Return gNewSense wiki header.""" header = resource_string(__name__, 'gd-diff/data/wiki-header.txt') return header.decode() + + +def generate_wiki_page(release): + """Generate and return the gNewSense Debian Diff wiki page. + """ + pkgs_noreadmes, wiki_table = generate_wiki_table(release) + wiki_page = gns_wiki_header() + '\n' + wiki_table + + return pkgs_noreadmes, wiki_page diff --git a/tests/test_gd_diff.py b/tests/test_gd_diff.py @@ -449,6 +449,18 @@ class TestGdDiff(object): assert header == expected_header + def test_generate_wiki_page(self): + def mock_mk_pkgs_list(r): + return self.tiny_pkgs_file + + with mock.patch('os.getenv', new=self.env_func), \ + mock.patch('gd_diff.mk_pkgs_list', new=mock_mk_pkgs_list): + pkgs_noreadmes, wiki_page = generate_wiki_page('parkes') + pkgs_noreadmes, wiki_table = generate_wiki_table('parkes') + + assert wiki_page == gns_wiki_header() + '\n' + wiki_table + + def teardown(self): """Teardown method for this class.""" if(path.exists(self.gns_pkgs_dir)):