1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-09-20 09:16:16 +02:00

- added new testcase

This commit is contained in:
Marcus Huewe 2010-09-03 21:28:17 +02:00
parent 31f14c7abe
commit 0502e81b26

View File

@ -191,10 +191,7 @@ class TestUpdate(OscTestCase):
@GET('http://localhost/source/osctest/services/_service%3Afoo?rev=2', file='testUpdateServiceFilesAddDelete__service:foo') @GET('http://localhost/source/osctest/services/_service%3Afoo?rev=2', file='testUpdateServiceFilesAddDelete__service:foo')
@GET('http://localhost/source/osctest/services/_meta', file='meta.xml') @GET('http://localhost/source/osctest/services/_meta', file='meta.xml')
def testUpdateAddDeleteServiceFiles(self): def testUpdateAddDeleteServiceFiles(self):
""" """update package with _service:* files"""
a new file was added to the remote package but isn't checked out because
of the size constraint
"""
self._change_to_pkg('services') self._change_to_pkg('services')
osc.core.Package('.').update(service_files=True) osc.core.Package('.').update(service_files=True)
exp = 'A bigfile\nD _service:exists\nA _service:bar\nA _service:foo\nAt revision 2.\n' exp = 'A bigfile\nD _service:exists\nA _service:bar\nA _service:foo\nAt revision 2.\n'
@ -208,6 +205,22 @@ class TestUpdate(OscTestCase):
self.assertTrue(os.path.exists('_service:exists')) self.assertTrue(os.path.exists('_service:exists'))
self._check_digests('testUpdateServiceFilesAddDelete_files', '_service:foo', '_service:bar') self._check_digests('testUpdateServiceFilesAddDelete_files', '_service:foo', '_service:bar')
@GET('http://localhost/source/osctest/services?rev=latest', file='testUpdateServiceFilesAddDelete_filesremote')
@GET('http://localhost/source/osctest/services/bigfile?rev=2', file='testUpdateServiceFilesAddDelete_bigfile')
@GET('http://localhost/source/osctest/services/_meta', file='meta.xml')
def testUpdateDisableAddDeleteServiceFiles(self):
"""update package with _service:* files (with service_files=False)"""
self._change_to_pkg('services')
osc.core.Package('.').update()
exp = 'A bigfile\nD _service:exists\nAt revision 2.\n'
self.assertEqual(sys.stdout.getvalue(), exp)
self.assertFalse(os.path.exists(os.path.join('.osc', '_service:bar')))
self.assertFalse(os.path.exists('_service:bar'))
self.assertFalse(os.path.exists(os.path.join('.osc', '_service:foo')))
self.assertFalse(os.path.exists('_service:foo'))
self.assertTrue(os.path.exists('_service:exists'))
self._check_digests('testUpdateServiceFilesAddDelete_files', '_service:foo', '_service:bar')
@GET('http://localhost/source/osctest/metamode?meta=1&rev=latest', file='testUpdateMetaMode_filesremote') @GET('http://localhost/source/osctest/metamode?meta=1&rev=latest', file='testUpdateMetaMode_filesremote')
@GET('http://localhost/source/osctest/metamode/_meta?rev=1', file='testUpdateMetaMode__meta') @GET('http://localhost/source/osctest/metamode/_meta?rev=1', file='testUpdateMetaMode__meta')
def testUpdateMetaMode(self): def testUpdateMetaMode(self):