<commit_before>*** Settings ***
Documentation   Testing reading and processing data from xml outputs generated by Robot or Rebot itself.
Default Tags    regression  pybot  jybot
Resource        atest_resource.txt

*** Test Cases ***
Test Case File Suite
    [Documentation]  Testing that output file created from simple test case file is correct.
    My Run Robot And Rebot  ${EMPTY}  misc/normal.html
    Should Be Equal  ${SUITE.name}  Normal
    Should Be Equal  ${SUITE.doc}  Normal test cases
    Should Be Equal  ${SUITE.metadata['Something']}  My Value
    Should Be Equal as Strings   ${SUITE.metadata}  {Something: My Value}
    Check Normal Suite Defaults  ${SUITE}
    Should Be Equal  ${SUITE.full_message}  2 critical tests, 2 passed, 0 failed\n 2 tests total, 2 passed, 0 failed
    Should Be Equal  ${SUITE.stat_message}  2 critical tests, 2 passed, 0 failed\n 2 tests total, 2 passed, 0 failed
    Check Suite Contains Tests  ${SUITE}  First One  Second One

Directory Suite
    [Documentation]  Testing suite created from a test suite directory. Also testing metadata from cli.
    My Run Robot And Rebot  --metadata x:y -M a:b --name My_Name --doc Something  misc/suites
    Should Be Equal  ${SUITE.name}  My Name
    Should Be Equal  ${SUITE.doc}  Something
    Should Be Equal  ${SUITE.metadata['x']}  y
    Should Be Equal  ${SUITE.metadata['a']}  b
    Should Be True   ${SUITE.get_metadata()} == [('a', 'b'), ('x', 'y')]
    Check Suite Got From misc/suites/ Directory

Minimal hand-created output
    [Documentation]  Testing minimal hand created suite with tests or subsuites
    Run Rebot  ${EMPTY}  rebot/created_normal.xml
    Check Names  ${SUITE}  Root
    Should Contain Suites  ${SUITE}  Sub 1  Sub 2
    Check Names  ${SUITE.suites[0]}  Sub 1  Root.
    Check Names  ${SUITE.suites[1]}  Sub 2  Root.
    Check Minimal Suite Defaults  ${SUITE}
    Check Minimal Suite Defaults  ${SUITE.suites[0]}
    Check Minimal Suite Defaults  ${SUITE.suites[1]}
    Check Suite Contains Tests  ${SUITE}  Test 1.1  Test 1.2  Test 2.1
    Check Names  ${SUITE.suites[0].tests[0]}  Test 1.1  Root.Sub 1.
    Check Names  ${SUITE.suites[0].tests[1]}  Test 1.2  Root.Sub 1.
    Check Names  ${SUITE.suites[1].tests[0]}  Test 2.1  Root.Sub 2.

*** Keywords ***
My Run Robot And Rebot
    [Arguments]  ${params}  @{paths}
    Run Tests Without Processing Output  ${params}  @{paths}
    Run Rebot  ${EMPTY}  ${OUTFILE}

Check Normal Suite Defaults
    [Arguments]  ${mysuite}  ${message}=  ${tests}=[]  ${teardown}=None
    Log  ${mysuite.name}
    Check Suite Defaults  ${mysuite}  ${message}  ${tests}  ${teardown}
    Check Normal Suite Times  ${mysuite}

Check Minimal Suite Defaults<commit_msg>atest: fixed extended variable usage after API changes<commit_after>*** Settings ***
Documentation   Testing reading and processing data from xml outputs generated by Robot or Rebot itself.
Default Tags    regression  pybot  jybot
Resource        atest_resource.txt

*** Test Cases ***
Test Case File Suite
    [Documentation]  Testing that output file created from simple test case file is correct.
    My Run Robot And Rebot  ${EMPTY}  misc/normal.html
    Should Be Equal  ${SUITE.name}  Normal
    Should Be Equal  ${SUITE.doc}  Normal test cases
    Should Be Equal  ${SUITE.metadata['Something']}  My Value
    Should Be Equal as Strings   ${SUITE.metadata}  {Something: My Value}
    Check Normal Suite Defaults  ${SUITE}
    Should Be Equal  ${SUITE.full_message}  2 critical tests, 2 passed, 0 failed\n 2 tests total, 2 passed, 0 failed
    Should Be Equal  ${SUITE.stat_message}  2 critical tests, 2 passed, 0 failed\n 2 tests total, 2 passed, 0 failed
    Check Suite Contains Tests  ${SUITE}  First One  Second One

Directory Suite
    [Documentation]  Testing suite created from a test suite directory. Also testing metadata from cli.
    My Run Robot And Rebot  --metadata x:y -M a:b --name My_Name --doc Something  misc/suites
    Should Be Equal  ${SUITE.name}  My Name
    Should Be Equal  ${SUITE.doc}  Something
    Should Be Equal  ${SUITE.metadata['x']}  y
    Should Be Equal  ${SUITE.metadata['a']}  b
    Should Be True   ${SUITE.metadata.items()} == [('a', 'b'), ('x', 'y')]
    Check Suite Got From misc/suites/ Directory

Minimal hand-created output
    [Documentation]  Testing minimal hand created suite with tests or subsuites
    Run Rebot  ${EMPTY}  rebot/created_normal.xml
    Check Names  ${SUITE}  Root
    Should Contain Suites  ${SUITE}  Sub 1  Sub 2
    Check Names  ${SUITE.suites[0]}  Sub 1  Root.
    Check Names  ${SUITE.suites[1]}  Sub 2  Root.
    Check Minimal Suite Defaults  ${SUITE}
    Check Minimal Suite Defaults  ${SUITE.suites[0]}
    Check Minimal Suite Defaults  ${SUITE.suites[1]}
    Check Suite Contains Tests  ${SUITE}  Test 1.1  Test 1.2  Test 2.1
    Check Names  ${SUITE.suites[0].tests[0]}  Test 1.1  Root.Sub 1.
    Check Names  ${SUITE.suites[0].tests[1]}  Test 1.2  Root.Sub 1.
    Check Names  ${SUITE.suites[1].tests[0]}  Test 2.1  Root.Sub 2.

*** Keywords ***
My Run Robot And Rebot
    [Arguments]  ${params}  @{paths}
    Run Tests Without Processing Output  ${params}  @{paths}
    Run Rebot  ${EMPTY}  ${OUTFILE}

Check Normal Suite Defaults
    [Arguments]  ${mysuite}  ${message}=  ${tests}=[]  ${teardown}=None
    Log  ${mysuite.name}
    Check Suite Defaults  ${mysuite}  ${message}  ${tests}  ${teardown}
    Check Normal Suite Times  ${mysuite}

Check Minimal Suite Defaults
{'fraction_non_alphanumeric': 0.10495520204790638, 'fraction_numerical': 0.014993600292558055, 'mean_word_length': 3.2370255615801704, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4925657', 'n_tokens_mistral': 1824, 'n_tokens_neox': 1741, 'n_words': 660}