-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VizRankDialog: Restrict frequency of signal emitting
- Loading branch information
Showing
2 changed files
with
19 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,7 @@ def test_run_vizrank(self): | |
res_scores = sorted([compute_score(x) for x in states]) | ||
self.assertListEqual(res.scores, res_scores) | ||
self.assertIsNot(scores, res.scores) | ||
self.assertEqual(task.set_partial_result.call_count, 6) | ||
self.assertEqual(task.set_partial_result.call_count, 2) | ||
self.assertEqual(task.set_progress_value.call_count, 7) | ||
|
||
def test_run_vizrank_interrupt(self): | ||
|
@@ -59,7 +59,7 @@ def test_run_vizrank_interrupt(self): | |
res_scores = sorted([compute_score(x) for x in states[:2]]) | ||
self.assertListEqual(res.scores, res_scores) | ||
self.assertIsNot(scores, res.scores) | ||
self.assertEqual(task.set_partial_result.call_count, 2) | ||
self.assertEqual(task.set_partial_result.call_count, 1) | ||
self.assertEqual(task.set_progress_value.call_count, 3) | ||
task.set_progress_value.assert_called_with(int(1 / 6 * 100)) | ||
|
||
|
@@ -76,7 +76,7 @@ def test_run_vizrank_interrupt(self): | |
res_scores = sorted([compute_score(x) for x in states]) | ||
self.assertListEqual(res.scores, res_scores) | ||
self.assertIsNot(scores, res.scores) | ||
self.assertEqual(task.set_partial_result.call_count, 6) | ||
self.assertEqual(task.set_partial_result.call_count, 3) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
VesnaT
Author
Contributor
|
||
self.assertEqual(task.set_progress_value.call_count, 8) | ||
task.set_progress_value.assert_called_with(int(5 / 6 * 100)) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I have a feeling these tests are going to crash... Now that you restrict the frequency the number of calls could differ on different computers.