From 5cf8d0a0b03659790cd7c34d1b5bea350bb41d1a Mon Sep 17 00:00:00 2001 From: Scott Bahling Date: Sun, 21 Feb 2016 12:57:53 +0100 Subject: rename source_info method to get_source_info Consistency with other get_* methods --- obsapi/core.py | 2 +- test/test_api.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/obsapi/core.py b/obsapi/core.py index 55ddba0..ebbe016 100644 --- a/obsapi/core.py +++ b/obsapi/core.py @@ -283,7 +283,7 @@ class ObsApi(object): ) return (directory, lsitems) - def source_info(self, prj, pkg): + def get_source_info(self, prj, pkg): api = '/source/{}/{}'.format(prj, pkg) query = {'view': 'info'} xml = self.get_xml(api, payload=query) diff --git a/test/test_api.py b/test/test_api.py index 17196a6..5d3ae90 100644 --- a/test/test_api.py +++ b/test/test_api.py @@ -54,3 +54,12 @@ def test_binaries_ls(): def test_get_vendor(): assert api.get_vendor(prj=prj) == u'Test:obsapi' + + +def test_source_info(): + sinfo = api.get_source_info(prj, pkg) + assert sinfo.package == 'suse-hello-1.0' + assert sinfo.rev == '2' + assert sinfo.vrev == '2' + assert sinfo.srcmd5 == '7054c47fb2ebde13fc62ee64d0a3b1bc' + assert sinfo.verifymd5 == '7054c47fb2ebde13fc62ee64d0a3b1bc' -- cgit v1.2.3