Esempio n. 1
0
    def test_validate_model_spills_time_mismatch_warning(self):
        '''
        test warning messages output for no spills and model start time
        mismatch with release time
        '''
        model = Model(start_time=self.start_time)
        (msgs, isvalid) = model.validate()

        assert len(msgs) == 1 and isvalid
        assert ('{0} contains no spills'.format(model.name) in msgs[0])

        model.spills += Spill(Release(self.start_time + timedelta(hours=1), 1))
        (msgs, isvalid) = model.validate()

        assert len(msgs) == 1 and isvalid
        assert ('Spill has release time after model start time' in msgs[0])

        model.spills[0].release_time = self.start_time - timedelta(hours=1)
        (msgs, isvalid) = model.validate()

        assert len(msgs) == 1 and not isvalid
        assert ('Spill has release time before model start time' in msgs[0])
Esempio n. 2
0
    def test_validate_model_spills_time_mismatch_warning(self):
        '''
        test warning messages output for no spills and model start time
        mismatch with release time
        '''
        model = Model(start_time=self.start_time)
        (msgs, isvalid) = model.validate()

        assert len(msgs) == 1 and isvalid
        assert ('{0} contains no spills'.format(model.name) in msgs[0])

        model.spills += Spill(Release(self.start_time + timedelta(hours=1), 1))
        (msgs, isvalid) = model.validate()

        assert len(msgs) == 1 and isvalid
        assert ('Spill has release time after model start time' in msgs[0])

        model.spills[0].release_time = self.start_time - timedelta(hours=1)
        (msgs, isvalid) = model.validate()

        assert len(msgs) == 1 and not isvalid
        assert ('Spill has release time before model start time' in msgs[0])
Esempio n. 3
0
    def test_model_weatherer_off(self):
        model = Model(start_time=self.start_time)
        model.weatherers += Evaporation(on=False)

        print model.validate()
Esempio n. 4
0
    def test_model_weatherer_off(self):
        model = Model(start_time=self.start_time)
        model.weatherers += Evaporation(on=False)

        print model.validate()