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_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))