Beispiel #1
0
 def test_issue_298b(self):
     """
     Second test case for issue #298: blockette size exceeds 9999 bytes.
     """
     file = os.path.join(self.path, "AI.ESPZ._.BH_.dataless")
     parser = Parser(file)
     parser.get_resp()
Beispiel #2
0
 def test_create_resp_from_xseed(self):
     """
     Tests RESP file creation from XML-SEED.
     """
     # 1
     # parse Dataless SEED
     filename = os.path.join(self.path, 'dataless.seed.BW_FURT')
     sp1 = Parser(filename)
     # write XML-SEED
     with NamedTemporaryFile() as fh:
         tempfile = fh.name
         sp1.write_xseed(tempfile)
         # parse XML-SEED
         sp2 = Parser(tempfile)
         # create RESP files
         sp2.get_resp()
     # 2
     # parse Dataless SEED
     filename = os.path.join(self.path, 'arclink_full.seed')
     sp1 = Parser(filename)
     # write XML-SEED
     with NamedTemporaryFile() as fh:
         tempfile = fh.name
         sp1.write_xseed(tempfile)
         # parse XML-SEED
         sp2 = Parser(tempfile)
         # create RESP files
         sp2.get_resp()
Beispiel #3
0
 def test_create_resp_from_xseed(self):
     """
     Tests RESP file creation from XML-SEED.
     """
     # 1
     # parse Dataless SEED
     filename = os.path.join(self.path, 'dataless.seed.BW_FURT')
     sp1 = Parser(filename)
     # write XML-SEED
     with NamedTemporaryFile() as fh:
         tempfile = fh.name
         sp1.write_xseed(tempfile)
         # parse XML-SEED
         sp2 = Parser(tempfile)
         # create RESP files
         sp2.get_resp()
     # 2
     # parse Dataless SEED
     filename = os.path.join(self.path, 'arclink_full.seed')
     sp1 = Parser(filename)
     # write XML-SEED
     with NamedTemporaryFile() as fh:
         tempfile = fh.name
         sp1.write_xseed(tempfile)
         # parse XML-SEED
         sp2 = Parser(tempfile)
         # create RESP files
         sp2.get_resp()
Beispiel #4
0
 def test_issue_298b(self):
     """
     Second test case for issue #298: blockette size exceeds 9999 bytes.
     """
     file = os.path.join(self.path, "AI.ESPZ._.BH_.dataless")
     parser = Parser(file)
     parser.get_resp()
Beispiel #5
0
    def test_resp_round_trip(self):
        single_seed = os.path.join(
            self.path, '../../../../',
            'core/tests/data/IRIS_single_channel_with_response.seed')
        # Make parser and get resp from SEED
        seed_p = Parser(single_seed)
        resp_from_seed = seed_p.get_resp()[0][1]
        resp_from_seed.seek(0)
        resp_from_seed = resp_from_seed.read()
        seed_list = self.clean_unit_string(resp_from_seed)

        # make parser from resp made above and make a resp from it
        resp_p = Parser(resp_from_seed.decode('ascii'))
        resp_from_resp = resp_p.get_resp()[0][1]
        resp_from_resp.seek(0)
        resp_from_resp = resp_from_resp.read()
        resp_list = self.clean_unit_string(resp_from_resp)

        # compare
        self.assertEqual(seed_list, resp_list)
Beispiel #6
0
    def test_resp_round_trip(self):
        single_seed = os.path.join(
            self.path,
            '../../../../',
            'core/tests/data/IRIS_single_channel_with_response.seed')
        # Make parser and get resp from SEED
        seed_p = Parser(single_seed)
        resp_from_seed = seed_p.get_resp()[0][1]
        resp_from_seed.seek(0)
        resp_from_seed = resp_from_seed.read()
        seed_list = self.clean_unit_string(resp_from_seed)

        # make parser from resp made above and make a resp from it
        resp_p = Parser(resp_from_seed.decode('ascii'))
        resp_from_resp = resp_p.get_resp()[0][1]
        resp_from_resp.seek(0)
        resp_from_resp = resp_from_resp.read()
        resp_list = self.clean_unit_string(resp_from_resp)

        # compare
        self.assertEqual(seed_list, resp_list)