<commit_before># -*- coding: utf-8 -*-

from autopilot.testcase import AutopilotTestCase
from autopilot.matchers import Eventually
from testtools.matchers import Equals

from os.path import abspath, dirname, join
import time
import logging

from test_installer import installerTestBase
from test_config import *
from inner import *

class BasicProcessTests(installerTestBase):
    """ basic process for installer """

    def _test_single_udisk_installing_with_net_img(self):
        """ test routine:
                single udisk installing process with image from network
        """
        self.log_setup()
        # launch application
        self.app_setup()
        
        # what if we don't have usb stick mounted
        # check if we have msgbox and push it
        exitFlag = self.app_handle_no_usb_disks_msg()
        if(RET_SUCCESS == exitFlag):
            return
        
        # go to main win position
        self.app_do_move_mouse_2_mainwin()
        
        # check "download and install..." box
        self.app_do_checkbox_download()
        
        # choose usb stick, such as /dev/sdb.
        self.app_do_checkbox_udisk(0)

        # press "make it" button
        self.app_do_pushbutton_makeit()
        
        # process msg box poped up after clicking "make it"   
        exitFlag = self.app_handle_confirm_build_msg(True)
        self.app_do_move_mouse_2_mainwin()
        
        # wait to complete installing   
        ret = self.app_do_statewin_wait_completed(-1)
        self.assertTrue(ret)

        # our completed info button will kill application
        # this will cause autipilot identify this as a failed test
        self.app_handle_completed_msg()
        return
    
    def test_single_udisk_installing_with_local_img(self):
        """ test routine:
                single udisk installing process with image from local path
        """
        self.log_setup()
        # launch application
        self.app_setup()
        
        # what if we don't have usb stick mounted
        # check if we have msgbox and push it
        exitFlag = self.app_handle_no_usb_disks_msg()
        if(RET_SUCCESS == exitFlag):
            return
        
        # go to main win position
        self.app_do_move_mouse_2_mainwin()
        self.app_do_load_local_img()
        
        # choose usb stick, such as /dev/sdb.
        self.app_do_checkbox_udisk(0)
        
         # press "make it" button
        self.app_do_pushbutton_makeit()
        
        # process msg box poped up after clicking "make it"   
        exitFlag = self.app_handle_confirm_build_msg(True)
        self.app_do_move_mouse_2_mainwin()

        # wait to complete installing
        ret = self.app_do_statewin_wait_completed(-1)
        self.assertTrue(ret)

        # our completed info button will kill application
        # this will cause autipilot identify this as a failed test
        self.app_handle_completed_msg()
        return
    
    def test_multi_udisk_installing_with_local_img(self):
        """ test routine:
                multi udisk installing process with iamge from local path
        """
        self.log_setup()
        # launch application
        self.app_setup()
        
        # what if we don't have usb stick mounted
        # check if we have msgbox and push it
        exitFlag = self.app_handle_no_usb_disks_msg()
        if(RET_SUCCESS == exitFlag):
            return
        
        # go to main win position
        self.app_do_move_mouse_2_mainwin()
        
        # check "download and install..." box
        self.app_do_checkbox_download()
        
        # choose usb stick, such as /dev/sdb.
        self.app_do_checkbox_udisk(0)

        # press "make it" button
        self.app_do_pushbutton_makeit()
        
        # process msg box poped up after clicking "make it"   
        exitFlag = self.app_handle_confirm_build_msg(True)
        self.app_do_move_mouse_2_mainwin()
        
        # wait to complete installing
        ret = self.app_do_statewin_wait_completed(-1)
        self.assertTrue(ret)

        # our completed info button will kill application
        # this will cause autipilot identify this as a failed test
        self.app_handle_completed_msg()
        return

    def test_single_udisk_downloading_cancel_and_continue_with_net_image(self):
        """ test routine:
                after preparation, we begin downloading image from network ,
                then we cancel downloading operation and then continue this process
        """
        self.log_setup()
        # launch application
        self.app_setup()
        
        # what if we don't have usb stick mounted
        # check if we have msgbox and push it
        exitFlag = self.app_handle_no_usb_disks_msg()<commit_msg>[test]: make multi udisk test work correctly and now we can handle 2 udisks<commit_after># -*- coding: utf-8 -*-

from autopilot.testcase import AutopilotTestCase
from autopilot.matchers import Eventually
from testtools.matchers import Equals

