我已经运行了Sonos Self-Test Suite available here,除了这一个错误之外,一切都通过了,我不确定原因:
Test case: PollingIntervalTest test_getlastupdate_no_change
Instance messages: could not convert string to float
...more output...
2016-02-23 09:43:40,834 [STOP] SONOS.sonos.workflow.fixture.PollingIntervalTest - could not convert string to float:
2016-02-23 09:43:40,834 [STOP] SONOS.sonos.workflow.fixture.PollingIntervalTest - 1212827 PollingIntervalTest test_getlastupdate_no_change
2016-02-23 09:43:40,836 [DEBUG] SONOS.sonos.workflow.fixture.PollingIntervalTest - [('../../sonos-1.1.0.dev_r208947-py2.7.egg/sonos/workflow/fixture.py', 2494, '_run_test_iteration', 'testMethod()'), ('/Users/rob/Dropbox/dev/projects/composed/sonos_downloads/sonos-selftest/smapi/content_workflow/getlastupdate.py', 40, 'test_getlastupdate_no_change', 'poll_interval = self.smapiservice.get_polling_interval()'), ('../../sonos-1.1.0.dev_r208947-py2.7.egg/sonos/smapi/smapiservice.py', 374, 'get_polling_interval', "pollinterval = self.config.getfloat('Polling Interval', 'interval')")]
2016-02-23 09:43:40,836 [INFO] SONOS.sonos.workflow.fixture.PollingIntervalTest - - - - - - - - - - - - - - - - - - - - - - - - - -
2016-02-23 09:43:40,836 [INFO] SONOS.sonos.workflow.result - End *test case* test_getlastupdate_no_change at Tuesday, February 23, 2016 09:43 AM
这是我的服务返回的内容:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.sonos.com/Services/1.1">
<soap:Body>
<tns:getLastUpdateResponse>
<getLastUpdateResult>
<catalog>2016-02-18 11:52:30</catalog>
<favorites>Rob-2016-02-18 12:01:00</favorites>
<pollInterval>30</pollInterval>
</getLastUpdateResult>
</tns:getLastUpdateResponse>
</soap:Body>
</soap:Envelope>
它似乎与sample response in the Sonos API docs几乎完全相同。您可以看到pollInterval没有在SOAP XML中指定类型信息,所以我很难看到这个错误是由于我正在做的事情。
我做错了什么,或者这可能是测试套件本身的问题?
答案 0 :(得分:0)
我认为这可能是自我测试特殊字符的问题,特别是“:”,在标记值内。如果可能,尝试返回样本响应中指定的整数,以查看是否可以解决问题。