示例#1
0
文件: node_test.py 项目: kesre/Tron
 def test_jitter_with_max_delay(self):
     self.settings.jitter_max_delay = 15
     assert_equal(node.determine_jitter(20, self.settings), 15.0)
     assert_equal(node.determine_jitter(100, self.settings), 15.0)
示例#2
0
文件: node_test.py 项目: kesre/Tron
 def test_jitter_with_load_factor(self):
     self.settings.jitter_load_factor = 2
     assert_equal(node.determine_jitter(3, self.settings), 2.0)
     assert_equal(node.determine_jitter(2, self.settings), 0)
示例#3
0
文件: node_test.py 项目: kesre/Tron
 def test_jitter_under_min_load(self):
     assert_equal(node.determine_jitter(3, self.settings), 0)
     assert_equal(node.determine_jitter(4, self.settings), 0)
示例#4
0
 def test_jitter_with_max_delay(self):
     self.settings.jitter_max_delay = 15
     assert_equal(node.determine_jitter(20, self.settings), 15.0)
     assert_equal(node.determine_jitter(100, self.settings), 15.0)
示例#5
0
 def test_jitter_with_load_factor(self):
     self.settings.jitter_load_factor = 2
     assert_equal(node.determine_jitter(3, self.settings), 2.0)
     assert_equal(node.determine_jitter(2, self.settings), 0)
示例#6
0
 def test_jitter_under_min_load(self):
     assert_equal(node.determine_jitter(3, self.settings), 0)
     assert_equal(node.determine_jitter(4, self.settings), 0)