Ejemplo n.º 1
0
    def test_deserialize_called_with_response_body(self):
        response = Response("Hello, World!", 0)
        sender = MockSender(response)
        deserializer = FakeDeserializer(None)
        client = Client(sender, deserializer)

        client.send_lookup(Lookup())

        self.assertEqual(response.payload, deserializer.input)
    def test_single_lookup_values_correctly_assigned_to_parameters(self):
        sender = RequestCapturingSender()
        serializer = FakeDeserializer({})
        client = Client(sender, serializer)
        lookup = Lookup()

        lookup.city = '0'
        lookup.state = '1'
        lookup.zipcode = '2'

        client.send_lookup(lookup)

        self.assertEqual('0', sender.request.parameters['city'])
        self.assertEqual('1', sender.request.parameters['state'])
        self.assertEqual('2', sender.request.parameters['zipcode'])