Source code for odoo_xmlrpc_twisted.test.test_update_user_profile_values

"""
test program for module :func:`odoo_xmlrpc_twisted.functions.update_user_profile_values`
based on the "unittest" functionality
"""


import unittest
import os
import sys
import configparser

# Import base test case for shared Odoo connection
from odoo_xmlrpc_twisted.test.base_test_case import OdooTestCase



# as this program is in the folder "test",
# import the module to test from the parent directory
current = os.path.dirname(os.path.realpath(__file__))
parent_directory = os.path.dirname(current)
sys.path.append(parent_directory)
sys.path.append(os.path.join(parent_directory, 'functions'))
from update_user_profile_values import update_user_profile_values


# ------- get parameter from the settings file "parameter_test.ini" 

# Name and full path of the "ini" file
filename  = "parameter_test.ini"
# Get the parent directory (repo root) and navigate to config folder
current_dir = os.path.dirname(os.path.abspath(__file__))
parent_dir = os.path.dirname(current_dir)
config_dir = os.path.join(parent_dir, 'config')
fullpath  = os.path.join(config_dir, filename)

config = configparser.ConfigParser()
config.read(fullpath)


#  get the dedicated user_id of the customer
custom_user_id = int(config.get('get_settings_customer', 'user_id'))
#  get the dedicated login of the customer
custom_login = config.get('get_settings_customer', 'login')
#  get the dedicated email of the customer
custom_email = config.get('get_settings_customer', 'email')
#  get the dedicated name of the customer
custom_name = config.get('get_settings_customer', 'name')
#  get the dedicated title of the customer
custom_title = config.get('get_settings_customer', 'title')
#  get the dedicated language of the customer
custom_language = config.get('get_settings_customer', 'language')
#  get the dedicated language of the customer
custom_language = config.get('get_settings_customer', 'language')
#  get the dedicated phone number of the customer
custom_phone_number = config.get('get_settings_customer', 'phone')
#  get the dedicated mobile number of the customer
custom_mobile_number = config.get('get_settings_customer', 'mobile')


[docs] class test_update_user_profile_values(OdooTestCase): """ Class for the test cases of the module "update_user_profile_values" """
[docs] def test_cases(self): """ test cases of the module "update_user_profile_values" """ self.assertEqual(update_user_profile_values(custom_user_id, custom_login, custom_email, custom_name, custom_title, custom_language, custom_phone_number, custom_mobile_number), True)
if __name__ == "__main__": unittest.main()