diff --git a/geomagio/edge/RawInputClient.py b/geomagio/edge/RawInputClient.py index 436102f63fa278a7de81be9a5298ec18d81cf24f..f2a2f3bcf5d08dfa62ea02c781cba037288ec6eb 100644 --- a/geomagio/edge/RawInputClient.py +++ b/geomagio/edge/RawInputClient.py @@ -375,7 +375,7 @@ class RawInputClient(): The Packet is right padded with zeros The Packet must be 40 Bytes long. """ - tg = self.tag + ' ' + tg = str(self.tag + ' ').encode() tb = struct.pack(TAGSTR, PACKETHEAD, TAG, tg[:12], 0, 0, 0, 0, 0, 0) return tb diff --git a/test/edge_test/RawInputFactory_test.py b/test/edge_test/RawInputClient_test.py similarity index 75% rename from test/edge_test/RawInputFactory_test.py rename to test/edge_test/RawInputClient_test.py index c78d654eafa3705aa95ea8cf0bb82d3cc0bd79b5..9fd9bd14f76a5300bd3ac648d80de404b7b03552 100644 --- a/test/edge_test/RawInputFactory_test.py +++ b/test/edge_test/RawInputClient_test.py @@ -1,4 +1,4 @@ -"""Tests for RawInputFactory.py""" +"""Tests for RawInputClient.py""" import numpy from obspy.core import Stats, Trace, UTCDateTime @@ -45,3 +45,17 @@ def test_raw_input_client(): client.send_trace('minute', trace_send) # verify data was sent assert_equals(len(client.last_send), 1) + + +def test__get_tag(): + """edge_test.RawInputClient_test.test_raw_input_client() + """ + network = 'NT' + station = 'BOU' + channel = 'MVH' + location = 'R0' + client = TestRawInputClient(tag='tag', host='host', port='port', + station=station, channel=channel, + location=location, network=network) + tag_send = client._get_tag() + assert_equals(tag_send is not None, True)