1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-02-24 11:12:14 +01:00

- tests.test_setlinkrev: adjusted testcases for the new set_link_rev semantics (see #72)

This commit is contained in:
Marcus Huewe 2014-03-03 21:54:59 +01:00
parent 1dc8109ef8
commit 6b579791a1
2 changed files with 9 additions and 15 deletions

View File

@ -1,5 +0,0 @@
<directory name="srcpkg" rev="abcdeeeeeeeeeeeeeeeeeeeeeeeeeeee" srcmd5="abcdeeeeeeeeeeeeeeeeeeeeeeeeeeee" vrev="1">
<linkinfo project="srcsrcprj" package="srcsrcpkg" srcmd5="bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" baserev="bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" xsrcmd5="abcdeeeeeeeeeeeeeeeeeeeeeeeeeeee" lsrcmd5="cccccccccccccccccccccccccccccccc" />
<entry md5="0d62ceea6020d75154078a20d8c9f9ba" mtime="1282047302" name="_link" size="23" />
<entry md5="17b9e9e1a032ed44e7a584dc6303ffa8" mtime="1282047303" name="merge" size="48" />
</directory>

View File

@ -39,22 +39,14 @@ class TestSetLinkRev(OscTestCase):
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&expand=1', file='baserev_filesremote')
@PUT('http://localhost/source/osctest/simple/_link',
exp='<link package="srcpkg" project="srcprj" rev="abcdeeeeeeeeeeeeeeeeeeeeeeeeeeee" vrev="1" />', text='dummytext')
def test_baserev(self):
"""expanded baserev revision"""
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&expand=1', text='conflict in file merge', code=404)
@GET('http://localhost/source/srcprj/srcpkg?rev=latest&expand=1', text='conflict in file merge', code=400)
def test_linkerror(self):
"""link is broken"""
try:
from urllib.error import HTTPError
except ImportError:
from urllib2 import HTTPError
# the backend returns status 404 if we try to expand a broken _link
# the backend returns status 400 if we try to expand a broken _link
self.assertRaises(HTTPError, osc.core.set_link_rev, 'http://localhost', 'osctest', 'simple', expand=True)
@GET('http://localhost/source/osctest/simple/_link', file='rev_link')
@ -64,6 +56,13 @@ class TestSetLinkRev(OscTestCase):
"""delete rev attribute from link xml"""
osc.core.set_link_rev('http://localhost', 'osctest', 'simple', revision=None)
@GET('http://localhost/source/osctest/simple/_link', file='md5_rev_link')
@PUT('http://localhost/source/osctest/simple/_link',
exp='<link package="srcpkg" project="srcprj" />', text='dummytext')
def test_deleterev(self):
"""delete rev and vrev attribute from link xml"""
osc.core.set_link_rev('http://localhost', 'osctest', 'simple', revision=None)
@GET('http://localhost/source/osctest/simple/_link', file='simple_link')
@PUT('http://localhost/source/osctest/simple/_link',
exp='<link package="srcpkg" project="srcprj" />', text='dummytext')