mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-04 22:40:29 +03:00
git_mirror_size_limit config option to set max git mirror size
GitHub and GitLab have some kinds of limits on how big a git repo can be, this makes that option configurable. This also is very useful for tests.
This commit is contained in:
parent
4fa11ef4fc
commit
e76a0c9d6a
5 changed files with 100 additions and 4 deletions
|
|
@ -45,6 +45,15 @@ class CommonTest(unittest.TestCase):
|
|||
os.makedirs(self.tmpdir)
|
||||
os.chdir(self.basedir)
|
||||
|
||||
def test_parse_human_readable_size(self):
|
||||
for k, v in ((9827, 9827), (123.456, 123), ('123b', 123), ('1.2', 1),
|
||||
('10.43 KiB', 10680), ('11GB', 11000000000), ('59kb', 59000),
|
||||
('343.1 mb', 343100000), ('99.9GiB', 107266808217)):
|
||||
self.assertEqual(fdroidserver.common.parse_human_readable_size(k), v)
|
||||
for v in ((12, 123), '0xfff', [], None, '12,123', '123GG', '982374bb', self):
|
||||
with self.assertRaises(ValueError):
|
||||
fdroidserver.common.parse_human_readable_size(v)
|
||||
|
||||
def test_assert_config_keystore(self):
|
||||
with tempfile.TemporaryDirectory() as tmpdir, TmpCwd(tmpdir):
|
||||
with self.assertRaises(FDroidException):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue