allwinner_a64/android/external/autotest/frontend/afe/direct_afe_unittest.py
2018-08-08 16:14:42 +08:00

29 lines
752 B
Python
Executable file

#!/usr/bin/python
#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()