From 570e3e5c859736209190d3cfadb851120dfd7957 Mon Sep 17 00:00:00 2001 From: Marcus Huewe Date: Mon, 3 Mar 2014 22:35:25 +0100 Subject: [PATCH] - 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 6b579791a110bfefc79c4d310ff394c2bfe5c26f. --- tests/setlinkrev_fixtures/link_with_rev | 1 + tests/setlinkrev_fixtures/md5_rev_link | 1 + tests/test_setlinkrev.py | 17 +++++++++++++++++ 3 files changed, 19 insertions(+) create mode 100644 tests/setlinkrev_fixtures/link_with_rev create mode 100644 tests/setlinkrev_fixtures/md5_rev_link 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):