Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 5
0
 def test_never_disabled(self):
     manager = server_job.warning_manager()
     self.assertEqual(manager.is_valid(10, "MSGTYPE"), True)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 8
0
 def test_never_disabled(self):
     manager = server_job.warning_manager()
     self.assertEqual(manager.is_valid(10, "MSGTYPE"), True)