コード例 #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])
コード例 #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])
コード例 #3
0
ファイル: test_model.py プロジェクト: sandhujasmine/PyGnome
    def test_model_weatherer_off(self):
        model = Model(start_time=self.start_time)
        model.weatherers += Evaporation(on=False)

        print model.validate()
コード例 #4
0
ファイル: test_model.py プロジェクト: satcomlabs/PyGnome
    def test_model_weatherer_off(self):
        model = Model(start_time=self.start_time)
        model.weatherers += Evaporation(on=False)

        print model.validate()