1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-02-03 18:16:17 +01:00

- fixed _meta_mode + added testcase

This commit is contained in:
Marcus Huewe 2010-08-31 16:54:44 +02:00
parent 947971b2a2
commit 3ac330f7cd
2 changed files with 17 additions and 1 deletions

View File

@ -1734,7 +1734,8 @@ rev: %s
progress_obj=self.progress_obj, mtime=f.mtime, meta=self.meta)
print statfrmt('A', os.path.join(pathn, f.name))
store_write_string(self.absdir, '_files', fm + '\n')
self.update_local_pacmeta()
if not self.meta:
self.update_local_pacmeta()
self.update_datastructs()
print 'At revision %s.' % self.rev

View File

@ -189,6 +189,21 @@ class TestUpdate(OscTestCase):
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?rev=1', file='testUpdateMetaMode__meta')
def testUpdateMetaMode(self):
"""update package with metamode enabled"""
self._change_to_pkg('metamode')
p = osc.core.Package('.')
p.update()
exp = 'A _meta\nD foo\nD merge\nD nochange\nAt revision 1.\n'
self.assertEqual(sys.stdout.getvalue(), exp)
self.assertFalse(os.path.exists('foo'))
self.assertFalse(os.path.exists('merge'))
self.assertFalse(os.path.exists('nochange'))
self._check_digests('testUpdateMetaMode_filesremote')
self._check_status(p, '_meta', ' ')
# tests to recover from an aborted/broken update
@GET('http://localhost/source/osctest/simple/foo?rev=2', file='testUpdateResume_foo')