From 8a3f12871b244f08bcb988e45c99e7a3a0cae9d1 Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Thu, 13 Feb 2014 14:18:16 +0100 Subject: [PATCH] also test disable_build=True --- osclib/stagingapi.py | 2 +- tests/api_tests.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/osclib/stagingapi.py b/osclib/stagingapi.py index f0c0b3f9..93c45af0 100644 --- a/osclib/stagingapi.py +++ b/osclib/stagingapi.py @@ -307,7 +307,7 @@ class StagingAPI(object): root = ET.fromstring(dst_meta) elm = ET.SubElement(root, 'build') ET.SubElement(elm, 'disable') - dst_meta = ET.tostring(root, encoding=ET_ENCODING) + dst_meta = ET.tostring(root) url = makeurl(self.apiurl, ['source', project, package, '_meta'] ) http_PUT(url, data=dst_meta) diff --git a/tests/api_tests.py b/tests/api_tests.py index 3cf8249a..b4d7ff00 100644 --- a/tests/api_tests.py +++ b/tests/api_tests.py @@ -231,6 +231,12 @@ class TestApiCalls(unittest.TestCase): self.assertEqual(httpretty.last_request().body, '<description/></package>') self.assertEqual(httpretty.last_request().path, '/source/openSUSE:Factory:Staging:B/wine/_meta') + api.create_package_container('openSUSE:Factory:Staging:B', 'wine', disable_build=True) + self.assertEqual(httpretty.last_request().method, 'PUT') + self.assertEqual(httpretty.last_request().body, '<package name="wine"><title /><description /><build><disable /></build></package>') + self.assertEqual(httpretty.last_request().path, '/source/openSUSE:Factory:Staging:B/wine/_meta') + + # Here place all mockable functions @contextlib.contextmanager def mock_generate_ring_packages():