https://klaxon.googlecode.com
Tip revision: b4052e61857a54a5608e92494b6cdfa26bd22b22 authored by muncus@gmail.com on 21 January 2012, 19:34:49 UTC
test script fix for new dev tools
test script fix for new dev tools
Tip revision: b4052e6
monkey_tests.py
# monkeyrunner script to install current klaxon, and run its tests.
# Author: Marc Dougherty <muncus@gmail.com>
import os
from com.android.monkeyrunner import MonkeyDevice, MonkeyRunner
INSTRUMENTATION_RUNNER = 'android.test.InstrumentationTestRunner'
device = MonkeyRunner.waitForConnection()
device.installPackage('bin/Klaxon-debug.apk')
device.installPackage('tests/bin/KlaxonTests-debug.apk')
package = 'org.nerdcircus.android.klaxon'
activity = package + ".KlaxonList"
test_dict = device.instrument("%s/%s" % (package+'.tests', INSTRUMENTATION_RUNNER))
assert 'OK' in test_dict['stream']
print test_dict['stream']
# try to send some smses through adb.
def sendSms(sender="11111", text="blah"):
os.system("adb emu 'sms send %(sender)s %(text)s'" % {
'sender': sender,
'text': text,})
sendSms(text="blah blah blah")
#import socket
#sock = socket.socket()
#sock.connect(('localhost', 5554))
#sock.recv(300) # eat the banner.
#pattern = "sms send 424242 %(msg)s\n"
#for m in ['foo', 'Foo', 'FOO']:
# sock.send(pattern % {'msg': m})
# assert 'OK' in sock.recv(10)