Add Check support to the payload factories

This change adds Check payload support to the payload factories.
Payload factory unit tests have been updated to account for the
change.
This commit is contained in:
Peter Hamilton 2018-04-17 00:32:20 -04:00
parent 72280f8ddc
commit 664c9964c8
4 changed files with 10 additions and 2 deletions

View File

@ -40,6 +40,9 @@ class RequestPayloadFactory(PayloadFactory):
def _create_locate_payload(self):
return payloads.LocateRequestPayload()
def _create_check_payload(self):
return payloads.CheckRequestPayload()
def _create_get_payload(self):
return payloads.GetRequestPayload()

View File

@ -40,6 +40,9 @@ class ResponsePayloadFactory(PayloadFactory):
def _create_locate_payload(self):
return payloads.LocateResponsePayload()
def _create_check_payload(self):
return payloads.CheckResponsePayload()
def _create_get_payload(self):
return payloads.GetResponsePayload()

View File

@ -77,7 +77,8 @@ class TestRequestPayloadFactory(testtools.TestCase):
self._test_payload_type(payload, payloads.LocateRequestPayload)
def test_create_check_payload(self):
self._test_not_implemented(self.factory.create, enums.Operation.CHECK)
payload = self.factory.create(enums.Operation.CHECK)
self._test_payload_type(payload, payloads.CheckRequestPayload)
def test_create_get_payload(self):
payload = self.factory.create(enums.Operation.GET)

View File

@ -77,7 +77,8 @@ class TestResponsePayloadFactory(testtools.TestCase):
self._test_payload_type(payload, payloads.LocateResponsePayload)
def test_create_check_payload(self):
self._test_not_implemented(self.factory.create, enums.Operation.CHECK)
payload = self.factory.create(enums.Operation.CHECK)
self._test_payload_type(payload, payloads.CheckResponsePayload)
def test_create_get_payload(self):
payload = self.factory.create(enums.Operation.GET)