diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_subcmds_sync.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test_subcmds_sync.py b/tests/test_subcmds_sync.py index 8dde687c..b871317c 100644 --- a/tests/test_subcmds_sync.py +++ b/tests/test_subcmds_sync.py | |||
| @@ -355,6 +355,30 @@ class SafeCheckoutOrder(unittest.TestCase): | |||
| 355 | ) | 355 | ) |
| 356 | 356 | ||
| 357 | 357 | ||
| 358 | class Chunksize(unittest.TestCase): | ||
| 359 | """Tests for _chunksize.""" | ||
| 360 | |||
| 361 | def test_single_project(self): | ||
| 362 | """Single project.""" | ||
| 363 | self.assertEqual(sync._chunksize(1, 1), 1) | ||
| 364 | |||
| 365 | def test_low_project_count(self): | ||
| 366 | """Multiple projects, low number of projects to sync.""" | ||
| 367 | self.assertEqual(sync._chunksize(10, 1), 10) | ||
| 368 | self.assertEqual(sync._chunksize(10, 2), 5) | ||
| 369 | self.assertEqual(sync._chunksize(10, 4), 2) | ||
| 370 | self.assertEqual(sync._chunksize(10, 8), 1) | ||
| 371 | self.assertEqual(sync._chunksize(10, 16), 1) | ||
| 372 | |||
| 373 | def test_high_project_count(self): | ||
| 374 | """Multiple projects, high number of projects to sync.""" | ||
| 375 | self.assertEqual(sync._chunksize(2800, 1), 32) | ||
| 376 | self.assertEqual(sync._chunksize(2800, 16), 32) | ||
| 377 | self.assertEqual(sync._chunksize(2800, 32), 32) | ||
| 378 | self.assertEqual(sync._chunksize(2800, 64), 32) | ||
| 379 | self.assertEqual(sync._chunksize(2800, 128), 21) | ||
| 380 | |||
| 381 | |||
| 358 | class GetPreciousObjectsState(unittest.TestCase): | 382 | class GetPreciousObjectsState(unittest.TestCase): |
| 359 | """Tests for _GetPreciousObjectsState.""" | 383 | """Tests for _GetPreciousObjectsState.""" |
| 360 | 384 | ||
