You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
753 B

#!/usr/bin/python2
#pylint: disable-msg=C0111
import unittest
import common
#pylint: disable-msg=W0611
from autotest_lib.frontend import setup_django_lite_environment
from autotest_lib.frontend.afe import direct_afe
class DirectAFETest(unittest.TestCase):
def testEntryCreation(self):
afe = direct_afe.directAFE()
jobs = afe.get_jobs()
self.assertEquals(len(jobs), 0)
hosts = afe.get_hosts()
self.assertEquals(len(hosts), 0)
afe.create_host('a_host')
hosts = afe.get_hosts()
self.assertEquals(len(hosts), 1)
afe.create_job('job_name', hosts=['a_host'])
jobs = afe.get_jobs()
self.assertEquals(len(jobs), 1)
if __name__ == '__main__':
unittest.main()