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 94624361bff34f9dbde42b21ada1226887dbe3fb
parent ed02cc5a0b9c728df168ce539bf6ab76f084dd05
Author: rsiddharth <s@ricketyspace.net>
Date:   Mon, 14 Nov 2016 05:37:29 +0000

Update `read_packages` function.

Returns list instead of an iterator. Fuck iterators.

* gd_diff.py (read_packages): Update function.
* tests/test_gd_diff.py (test_read_packages)
(test_read_packages_sanity): Update tests.

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

diff --git a/gd_diff.py b/gd_diff.py @@ -79,14 +79,14 @@ def execute(cmd, out=None, err=None): def read_packages(pkgs_file): - """Return an iterator contaning of package names from `pkgs_file`. + """Return list contaning of package names from `pkgs_file`. """ pkgs = read_file(pkgs_file).split('\n') # sanitize pkgs_iter = map(lambda x: x.strip(), pkgs) - return pkgs_iter + return list(pkgs_iter) def get_packages(release): diff --git a/tests/test_gd_diff.py b/tests/test_gd_diff.py @@ -86,14 +86,14 @@ class TestGdDiff(object): def test_read_packages(self): - pkgs_iter = read_packages(self.pkgs_file) - assert len(list(pkgs_iter)) == 82 + pkgs = read_packages(self.pkgs_file) + assert len(pkgs) == 82 def test_read_packages_sanity(self): - pkgs_iter = read_packages(self.pkgs_file) + pkgs = read_packages(self.pkgs_file) - for pkg in pkgs_iter: + for pkg in pkgs: assert not ' ' in pkg