Example #1
0
 def build(self, value):
     if value is None:
         raise ValueError(
             _exc_message.format(_attr_name_build, value,
                                 'A lot of variants :)'))
     else:
         try:
             change_sync_icon_db(self.sync_v, value)
         except InvalidSyncVersion as e:
             self.__roll_back(e)
         except InvalidSyncBuildVersion as e:
             self.__roll_back(e)
         self._build = value
Example #2
0
def test_change_sync_and_build_version(get_current_sync_build_version):
    # getting sync and builds values from config file
    current_sync, current_build = get_current_sync_build_version
    if SYNC3_VERSION in current_sync:
        # change sync3->sync4 and sync_build3->sync_build4
        hmi.change_sync_icon_db(SYNC4_VERSION, SYNC4_BUILD_NAME)
        logging.info("Change mode is successfully done")
        # check that sync3 image isn't recognized
        assert not helpers.get_exist_result(
            sync3_icon.MAIN_PHONE_BUTTON_ACTIVE)
    elif SYNC4_VERSION in current_sync:
        # change sync4->sync3 and sync_build4->sync_build3
        hmi.change_sync_icon_db(SYNC3_VERSION, SYNC3_BUILD_NAME)
        logging.info("Change mode is successfully done")
        # check that sync4 image isn't recognized
        assert not helpers.get_exist_result(
            sync4_icon.MAIN_PHONE_BUTTON_INACTIVE)
    else:
        raise Exception(
            'Can`t get value of sync and build version from config file')
Example #3
0
def test_check_incorrect_build_value(get_current_sync_build_version):
    with pytest.raises(InvalidSyncBuildVersion) as error:
        hmi.change_sync_icon_db(SYNC3_VERSION, SYNC_INCORRECT_BUILD)
    logging.info(error.value.args[0])
Example #4
0
def test_check_empty_sync_and_build_values(get_current_sync_build_version):
    with pytest.raises(ValueError) as error:
        hmi.change_sync_icon_db("", "")
    logging.info(error.value.args[0])