diff options
author | Guido Günther <agx@sigxcpu.org> | 2012-01-22 12:52:23 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2012-01-22 18:33:14 +0100 |
commit | 63b24cef4db5277eff7b38bbe359fc30f9d28b90 (patch) | |
tree | ecd7f0396015e7aa510d87e10fdfd77f0e9b53cd | |
parent | 98222133e548f1c88a28a26bbc9e23f1d42a4007 (diff) | |
download | git-buildpackage-63b24cef4db5277eff7b38bbe359fc30f9d28b90.tar.gz git-buildpackage-63b24cef4db5277eff7b38bbe359fc30f9d28b90.tar.bz2 git-buildpackage-63b24cef4db5277eff7b38bbe359fc30f9d28b90.zip |
deb.changelog: add name property
-rw-r--r-- | gbp/deb/changelog.py | 4 | ||||
-rw-r--r-- | tests/test_Changelog.py | 14 |
2 files changed, 17 insertions, 1 deletions
diff --git a/gbp/deb/changelog.py b/gbp/deb/changelog.py index bba8fa9a..674e9e7a 100644 --- a/gbp/deb/changelog.py +++ b/gbp/deb/changelog.py @@ -82,6 +82,10 @@ class ChangeLog(object): def __setitem__(self, item, value): self._cp[item] = value + @property + def name(self): + """The packges name""" + return self._cp['Source'] @property def version(self): diff --git a/tests/test_Changelog.py b/tests/test_Changelog.py index c4c7c0cb..97414abb 100644 --- a/tests/test_Changelog.py +++ b/tests/test_Changelog.py @@ -119,7 +119,7 @@ def test_parse_no_eopch(): def test_parse_eopch(): """ - Parse a the changelog of a package without eopch + Parse a the changelog of a package without epoch Methods tested: - L{gbp.deb.changelog.ChangeLog.__init__} @@ -156,3 +156,15 @@ def test_parse_eopch(): >>> cl.is_native() False """ + +def test_parse_name(): + Methods tested: + - L{gbp.deb.changelog.ChangeLog.__init__} + + Properties tested: + - L{gbp.deb.changelog.ChangeLog.name} + + >>> import gbp.deb.changelog + >>> cl = gbp.deb.changelog.ChangeLog(cl_debian) + >>> cl.name + 'git-buildpackage' |