def testExcludeList(self): bm = browser_model.T(Test.g_comp) bm.set_type(browser_model.INNER) bm.set_file("gf4d.cfrm") self.assertEqual(0, bm.current.formulas.count("default")) bm.set_type(browser_model.OUTER) bm.set_file("gf4d.cfrm") self.assertEqual(1, bm.current.formulas.count("default"))
def testFuncMapping(self): bm = browser_model.T(Test.g_comp) ti = bm.get_type_info(browser_model.FRACTAL) self.assertEqual(fc.FormulaTypes.FRACTAL, ti.formula_type) self.assertEqual(None, ti.fname) self.assertEqual(None, ti.formula) self.assertEqual([], ti.formulas) ti2 = bm.get_type_info(browser_model.GRADIENT) self.assertEqual(fc.FormulaTypes.GRADIENT, ti2.formula_type)
def testSetTypeUpdatesFnames(self): bm = browser_model.T(Test.g_comp) bm.set_type(browser_model.FRACTAL) bm.current.fname = "fish" bm.current.formula = "haddock" bm.set_type(browser_model.GRADIENT) self.assertEqual(None, bm.current.fname) self.assertEqual(None, bm.current.formula) bm.set_type(browser_model.FRACTAL) self.assertEqual("fish", bm.current.fname) self.assertEqual("haddock", bm.current.formula)
def testApplyStatus(self): bm = browser_model.T(Test.g_comp) bm.set_type(browser_model.FRACTAL) self.assertEqual(False, bm.current.can_apply) bm.set_file("gf4d.frm") self.assertEqual(False, bm.current.can_apply) bm.set_formula("Mandelbrot") self.assertEqual(True, bm.current.can_apply) bm.set_type(browser_model.GRADIENT) self.assertEqual(False, bm.current.can_apply) bm.set_file("Gallet01.map") self.assertEqual(True, bm.current.can_apply) bm.set_file("blatte1.ugr") self.assertEqual(False, bm.current.can_apply) bm.update("test.frm", "test_error") self.assertEqual(False, bm.current.can_apply)
def testFileList(self): bm = browser_model.T(Test.g_comp) bm.set_type(browser_model.FRACTAL) self.assertNotEqual(bm.current.files, []) self.assertListSorted(bm.current.files)
def testCreation(self): bm = browser_model.T(Test.g_comp)
def testUgrPresent(self): bm = browser_model.T(Test.g_comp) bm.set_type(browser_model.GRADIENT) files = bm.current.files self.assertEqual(1, files.count("blatte1.ugr"))
def testFormulasSorted(self): bm = browser_model.T(Test.g_comp) bm.set_type(browser_model.FRACTAL) bm.set_file("gf4d.frm") self.assertListSorted(bm.current.formulas)
def testSetBadFile(self): bm = browser_model.T(Test.g_comp) bm.set_type(browser_model.FRACTAL) self.assertRaises(IOError, bm.set_file, "nonexistent.frm")