We have to serialize our build data before sending it to etc.
This commit is contained in:
parent
709e571b78
commit
4e22e22ba1
2 changed files with 15 additions and 11 deletions
|
@ -2,6 +2,7 @@ import unittest
|
|||
import etcd
|
||||
import os.path
|
||||
import time
|
||||
import json
|
||||
|
||||
from trollius import coroutine, get_event_loop, From, Future, sleep
|
||||
from mock import Mock
|
||||
|
@ -130,7 +131,7 @@ class TestEphemeral(unittest.TestCase):
|
|||
expired_result.action = ETCD_EXPIRE_RESULT
|
||||
expired_result.key = self.mock_job_key
|
||||
expired_result._prev_node = Mock(spec=etcd.EtcdResult)
|
||||
expired_result._prev_node.value = {'builder_id': '1234'}
|
||||
expired_result._prev_node.value = json.dumps({'builder_id': '1234'})
|
||||
expired_future = Future()
|
||||
expired_future.set_result(expired_result)
|
||||
|
||||
|
@ -162,11 +163,11 @@ class TestEphemeral(unittest.TestCase):
|
|||
def test_heartbeat_response(self):
|
||||
expiration_timestamp = time.time() + 60
|
||||
builder_result = Mock(spec=etcd.EtcdResult)
|
||||
builder_result.value = {
|
||||
builder_result.value = json.dumps({
|
||||
'builder_id': '123',
|
||||
'expiration': expiration_timestamp,
|
||||
'max_expiration': expiration_timestamp,
|
||||
}
|
||||
})
|
||||
self.etcd_client_mock.read = Mock(return_value=builder_result)
|
||||
|
||||
yield From(self.manager.job_heartbeat(self.mock_job))
|
||||
|
|
Reference in a new issue