Ejemplo n.º 1
0
    def test_datafile(self):
        ec = EclConfig()
        ui = ec.validateDataFile("DoesNotExist")
        self.assertFalse(ui)

        dfile = self.createTestPath(DATA_file)
        ui = ec.validateDataFile(dfile)
        self.assertTrue(ui)
        ec.setDataFile(dfile)
        self.assertEqual(dfile, ec.getDataFile())
Ejemplo n.º 2
0
    def test_init_section(self):
        ec = EclConfig()
        dfile = self.createTestPath(DATA_file)
        difile = self.createTestPath(DATA_INIT_file)
        ifile = self.createTestPath(INIT_file)

        ui = ec.validateInitSection(ifile)
        self.assertFalse(ui)

        ec.setDataFile(dfile)
        ui = ec.validateInitSection(ifile)
        self.assertFalse(ui)

        ec.setDataFile(difile)
        ui = ec.validateInitSection(ifile)
        self.assertTrue(ui)
        ec.setInitSection(ifile)
        self.assertTrue(ifile, ec.getInitSection())
Ejemplo n.º 3
0
    def test_schedule_file(self):
        ec = EclConfig()
        ui = ec.validateScheduleFile("DoesNotExist")
        self.assertFalse(ui)

        dfile = self.createTestPath(DATA_file)
        sfile = self.createTestPath(SCHEDULE_file)

        # Setting the schedule file should fail before the datafile
        # (i.e. startdate) has been set.
        ui = ec.validateScheduleFile(sfile)
        self.assertFalse(ui)

        ec.setDataFile(dfile)
        ui = ec.validateScheduleFile(sfile)
        self.assertTrue(ui)

        ec.setScheduleFile(sfile)
        self.assertEqual(sfile, ec.getScheduleFile())