From acbf2dabd50ef4fc884e7b836141c77efb2ca9e3 Mon Sep 17 00:00:00 2001 From: Marcus Huewe Date: Mon, 6 Sep 2010 18:11:12 +0200 Subject: [PATCH] - new testcase for a package without a revision --- tests/test_update.py | 11 +++++++++++ tests/update_fixtures/osctest/new/.osc/_apiurl | 1 + tests/update_fixtures/osctest/new/.osc/_files | 1 + .../update_fixtures/osctest/new/.osc/_osclib_version | 1 + tests/update_fixtures/osctest/new/.osc/_package | 1 + tests/update_fixtures/osctest/new/.osc/_project | 1 + tests/update_fixtures/testUpdateNew_filesremote | 2 ++ 7 files changed, 18 insertions(+) create mode 100644 tests/update_fixtures/osctest/new/.osc/_apiurl create mode 100644 tests/update_fixtures/osctest/new/.osc/_files create mode 100644 tests/update_fixtures/osctest/new/.osc/_osclib_version create mode 100644 tests/update_fixtures/osctest/new/.osc/_package create mode 100644 tests/update_fixtures/osctest/new/.osc/_project create mode 100644 tests/update_fixtures/testUpdateNew_filesremote diff --git a/tests/test_update.py b/tests/test_update.py index b2ea97a1..c60d7659 100644 --- a/tests/test_update.py +++ b/tests/test_update.py @@ -236,6 +236,17 @@ class TestUpdate(OscTestCase): self._check_digests('testUpdateMetaMode_filesremote') self._check_status(p, '_meta', ' ') + @GET('http://localhost/source/osctest/new?rev=latest', file='testUpdateNew_filesremote') + @GET('http://localhost/source/osctest/new/_meta', file='meta.xml') + def testUpdateNew(self): + """update a new (empty) package. The package has no revision.""" + self._change_to_pkg('new') + p = osc.core.Package('.') + p.update() + exp = 'At revision None.\n' + self.assertEqual(sys.stdout.getvalue(), exp) + self._check_digests('testUpdateNew_filesremote') + # tests to recover from an aborted/broken update @GET('http://localhost/source/osctest/simple/foo?rev=2', file='testUpdateResume_foo') diff --git a/tests/update_fixtures/osctest/new/.osc/_apiurl b/tests/update_fixtures/osctest/new/.osc/_apiurl new file mode 100644 index 00000000..0afeace7 --- /dev/null +++ b/tests/update_fixtures/osctest/new/.osc/_apiurl @@ -0,0 +1 @@ +http://localhost diff --git a/tests/update_fixtures/osctest/new/.osc/_files b/tests/update_fixtures/osctest/new/.osc/_files new file mode 100644 index 00000000..d9159675 --- /dev/null +++ b/tests/update_fixtures/osctest/new/.osc/_files @@ -0,0 +1 @@ + diff --git a/tests/update_fixtures/osctest/new/.osc/_osclib_version b/tests/update_fixtures/osctest/new/.osc/_osclib_version new file mode 100644 index 00000000..d3827e75 --- /dev/null +++ b/tests/update_fixtures/osctest/new/.osc/_osclib_version @@ -0,0 +1 @@ +1.0 diff --git a/tests/update_fixtures/osctest/new/.osc/_package b/tests/update_fixtures/osctest/new/.osc/_package new file mode 100644 index 00000000..3e757656 --- /dev/null +++ b/tests/update_fixtures/osctest/new/.osc/_package @@ -0,0 +1 @@ +new diff --git a/tests/update_fixtures/osctest/new/.osc/_project b/tests/update_fixtures/osctest/new/.osc/_project new file mode 100644 index 00000000..cea3bc84 --- /dev/null +++ b/tests/update_fixtures/osctest/new/.osc/_project @@ -0,0 +1 @@ +osctest \ No newline at end of file diff --git a/tests/update_fixtures/testUpdateNew_filesremote b/tests/update_fixtures/testUpdateNew_filesremote new file mode 100644 index 00000000..432daa9c --- /dev/null +++ b/tests/update_fixtures/testUpdateNew_filesremote @@ -0,0 +1,2 @@ + +