mirror of
https://github.com/openSUSE/osc.git
synced 2025-09-08 14:08:42 +02:00
- renamed limit_size to size_limit (only internal variable changes)
- added new method "get_files_meta" to the Package class (which handles the the "skip file and service stuff")
This commit is contained in:
@@ -33,10 +33,10 @@ class TestInitPackage(OscTestCase):
|
||||
self._check_list(os.path.join(storedir, '_files'), '<directory />\n')
|
||||
self._check_list(os.path.join(storedir, '_apiurl'), 'http://localhost\n')
|
||||
|
||||
def test_limit_size(self):
|
||||
"""initialize a package dir with limit_size parameter"""
|
||||
def test_size_limit(self):
|
||||
"""initialize a package dir with size_limit parameter"""
|
||||
pac_dir = os.path.join(self.tmpdir, 'testpkg')
|
||||
osc.core.Package.init_package('http://localhost', 'osctest', 'testpkg', pac_dir, limit_size=42)
|
||||
osc.core.Package.init_package('http://localhost', 'osctest', 'testpkg', pac_dir, size_limit=42)
|
||||
storedir = os.path.join(pac_dir, osc.core.store)
|
||||
self.assertFalse(os.path.exists(os.path.join(storedir, '_meta_mode')))
|
||||
self._check_list(os.path.join(storedir, '_size_limit'), '42\n')
|
||||
|
@@ -133,7 +133,7 @@ class TestUpdate(OscTestCase):
|
||||
of the size constraint
|
||||
"""
|
||||
self._change_to_pkg('limitsize')
|
||||
osc.core.Package('.').update(limit_size=50)
|
||||
osc.core.Package('.').update(size_limit=50)
|
||||
exp = 'D bigfile\nAt revision 2.\n'
|
||||
self.assertEqual(sys.stdout.getvalue(), exp)
|
||||
self.assertFalse(os.path.exists(os.path.join('.osc', 'bigfile')))
|
||||
@@ -146,13 +146,13 @@ class TestUpdate(OscTestCase):
|
||||
def testUpdateLimitSizeAddDelete(self):
|
||||
"""
|
||||
a new file (exists) was added to the remote package with
|
||||
size < limit_size and one file (nochange) was deleted from the
|
||||
size < size_limit and one file (nochange) was deleted from the
|
||||
remote package (local file 'nochange' is modified). Additionally
|
||||
files which didn't change are removed the local wc due to the
|
||||
size constraint.
|
||||
"""
|
||||
self._change_to_pkg('limitsize')
|
||||
osc.core.Package('.').update(limit_size=10)
|
||||
osc.core.Package('.').update(size_limit=10)
|
||||
exp = 'A exists\nD bigfile\nD foo\nD merge\nD nochange\nAt revision 2.\n'
|
||||
self.assertEqual(sys.stdout.getvalue(), exp)
|
||||
self.assertFalse(os.path.exists(os.path.join('.osc', 'bigfile')))
|
||||
|
Reference in New Issue
Block a user