Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
hearmeneigh committed Dec 12, 2023
1 parent dd4b73c commit 100096e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/tests/test_balance.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,17 @@ def test_multiple_files_wildcard_and_nothing_2(self):
self.assertEqual(len(s2.posts), 25)
self.assertEqual(len(s3.posts), 15)

def test_multiple_files(self):
s1 = SelectionSource('/some/file', skip_load=True)
s2 = SelectionSource('/some/file2', skip_load=True)

s1.posts = [PostEntity() for _ in range(10)]
s2.posts = [PostEntity() for _ in range(25)]

balance_selections([s1, s2])

self.assertAlmostEqual(s1.ratio, 0.2857, places=4)
self.assertAlmostEqual(s2.ratio, 0.71428571, places=4)
self.assertEqual(len(s1.posts), 10)
self.assertEqual(len(s2.posts), 25)

0 comments on commit 100096e

Please sign in to comment.