You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
smart-top/test/TestActors.py

37 lines
1012 B
Python

from utils.agents.actor import Actor
import json
import unittest
f = open ('config.json')
CONFIG = json.loads(f.read())
f.close()
class TestActor(unittest.TestCase):
@staticmethod
def message():
m = {}
return m
def test_InstanceName(self) :
name = 'Apps'
o = Actor.instance('Apps',CONFIG)
self.assertIsNotNone(o)
def test_InstanceList(self) :
name = ['Apps','Folders','Mailer']
o = Actor.instance(name,CONFIG)
self.assertTrue(isinstance(o,list))
self.assertTrue(len(o) > 0)
def test_AppKill(self) :
m = {'label':'firefox','action':'kill'}
app = Actor.instance('Apps',CONFIG)
app.init('kill',m)
app.run()
def test_AppReboot(self):
m = {'label':'firefox','cmd':'/Applications/Firefox.app/Contents/MacOS/firefox'}
app = Actor.instance('Apps',CONFIG)
app.init('start',m)
app.run()
pass
if __name__ == '__main__':
unittest.main()