コード例 #1
0
ファイル: job_test.py プロジェクト: matley/oq-engine
    def test_config_text_to_list(self):
        """Exercise :function:`openquake.job.params.config_text_to_list`."""
        expected = ['MagDistPMF', 'MagDistEpsPMF', 'FullDisaggMatrix']

        # the input mixes spaces and commas for robustness testing:
        test_input = 'MagDistPMF,MagDistEpsPMF FullDisaggMatrix'

        self.assertEqual(expected, config_text_to_list(test_input))
コード例 #2
0
    def test_config_text_to_list(self):
        """Exercise :function:`openquake.job.params.config_text_to_list`."""
        expected = ['MagDistPMF', 'MagDistEpsPMF', 'FullDisaggMatrix']

        # the input mixes spaces and commas for robustness testing:
        test_input = 'MagDistPMF,MagDistEpsPMF FullDisaggMatrix'

        self.assertEqual(expected, config_text_to_list(test_input))
コード例 #3
0
ファイル: job_test.py プロジェクト: matley/oq-engine
    def test_config_text_to_list_all_whitespace_input(self):
        """Exercise :function:`openquake.job.params.config_text_to_list` with
        an input of only spaces. """

        expected = []

        test_input = '     '

        self.assertEqual(expected, config_text_to_list(test_input))
コード例 #4
0
    def test_config_text_to_list_all_whitespace_input(self):
        """Exercise :function:`openquake.job.params.config_text_to_list` with
        an input of only spaces. """

        expected = []

        test_input = '     '

        self.assertEqual(expected, config_text_to_list(test_input))
コード例 #5
0
ファイル: job_test.py プロジェクト: matley/oq-engine
    def test_config_text_to_list_with_transform(self):
        """Exercise :function:`openquake.job.params.config_text_to_list` with a
        transform specified.
        """
        expected = [0.01, 0.02, 0.03, 0.04]

        # again, mix spaces and commas
        test_input = '0.01,0.02, 0.03 0.04'

        self.assertEqual(expected, config_text_to_list(test_input, float))
コード例 #6
0
    def test_config_text_to_list_with_transform(self):
        """Exercise :function:`openquake.job.params.config_text_to_list` with a
        transform specified.
        """
        expected = [0.01, 0.02, 0.03, 0.04]

        # again, mix spaces and commas
        test_input = '0.01,0.02, 0.03 0.04'

        self.assertEqual(expected, config_text_to_list(test_input, float))