Source code for odoo_xmlrpc_twisted.test.test_check_user_login

"""
test program for module :func:`odoo_xmlrpc_twisted.functions.check_user_login`
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 ReadOnlyOdooTestCase



# as this program is in the folder "test",
# import the module to test from the subdirectory "support"
current = os.path.dirname(os.path.realpath(__file__))
parent_directory = os.path.dirname(current)
sys.path.append(parent_directory + '/support')
from support_check_user_login import support_check_user_login


# ------- 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 login of the customer
custom_login = config.get('get_settings_customer', 'login')
#  get the dedicated password of the customer
custom_password = config.get('get_settings_customer', 'password')


[docs] class test_check_user_login(ReadOnlyOdooTestCase): """ Class for the test cases of the module "check_user_login" """
[docs] def test_cases(self): """ test cases of the module "check_user_login" """ # the support module prepares the prerequisites # for the test and execute the test self.assertEqual(support_check_user_login(custom_login, custom_password), 'True')
if __name__ == "__main__": unittest.main()