from os.path import abspath, dirname, join
import time
import logging

from test_installer import installerTestBase
from test_config import *
from inner import *

class BasicProcessTests(installerTestBase):
    """ basic process for installer """

    def _test_single_udisk_installing_with_net_img(self):
        """ test routine:
                single udisk installing process with image from network
        """
        self.log_setup()
        # launch application
        self.app_setup()
        
        # what if we don't have usb stick mounted
        # check if we have msgbox and push it
        exitFlag = self.app_handle_no_usb_disks_msg()
        if(RET_SUCCESS == exitFlag):
            return
        
        # go to main win position
        self.app_do_move_mouse_2_mainwin()
        
        # check "download and install..." box
        self.app_do_checkbox_download()
        
        # choose usb stick, such as /dev/sdb.
        self.app_do_checkbox_udisk(0)

        # press "make it" button
        self.app_do_pushbutton_makeit()
        
        # process msg box poped up after clicking "make it"   
        exitFlag = self.app_handle_confirm_build_msg(True)
        self.app_do_move_mouse_2_mainwin()
        
        # wait to complete installing   
        ret = self.app_do_statewin_wait_completed(-1)
        self.assertTrue(ret)

        # our completed info button will kill application
        # this will cause autipilot identify this as a failed test
        self.app_handle_completed_msg()
        return
    
    def test_single_udisk_installing_with_local_img(self):
        """ test routine:
                single udisk installing process with image from local path
        """
        self.log_setup()
        # launch application
        self.app_setup()
        
        # what if we don't have usb stick mounted
        # check if we have msgbox and push it
        exitFlag = self.app_handle_no_usb_disks_msg()
        if(RET_SUCCESS == exitFlag):
            return
        
        # go to main win position
        self.app_do_move_mouse_2_mainwin()
        self.app_do_load_local_img()
        
        # choose usb stick, such as /dev/sdb.
        self.app_do_checkbox_udisk(0)
        
         # press "make it" button
        self.app_do_pushbutton_makeit()
        
        # process msg box poped up after clicking "make it"   
        exitFlag = self.app_handle_confirm_build_msg(True)
        self.app_do_move_mouse_2_mainwin()

        # wait to complete installing
        ret = self.app_do_statewin_wait_completed(-1)
        self.assertTrue(ret)

        # our completed info button will kill application
        # this will cause autipilot identify this as a failed test
        self.app_handle_completed_msg()
        return
    
    def test_multi_udisk_installing_with_local_img(self):
        """ test routine:
                multi udisk installing process with iamge from local path
        """
        self.log_setup()
        # launch application
        self.app_setup()
        
        # what if we don't have usb stick mounted
        # check if we have msgbox and push it
        exitFlag = self.app_handle_no_usb_disks_msg()
        if(RET_SUCCESS == exitFlag):
            return

        self.app_do_checkbox_udisk(0)
        self.app_do_checkbox_udisk(1)
        
        # go to main win position
        self.app_do_move_mouse_2_mainwin()
        self.app_do_load_local_img()
        
        # choose usb stick, such as /dev/sdb.
        self.app_do_checkbox_udisk(0)
        self.app_do_checkbox_udisk(1)

        # press "make it" button
        self.app_do_pushbutton_makeit()
        
        # process msg box poped up after clicking "make it"   
        exitFlag = self.app_handle_confirm_build_msg(True)
        self.app_do_move_mouse_2_mainwin()
        
        # wait to complete installing
        ret = self.app_do_statewin_wait_completed(-1)
        self.assertTrue(ret)

        # our completed info button will kill application
        # this will cause autipilot identify this as a failed test
        self.app_handle_completed_msg()
        return

    def test_single_udisk_downloading_cancel_and_continue_with_net_image(self):
        """ test routine:
                after preparation, we begin downloading image from network ,
                then we cancel downloading operation and then continue this process
        """
        self.log_setup()
        # launch application
        self.app_setup()
        
        # what if we don't have usb stick mounted
        # check if we have msgbox and push it
        exitFlag = self.app_handle_no_usb_disks_msg()
{'fraction_non_alphanumeric': 0.06016276913567529, 'fraction_numerical': 0.003090553209024415, 'mean_word_length': 2.1245574509172838, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5212298', 'n_tokens_mistral': 2764, 'n_tokens_neox': 2687, 'n_words': 768}