def test_insert(): result = Tago(TOKEN).device.remove() print result if result['status']: assert True else: assert False
def test_insert(): result = Tago(TOKEN).device.find({'query': 'last_value'}) print result if result['status']: assert True else: assert False
def test_history(): result = Tago(TOKEN).extra.weather().history('2017-02-21', '27606', False, 'EN') print "Weather History Test:" print_result(result)
def test_current(): result = Tago(TOKEN).extra.weather().current('27606', False, 'EN') print "Current Weather Test:" print_result(result)
def test_insert(): result = Tago(TOKEN).device.insert({'variable': 'test', 'value': 2}) if result['status']: assert True else: assert False
def test_socket(): s = Tago(TOKEN).analysis.run_analysis(func_callback, 0)
def test_socket(): s = Tago(TOKEN).analysis.localRuntime(func_callback, 1)
def test_getGeolocation(): result = Tago(TOKEN).extra.geocoding().getGeolocation( 'Empire State Building, New York') print "Get Geolocation test" print_result(result)
def test_socket(): s = Tago(TOKEN).device.listening(func_callback, 1)
from tago import Tago my_device = Tago('b61c4c00-b85b-11e4-b1a6-0f628ad58a3a').device def func_callback_data(data): print data ''' Example output (data (python object)) { u'variable': u'speed', u'origin': u'54e61b6624aaf6cd1d97613f', u'bucket': u'54e61b5024aaf6cd1d97613e', u'value': u'2', u'time': u'2015-03-05T18:09:03.197Z' } ''' my_device.listening(func_callback_data)
def test_measure(): result = Tago(TOKEN).extra.distance().measure('35.7706256,-78.6952835', '35.7728213,-78.6865257', '', '') print "Distance Test:" print_result(result)
def test_convert(): result = Tago(TOKEN).extra.currency().convert('USD', 'GBP') print "Convert USD to GBP:" print_result(result)
def test_email(): result = Tago(TOKEN).services.email().send(to_email, email_sub, message, '', '') print "Email test result:" print result
def test_sms(): result = Tago(TOKEN).services.sms().send(to_phone, message) print "SmS test result:" print result
def test_forecast(): result = Tago(TOKEN).extra.weather().forecast('27606', False, 'EN') print "Weather Forecast Test:" print_result(result)
def test_alerts(): result = Tago(TOKEN).extra.weather().alerts('27606', False, 'EN') print "Weather Alert Test:" print_result(result)
def test_getAddress(): result = Tago(TOKEN).extra.geocoding().getAddress('23.434213,24.3233323') print "Get Address test" print_result(result)