** Settings ***

Library          Telnet
Library          HttpLibrary.HTTP
Library          Process
Library          OperatingSystem

Resource         Server_lib.txt

Suite Setup      Initialize Emergent    ./chapter_4/self_org.proj
Suite Teardown   Shutdown Emergent

*** Variables ***

# use 'pybot -v debug:true server.txt' on the command line to
#      output the transmissions to/from Emergent using warnings
${debug} =       false

*** Test Cases ***

# Ideas on things to test
#  - SetDataTableCell and Matrix Cell

#
# Initialization and general tests
#

Initialize
    Set Suite Variable     ${verbose}       ${false}
    Set Suite Variable     ${project}       ./chapter_4/self_org.proj
    Run Keyword If         '${debug}' == 'true'       Set Suite Variable   ${verbose}  ${true}

Connection
    Sleep                  1 sec
    ${output} =            Read
    Print                  ${output}
    Should Contain         ${output}    Emergent Server v8.

# TODO: Start another process and check for the "Too many connections already" error.

#
# ParserTest
#

General RunState
    ${output} =                Run Command Wait      {"command": "GetRunState"}
    Status OK Match Result     ${output}             4


Uniq pats
    
    Run Emergent Program	LeabraTrain

    DataTable Cell Value Should Be Greater Than		.data.gp[\\\"OutputData\\\"][\\\"EpochOutputData\\\"]  29  uniq_pats   8  Uniq_pats at epoch 29

    

*** Keywords ***