Exemple #1
0
    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"))
Exemple #2
0
    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)
Exemple #3
0
    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)
Exemple #4
0
    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)
Exemple #5
0
 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)
Exemple #6
0
 def testCreation(self):
     bm = browser_model.T(Test.g_comp)
Exemple #7
0
 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"))
Exemple #8
0
 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)
Exemple #9
0
 def testSetBadFile(self):
     bm = browser_model.T(Test.g_comp)
     bm.set_type(browser_model.FRACTAL)
     self.assertRaises(IOError, bm.set_file, "nonexistent.frm")