mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-04 22:40:29 +03:00
safety catch for --cpus so it isn't higher than actual CPUs
This commit is contained in:
parent
8421d61369
commit
950efbbb45
2 changed files with 19 additions and 6 deletions
|
|
@ -145,6 +145,16 @@ class Up_run_vagrant(UpTest):
|
|||
|
||||
|
||||
class Up_options(UpTest):
|
||||
def test_get_virt_cpus_opt_default(self):
|
||||
self.assertTrue(up.get_virt_cpus_opt(None) > 0)
|
||||
|
||||
def test_get_virt_cpus_opt_too_small(self):
|
||||
self.assertTrue(up.get_virt_cpus_opt(0.1) > 0)
|
||||
|
||||
def test_get_virt_cpus_opt_too_big(self):
|
||||
with self.assertLogs():
|
||||
self.assertEqual(up.get_virt_cpus_opt(99999999), os.cpu_count())
|
||||
|
||||
def test_get_virt_memory_opt_default(self):
|
||||
self.assertEqual(up.get_virt_memory_opt(None), 6 * 1024**3)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue