我正在尝试在 apama 中使用AUnit进行单元测试。所以我检查并阅读了 Aunit 包在后端使用 Apama Pysys 来测试 Apama 应用程序。
虽然我成功构建了 Aunit 包,但在测试随它提供的示例 Apama 监视器时出现错误。我不断收到警告:
c:\aunit-master\bin>aunit test Math
Copying C:\aunit-master\workspace\Math/src/Float.mon to C:\aunit-master\.__test\resources\Float.mon
2019-02-26 13:18:30,296 INFO ==============================================================
2019-02-26 13:18:30,300 INFO Id : MathFloatTest
2019-02-26 13:18:30,302 INFO Title: MathFloatTest
2019-02-26 13:18:30,304 INFO ==============================================================
2019-02-26 13:18:33,068 WARN caught <class '_csv.Error'> while running test: iterator should return strings, not bytes (did you open the file in text mode?)
Traceback (most recent call last):
File "C:\SoftwareAG2\Apama\third_party\python\Lib\site-packages\pysys\baserunner.py", line 561, in __call__
self.testObj.validate()
File "C:\aunit-master\.__test\MathFloatTest\run.py", line 27, in validate
for row in reader:
_csv.Error: iterator should return strings, not bytes (did you open the file in text mode?)
2019-02-26 13:18:33,299 WARN iterator should return strings, not bytes (did you open the file in text mode?) (<class '_csv.Error'>) ... blocked
2019-02-26 13:18:36,196 WARN caught <class '_csv.Error'> while running test: iterator should return strings, not bytes (did you open the file in text mode?)
Traceback (most recent call last):
File "C:\SoftwareAG2\Apama\third_party\python\Lib\site-packages\pysys\baserunner.py", line 561, in __call__
self.testObj.validate()
File "C:\aunit-master\.__test\MathIntegerTest\run.py", line 27, in validate
for row in reader:
_csv.Error: iterator should return strings, not bytes (did you open the file in text mode?)
2019-02-26 13:18:36,203 WARN iterator should return strings, not bytes (did you open the file in text mode?) (<class '_csv.Error'>) ... blocked
2019-02-26 13:18:36,328 CRIT
2019-02-26 13:18:36,329 CRIT Completed test run at: Tuesday 2019-02-26 13:18:36 W. Europe Standard Time
2019-02-26 13:18:36,330 CRIT Total test duration: 6.04 secs
2019-02-26 13:18:36,330 CRIT
2019-02-26 13:18:36,331 CRIT Summary of non passes:
2019-02-26 13:18:36,331 CRIT BLOCKED: MathFloatTest
2019-02-26 13:18:36,332 CRIT BLOCKED: MathIntegerTest
此警告将测试用例的结果显示为 BLOCKED。