コード例 #1
0
 def test_with_not_block_jump(self):
     mock_warning = mocks.MockWarning()
     mocks.MockWarning.retrieve_value = mock_warning
     self.configuration.block = models_tests.generate_block(sessions=self.list_sessions)
     self.configuration.session = self.list_sessions[1]
     main.update_config(self.configuration, [], [])
     self.assertEqual(self.configuration.session, self.list_sessions[0])
     self.assertEqual(len(self.configuration.warnings), 1)
     self.assertEqual(self.configuration.warnings[0], mock_warning)
コード例 #2
0
 def test_with_found_average(self):
     self.last_jump_configuration = None
     self.last_jump_condition = None
     self.mock_avg_percentile = 0
     self.configuration.session = self.list_sessions[1]
     self.configuration.level = 1
     main.update_config(self.configuration, [], [])
     self.assertEqual(self.last_jump_configuration, self.configuration)
     self.assertEqual(self.last_jump_condition, self.bjc)
コード例 #3
0
 def test_with_not_found_anything(self):
     self.last_jump_configuration = None
     self.last_jump_condition = None
     self.mock_avg_percentile = None
     self.configuration.session = self.list_sessions[4]
     self.configuration.level = 3
     self.configuration.block = self.block
     main.update_config(self.configuration, [], [])
     self.assertEqual(self.last_jump_configuration, None)
     self.assertEqual(self.last_jump_condition, None)
     self.assertEqual(self.configuration.session, self.list_sessions[5])
コード例 #4
0
 def test_next_session(self):
     self.configuration.session = self.list_sessions[2]
     self.configuration.level = "1"
     main.update_config(self.configuration, [], [])
     self.assertEqual(self.configuration.session, self.list_sessions[1])