seperate the tests
This commit is contained in:
16
tests.py
Normal file
16
tests.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import paho.mqtt.client as mqtt
|
||||
import json
|
||||
import base64
|
||||
import message_pb2
|
||||
import sqlite3
|
||||
|
||||
# Test protobuf here
|
||||
code = bytearray('CgoNAAAAABUAAAAA', "utf-8")
|
||||
print(code)
|
||||
bcode = base64.b64decode(code)
|
||||
res = message_pb2.CollarResponse()
|
||||
res.ParseFromString(bcode)
|
||||
|
||||
assert res.loc.x == 0
|
||||
assert res.loc.y == 0
|
||||
print("Coord {x: " + str(res.loc.x) + ", y: " + str(res.loc.y) + "}")
|
||||
Reference in New Issue
Block a user