diff --git a/tests/setlinkrev_fixtures/link_with_rev b/tests/setlinkrev_fixtures/link_with_rev
new file mode 100644
index 00000000..877aa3ff
--- /dev/null
+++ b/tests/setlinkrev_fixtures/link_with_rev
@@ -0,0 +1 @@
+
diff --git a/tests/setlinkrev_fixtures/md5_rev_link b/tests/setlinkrev_fixtures/md5_rev_link
new file mode 100644
index 00000000..3725d01e
--- /dev/null
+++ b/tests/setlinkrev_fixtures/md5_rev_link
@@ -0,0 +1 @@
+
diff --git a/tests/test_setlinkrev.py b/tests/test_setlinkrev.py
index f986ff61..79f28e1a 100644
--- a/tests/test_setlinkrev.py
+++ b/tests/test_setlinkrev.py
@@ -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='', 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='',
+ 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):