def testCopy(self): f = gtkfractal.Hidden(TestHidden.g_comp, 64, 40) copy = f.copy_f() mag = f.get_param(f.MAGNITUDE) copy.set_param(copy.MAGNITUDE, 176.3) self.assertEqual(mag, f.get_param(f.MAGNITUDE)) self.assertNotEqual(mag, copy.get_param(copy.MAGNITUDE))
def testLoad(self): f = gtkfractal.Hidden(TestHidden.g_comp, 64, 40) with open("testdata/test_bail.fct") as fh: f.loadFctFile(fh) self.assertEqual(f.saved, True) f.connect('status-changed', self.quitloop) f.draw_image(0, 1) self.wait()
def testSignals(self): f = gtkfractal.Hidden(TestHidden.g_comp, 64, 40) cc = CallCounter() f.connect('parameters-changed', cc.cb) self.assertEqual(cc.count, 0) f.set_param(f.MAGNITUDE, 0.7) self.assertEqual(cc.count, 1) # set to the same value, no callback f.set_param(f.MAGNITUDE, 0.7) self.assertEqual(cc.count, 1) # maxiter f.set_maxiter(778) f.set_maxiter(778) self.assertEqual(cc.count, 2) # size f.set_size(57, 211) f.set_size(57, 211) while cc.count < 3: Gtk.main_iteration()
def testCreate(self): # draw a default fractal f = gtkfractal.Hidden(TestHidden.g_comp, 64, 40) f.connect('status-changed', self.quitloop) f.draw_image(0, 1) self.wait()