您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
49 行
1.7 KiB
49 行
1.7 KiB
using NUnit.Framework;
|
|
using UnityEngine.TestTools;
|
|
|
|
namespace Unity.MLAgents.Tests.Communicator
|
|
{
|
|
[TestFixture]
|
|
public class RpcCommunicatorTests
|
|
{
|
|
|
|
[Test]
|
|
public void TestCheckCommunicationVersionsAreCompatible()
|
|
{
|
|
var unityVerStr = "1.0.0";
|
|
var pythonVerStr = "1.0.0";
|
|
var pythonPackageVerStr = "0.16.0";
|
|
|
|
Assert.IsTrue(RpcCommunicator.CheckCommunicationVersionsAreCompatible(unityVerStr,
|
|
pythonVerStr,
|
|
pythonPackageVerStr));
|
|
LogAssert.NoUnexpectedReceived();
|
|
|
|
pythonVerStr = "1.1.0";
|
|
Assert.IsTrue(RpcCommunicator.CheckCommunicationVersionsAreCompatible(unityVerStr,
|
|
pythonVerStr,
|
|
pythonPackageVerStr));
|
|
LogAssert.NoUnexpectedReceived();
|
|
|
|
unityVerStr = "2.0.0";
|
|
Assert.IsFalse(RpcCommunicator.CheckCommunicationVersionsAreCompatible(unityVerStr,
|
|
pythonVerStr,
|
|
pythonPackageVerStr));
|
|
|
|
unityVerStr = "0.15.0";
|
|
pythonVerStr = "0.15.0";
|
|
Assert.IsTrue(RpcCommunicator.CheckCommunicationVersionsAreCompatible(unityVerStr,
|
|
pythonVerStr,
|
|
pythonPackageVerStr));
|
|
unityVerStr = "0.16.0";
|
|
Assert.IsFalse(RpcCommunicator.CheckCommunicationVersionsAreCompatible(unityVerStr,
|
|
pythonVerStr,
|
|
pythonPackageVerStr));
|
|
unityVerStr = "1.15.0";
|
|
Assert.IsFalse(RpcCommunicator.CheckCommunicationVersionsAreCompatible(unityVerStr,
|
|
pythonVerStr,
|
|
pythonPackageVerStr));
|
|
|
|
}
|
|
}
|
|
}
|