浏览代码

updated tests

/tag-0.2.0
vincentpierre 7 年前
当前提交
7b534423
共有 1 个文件被更改,包括 14 次插入6 次删除
  1. 20
      python/test_unityagents.py

20
python/test_unityagents.py


import pytest
import socket
import mock
import struct
def append_length(input):
return struct.pack("I", len(input.encode())) + input.encode()
"apiNumber":"API-2",
"brainParameters": [{
"stateSize": 3,
"actionSize": 2,

dummy_reset = [
'CONFIG_REQUEST'.encode(),
append_length(
'''
{
"brain_name": "RealFakeBrain",

"actions": [1,2,3,4],
"memories": [],
"dones": [false, false]
}'''.encode(),
}'''),
'''
append_length('''
{
"brain_name": "RealFakeBrain",
"agents": [1,2,3],

"memories": [],
"dones": [false, false, false]
}'''.encode(),
}'''),
'''
append_length('''
{
"brain_name": "RealFakeBrain",
"agents": [1,2,3],

"memories": [],
"dones": [false, false, true]
}'''.encode(),
}'''),
def test_initialialization():
with mock.patch('subprocess.Popen') as mock_subproc_popen:

正在加载...
取消
保存