From e247cf358cc3e4f83f482477bc4561fa299d73aa Mon Sep 17 00:00:00 2001 From: Marcus Huewe Date: Mon, 21 Mar 2011 16:53:48 +0100 Subject: [PATCH] - adjusted testsuite for the latest setlinkrev changes --- tests/setlinkrev_fixtures/baserev_filesremote | 2 +- tests/setlinkrev_fixtures/expandedsrc_filesremote | 2 +- tests/setlinkrev_fixtures/linkerror_filesremote | 5 ----- tests/test_setlinkrev.py | 12 +++++++----- 4 files changed, 9 insertions(+), 12 deletions(-) delete mode 100644 tests/setlinkrev_fixtures/linkerror_filesremote diff --git a/tests/setlinkrev_fixtures/baserev_filesremote b/tests/setlinkrev_fixtures/baserev_filesremote index 43e9b3fb..de5d6648 100644 --- a/tests/setlinkrev_fixtures/baserev_filesremote +++ b/tests/setlinkrev_fixtures/baserev_filesremote @@ -1,4 +1,4 @@ - + diff --git a/tests/setlinkrev_fixtures/expandedsrc_filesremote b/tests/setlinkrev_fixtures/expandedsrc_filesremote index 7fb79b22..ad4d2a6e 100644 --- a/tests/setlinkrev_fixtures/expandedsrc_filesremote +++ b/tests/setlinkrev_fixtures/expandedsrc_filesremote @@ -1,4 +1,4 @@ - + diff --git a/tests/setlinkrev_fixtures/linkerror_filesremote b/tests/setlinkrev_fixtures/linkerror_filesremote deleted file mode 100644 index 6f440e93..00000000 --- a/tests/setlinkrev_fixtures/linkerror_filesremote +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/tests/test_setlinkrev.py b/tests/test_setlinkrev.py index a1eaed99..e3ffe165 100644 --- a/tests/test_setlinkrev.py +++ b/tests/test_setlinkrev.py @@ -31,15 +31,15 @@ class TestSetLinkRev(OscTestCase): osc.core.set_link_rev('http://localhost', 'osctest', 'simple', '42') @GET('http://localhost/source/osctest/simple/_link', file='noproject_link') - @GET('http://localhost/source/osctest/srcpkg?rev=latest', file='expandedsrc_filesremote') + @GET('http://localhost/source/osctest/srcpkg?rev=latest&expand=1', file='expandedsrc_filesremote') @PUT('http://localhost/source/osctest/simple/_link', exp='', text='dummytext') def test_expandedsrc(self): """expand src package""" - osc.core.set_link_rev('http://localhost', 'osctest', 'simple', xsrcmd5=True) + osc.core.set_link_rev('http://localhost', 'osctest', 'simple', expand=True) @GET('http://localhost/source/osctest/simple/_link', file='simple_link') - @GET('http://localhost/source/srcprj/srcpkg?linkrev=base&rev=latest', file='baserev_filesremote') + @GET('http://localhost/source/srcprj/srcpkg?linkrev=base&rev=latest&expand=1', file='baserev_filesremote') @PUT('http://localhost/source/osctest/simple/_link', exp='', text='dummytext') def test_baserev(self): @@ -47,10 +47,12 @@ class TestSetLinkRev(OscTestCase): osc.core.set_link_rev('http://localhost', 'osctest', 'simple', baserev=True) @GET('http://localhost/source/osctest/simple/_link', file='simple_link') - @GET('http://localhost/source/srcprj/srcpkg?rev=latest', file='linkerror_filesremote') + @GET('http://localhost/source/srcprj/srcpkg?rev=latest&expand=1', text='conflict in file merge', code=404) def test_linkerror(self): """link is broken""" - self.assertRaises(osc.oscerr.LinkExpandError, osc.core.set_link_rev, 'http://localhost', 'osctest', 'simple', xsrcmd5=True) + import urllib2 + # the backend returns status 404 if we try to expand a broken _link + self.assertRaises(urllib2.HTTPError, osc.core.set_link_rev, 'http://localhost', 'osctest', 'simple', expand=True) @GET('http://localhost/source/osctest/simple/_link', file='rev_link') @PUT('http://localhost/source/osctest/simple/_link',