Ejemplo n.º 1
0
 def test_notracer(self):
     a = VizObject(None, "my variable")
     a.hello = 1
     a.hello = 2
     a = Hello(None)
     a.config("include_attributes", ["a", "b"])
     a.change_val()
     a.change_val2()
     b = Hello(None)
     b.config("include_attributes", ["a", "b"])
     b.change_val()
     b.change_val2()
Ejemplo n.º 2
0
 def test_config(self):
     tracer = VizTracer()
     tracer.start()
     a = VizObject(tracer, "my variable")
     a.config("trigger_on_change", False)
     a.hello = 1
     a.b = 2
     a.c = 3
     a.lol = 4
     a.log()
     tracer.stop()
     del a
     entries = tracer.parse()
     self.assertEqual(entries, 2)
Ejemplo n.º 3
0
 def test_config(self):
     tracer = VizTracer()
     tracer.start()
     a = VizObject(tracer, "my variable")
     a.config("trigger_on_change", False)
     a.hello = 1
     a.b = 2
     a.c = 3
     a.lol = 4
     a.log()
     tracer.stop()
     entries = tracer.parse()
     self.assertEqual(entries, 2)
     with self.assertRaises(ValueError):
         a.config("invalid", "value")