*** Settings ***
Documentation    Integration tests for unified CRP/core context model hierarchy
Resource         ${CURDIR}/common.resource
Suite Setup      Setup Test Environment
Suite Teardown   Cleanup Test Environment

*** Variables ***
${HELPER}    ${CURDIR}/helper_unified_context_models.py

*** Test Cases ***
Core Types Are Instances Of CRP Base Types
    [Documentation]    Verify that all four core types pass isinstance checks against CRP bases
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    isinstance-check    cwd=${WORKSPACE}
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    unified-isinstance-ok

Unified Models Construct With Inherited And Extended Fields
    [Documentation]    Verify construction populates both CRP and core-specific fields
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    construction-check    cwd=${WORKSPACE}
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    unified-construction-ok

Frozen Models Reject Mutation
    [Documentation]    Verify frozen configuration is inherited and enforced
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    immutability-check    cwd=${WORKSPACE}
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    unified-immutability-ok
