コード例 #1
0
 def test_multiple_disabled_calls(self):
     manager = server_job.warning_manager()
     manager.disable_warnings("MSGTYPE", lambda: 10)
     manager.disable_warnings("MSGTYPE", lambda: 20)
     manager.enable_warnings("MSGTYPE", lambda: 30)
     self.assertEqual(manager.is_valid(15, "MSGTYPE"), False)
     self.assertEqual(manager.is_valid(25, "MSGTYPE"), False)
     self.assertEqual(manager.is_valid(35, "MSGTYPE"), True)
コード例 #2
0
 def test_multiple_disabled_calls(self):
     manager = server_job.warning_manager()
     manager.disable_warnings("MSGTYPE", lambda: 10)
     manager.disable_warnings("MSGTYPE", lambda: 20)
     manager.enable_warnings("MSGTYPE", lambda: 30)
     self.assertEqual(manager.is_valid(15, "MSGTYPE"), False)
     self.assertEqual(manager.is_valid(25, "MSGTYPE"), False)
     self.assertEqual(manager.is_valid(35, "MSGTYPE"), True)
コード例 #3
0
 def test_disabled_changes_is_valid(self):
     manager = server_job.warning_manager()
     self.assertEqual(manager.is_valid(15, "MSGTYPE"), True)
     manager.disable_warnings("MSGTYPE", lambda: 10)
     self.assertEqual(manager.is_valid(15, "MSGTYPE"), False)
コード例 #4
0
 def test_only_enabled(self):
     manager = server_job.warning_manager()
     manager.enable_warnings("MSGTYPE", lambda: 10)
     self.assertEqual(manager.is_valid(20, "MSGTYPE"), True)
コード例 #5
0
 def test_never_disabled(self):
     manager = server_job.warning_manager()
     self.assertEqual(manager.is_valid(10, "MSGTYPE"), True)
コード例 #6
0
 def test_disabled_changes_is_valid(self):
     manager = server_job.warning_manager()
     self.assertEqual(manager.is_valid(15, "MSGTYPE"), True)
     manager.disable_warnings("MSGTYPE", lambda: 10)
     self.assertEqual(manager.is_valid(15, "MSGTYPE"), False)
コード例 #7
0
 def test_only_enabled(self):
     manager = server_job.warning_manager()
     manager.enable_warnings("MSGTYPE", lambda: 10)
     self.assertEqual(manager.is_valid(20, "MSGTYPE"), True)
コード例 #8
0
 def test_never_disabled(self):
     manager = server_job.warning_manager()
     self.assertEqual(manager.is_valid(10, "MSGTYPE"), True)