Example #1
0
    def test_init_window(self):
        logging.debug("Running setup test")
        cnc = CommandAndControl()
        cnc.get_win_handler().init_window(pos=[0, 0, 700, 500])
        bbox = cnc.get_win_handler().get_bbox()

        assert (len(bbox) == 4)
        assert (bbox == (0, 0, 700, 500))
Example #2
0
    def test_init_window(self):
        logging.debug("Running setup test")
        cnc = CommandAndControl()
        cnc.get_win_handler().init_window(pos=[0, 0, 700, 500])
        bbox = cnc.get_win_handler().get_bbox()

        assert (len(bbox) == 4)
        assert (bbox == (0, 0, 700, 500))
Example #3
0
    def test_hwnd_by_title(self):
        logging.debug("Running hwnd by title test")
        cnc = CommandAndControl()
        parser = SafeConfigParser()
        parser.read('config.ini')

        title = parser.get('general', 'winTitle')
        assert (title is "Battlefield 4")
        assert (win32gui.FindWindow(None, title) == cnc.get_win_handler().get_hwnd_by_title_class(title))
Example #4
0
    def test_basic_commands(self):
        win_handler = wh.WinHandler()
        pixel_handler = ps.PixelSearch(win_handler)
        mouse_handler = mm.MouseMovement(win_handler)

        com = CommandAndControl(win_handler, pixel_handler, mouse_handler)

        com.use_UAV((0.5, 0.5))
        sleep(2)
        com.use_EMP((0.4, 0.4))
Example #5
0
    def test_hwnd_by_title(self):
        logging.debug("Running hwnd by title test")
        cnc = CommandAndControl()
        parser = SafeConfigParser()
        parser.read('config.ini')

        title = parser.get('general', 'winTitle')
        assert (title is "Battlefield 4")
        assert (win32gui.FindWindow(
            None,
            title) == cnc.get_win_handler().get_hwnd_by_title_class(title))
Example #6
0
    def test_basic_commands(self):
        win_handler = wh.WinHandler()
        pixel_handler = ps.PixelSearch(win_handler)
        mouse_handler = mm.MouseMovement(win_handler)

        com = CommandAndControl(win_handler, pixel_handler, mouse_handler)

        com.use_UAV((0.5, 0.5))
        sleep(2)
        com.use_EMP((0.4, 0.4))