Ejemplo n.º 1
0
    def test_shutdown(self):
        kv_store = KeyValueClient('192.168.1.100:5665')
        socket = MockSocket(['\x00'])
        with patch('kvclient.base.create_connection', socket):
            response = kv_store.shutdown()

        assert socket.connection_info == ('192.168.1.100', 5665)
        assert socket.sent_value == '\x04'
        assert response is None
        assert socket.closed