예제 #1
0
    def test_round_trip(self):
        config = Config()
        tmp_file = "tmp_config.yml"
        config.write(tmp_file)
        self.files_to_remove.append(tmp_file)

        config_back = read_config(tmp_file)
        self.assertEqual(config, config_back)
예제 #2
0
 def test_get_waveform_client(self):
     config = read_config(os.path.join(self.test_path,
                                       "default_config.yml"))
     client = config.rt_match_filter.get_waveform_client()
     self.assertEqual(client, None)
     config.rt_match_filter.waveform_client_type = "FDSN"
     client = config.rt_match_filter.get_waveform_client()
     self.assertEqual(client, None)
     config.rt_match_filter.waveform_client = "GEONET"
     client = config.rt_match_filter.get_waveform_client()
     self.assertIsInstance(client, Client)
예제 #3
0
 def test_get_client(self):
     config = read_config(os.path.join(self.test_path,
                                       "default_config.yml"))
     client = config.rt_match_filter.get_client()
     self.assertIsInstance(client, Client)
     config.rt_match_filter.client = "WaLrOuS"
     client = config.rt_match_filter.get_client()
     self.assertEqual(client, None)
     config.rt_match_filter.client_type = "aLbATrOsS"
     client = config.rt_match_filter.get_client()
     self.assertEqual(client, None)
예제 #4
0
 def test_fail_read(self):
     with self.assertRaises(FileNotFoundError):
         read_config("missing_file")
예제 #5
0
 def test_read_no_file(self):
     config = read_config()
     self.assertIsInstance(config, Config)
예제 #6
0
 def test_read_config(self):
     config = read_config(os.path.join(self.test_path,
                                       "default_config.yml"))
     self.assertIsInstance(config, Config)