• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/python3
2#pylint: disable-msg=C0111
3import unittest
4import common
5#pylint: disable-msg=W0611
6from autotest_lib.frontend import setup_django_lite_environment
7from autotest_lib.frontend.afe import direct_afe
8
9
10class DirectAFETest(unittest.TestCase):
11    def testEntryCreation(self):
12        afe = direct_afe.directAFE()
13
14        jobs = afe.get_jobs()
15        self.assertEquals(len(jobs), 0)
16
17        hosts = afe.get_hosts()
18        self.assertEquals(len(hosts), 0)
19
20        afe.create_host('a_host')
21        hosts = afe.get_hosts()
22        self.assertEquals(len(hosts), 1)
23
24        afe.create_job('job_name', hosts=['a_host'])
25        jobs = afe.get_jobs()
26        self.assertEquals(len(jobs), 1)
27
28if __name__ == '__main__':
29    unittest.main()
30