def main():
    call = Base()
    try:
        tests_file_path = sys.argv[1]
    except IndexError:
        raise Exception("Path to a tests file should be provided!")

    if os.path.exists(tests_file_path):
        logger.info("Reading tests file '%s'..." % tests_file_path)
        with open(tests_file_path) as f:
            test_cases = [test for test in f.read().split("\n") if test]
            logger.info("Tests file '%s' has been successfully read." %
                        tests_file_path)
    else:
        raise Exception("Tests file '%s' doesn't exist!" % tests_file_path)

    logger.info("Initializing TestRail client...")
    logger.info("TestRail client has been successfully initialized.")
    logger.info("Getting milestone '%s'..." % config.MILESTONE)

    milestone = call.get_milestone_by_name(config.MILESTONE)

    logger.info(milestone)
    logger.info("Getting tests suite '%s'..." % config.SUITE)

    suite = call.get_suite_by_name(config.SUITE)
    if not suite:
        logger.info("Tests suite '%s' not found. "
                    "Creating tests suite..." % config.SUITE)

        suite = call.add_suite(config.SUITE)
        logger.info("Tests suite has benn successfully created.")
    logger.info(suite)

    logger.info("Creating test cases for TestRail...")
    tr_test_cases = create_tr_test_cases(
        test_cases,
        milestone["id"],
        type_id=config.TEST_CASE_TYPE_ID,
        priority_id=config.TEST_CASE_PRIORITY_ID,
        qa_team=config.QA_TEAM)
    logger.info("Test cases have been successfully created.")

    sections_map = {}
    for section in sorted(config.SECTIONS_MAP.keys()):
        logger.info("Creating section '%s'..." % section)
        s = call.add_section(suite["id"], section)
        logger.info("Section '%s' has been successfully created." % section)
        sections_map[section] = s["id"]

    logger.info("Uploading created test cases to TestRail...")

    all_added_test_cases = []
    for t in tr_test_cases:
        test_cases = add_tr_test_case(call, sections_map[t["section"]], t)
        all_added_test_cases.append(test_cases)

    logger.info("Test cases have been successfully uploaded.")