mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-24 22:06:14 +01:00
- tests/test_setlinkrev: added two new testcases
Behave correctly if the _link already has a rev attribute.
Also added a fixture file that I forgot in
commit 6b579791a1
.
This commit is contained in:
parent
6b579791a1
commit
570e3e5c85
1
tests/setlinkrev_fixtures/link_with_rev
Normal file
1
tests/setlinkrev_fixtures/link_with_rev
Normal file
@ -0,0 +1 @@
|
||||
<link package="srcpkg" project="srcprj" rev="7" />
|
1
tests/setlinkrev_fixtures/md5_rev_link
Normal file
1
tests/setlinkrev_fixtures/md5_rev_link
Normal file
@ -0,0 +1 @@
|
||||
<link package="srcpkg" project="srcprj" rev="eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" vrev="1" />
|
@ -38,6 +38,23 @@ class TestSetLinkRev(OscTestCase):
|
||||
"""expand src package"""
|
||||
osc.core.set_link_rev('http://localhost', 'osctest', 'simple', expand=True)
|
||||
|
||||
@GET('http://localhost/source/osctest/simple/_link', file='link_with_rev')
|
||||
@PUT('http://localhost/source/osctest/simple/_link',
|
||||
exp='<link package="srcpkg" project="srcprj" rev="7" />', text='dummytext')
|
||||
def test_existingrev(self):
|
||||
"""link already has a rev attribute (no expand)"""
|
||||
# we could also avoid the superfluous PUT
|
||||
osc.core.set_link_rev('http://localhost', 'osctest', 'simple')
|
||||
|
||||
@GET('http://localhost/source/osctest/simple/_link', file='link_with_rev')
|
||||
@GET('http://localhost/source/srcprj/srcpkg?rev=7&expand=1', file='expandedsrc_filesremote')
|
||||
@PUT('http://localhost/source/osctest/simple/_link',
|
||||
exp='<link package="srcpkg" project="srcprj" rev="eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" vrev="1" />',
|
||||
text='dummytext')
|
||||
def test_expandexistingrev(self):
|
||||
"""link already has a rev attribute (expand it)"""
|
||||
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?rev=latest&expand=1', text='conflict in file merge', code=400)
|
||||
def test_linkerror(self):
|
||||
|
Loading…
Reference in New Issue
Block a user