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 cf4d1f9279f88deb2d920f9fc611d29378168a87
parent 28b33ad545d0444a0477473eaf17f79af483216c
Author: rsiddharth <s@ricketyspace.net>
Date:   Sun, 30 Oct 2016 00:58:52 +0000

Add `read_gns_readme` function.

* gd_diff.py (read_gns_readme): New function.
* tests/test_gd_diff.py (test_read_gns_readme): Test for
`read_gns_readme` function.

Diffstat:
gd_diff.py | 13+++++++++++++
tests/test_gd_diff.py | 11+++++++++++
2 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/gd_diff.py b/gd_diff.py @@ -130,3 +130,16 @@ def slurp_all_gns_readmes(release, pkgs, local_dir): pkgs_noreadmes.append(pkg) return pkgs_noreadmes + + +def read_gns_readme(release, pkg, local_dir): + """Returns content of README.gNewSense for `pkg`. + + If `README.gNewSense` does not exists for `pkg`, None is returned. + + """ + readme_path = path.join(local_dir, release, pkg, 'debian', + 'README.gNewSense') + readme_content = read_file(readme_path) + + return readme_content diff --git a/tests/test_gd_diff.py b/tests/test_gd_diff.py @@ -143,6 +143,17 @@ class TestGdDiff(object): assert_equal(pkgs_noreadmes, expected_pkgs_noreadmes) + def test_read_gns_readme(self): + # first download the antlr readme + saved = slurp_gns_readme('parkes', 'antlr', self.gns_pkgs_dir) + assert saved + + antlr_readme_content = read_gns_readme('parkes', 'antlr', self.gns_pkgs_dir) + expected_antlr_readme_content = 'Changed-From-Debian: Removed example with non-free files.\nChange-Type: Modified\n\nFor gNewSense, the non-free unicode.IDENTs files are *actually* removed (see\nalso README.source). See gNewSense bug #34218 for details.\n' + + assert_equal(antlr_readme_content, expected_antlr_readme_content) + + def teardown(self): """Teardown method for this class.""" if(path.exists(self.gns_pkgs_dir)):