~bennabiy/+junk/python-xlib

« back to all changes in this revision

Viewing changes to test/test_requests_le.py

  • Committer: Package Import Robot
  • Author(s): Andrew Shadura, Ramkumar Ramachandra, Andrew Shadura
  • Date: 2015-08-13 08:14:19 UTC
  • mfrom: (6.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20150813081419-hdefinnghp2iydkx
Tags: 0.14+20091101-3
[ Ramkumar Ramachandra ]
* Remove useless debugging output (Closes: #565996)

[ Andrew Shadura ]
* Switch to 3.0 (quilt) format.
* Rename patches.
* Use debhelper 9 in its short form.
* Use pybuild.
* Bump Standards-Version.
* Don't build or install PostScript documentation and info files.
* Use system-provided texi2html instead of a shipped version
  (Closes: #795057).
* Update debian/copyright (Closes: #795057).
* Don't install Makefile or texi2html with the documentation.
* Set executable bit for examples.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
import sys, os
4
4
sys.path.insert(1, os.path.join(sys.path[0], '..'))
5
5
 
6
 
import string
7
6
import unittest
8
7
from Xlib.protocol import request, rq, event
9
8
import Xlib.protocol.event
13
12
 
14
13
class CmpArray:
15
14
    def __init__(self, *args, **kws):
16
 
        self.array = apply(array.array, args, kws)
 
15
        self.array = array.array(*args, **kws)
17
16
 
18
17
    def __len__(self):
19
18
        return len(self.array)
21
20
    def __getslice__(self, x, y):
22
21
        return list(self.array[x:y])
23
22
 
 
23
    def __getitem__(self, n):
 
24
        if isinstance(n, slice):
 
25
            return list(self.array.__getitem__(n))
 
26
        else:
 
27
            return self.array[n]
 
28
 
24
29
    def __getattr__(self, attr):
25
30
        return getattr(self.array, attr)
26
31
 
27
 
    def __cmp__(self, other):
28
 
        return cmp(self.array.tolist(), other)
 
32
    def __eq__(self, other):
 
33
        return self.array.tolist() == other
 
34
 
 
35
    def __ne__(self, other):
 
36
        return self.array.tolist() != other
29
37
 
30
38
rq.array = CmpArray
31
39
 
32
40
def tohex(bin):
33
 
    bin = string.join(map(lambda c: '\\x%02x' % ord(c), bin), '')
 
41
    bin = ''.join(map(lambda c: '\\x%02x' % c, bin))
34
42
 
35
43
    bins = []
36
44
    for i in range(0, len(bin), 16):
43
51
        except IndexError:
44
52
            bins2.append("'%s'" % bins[i])
45
53
 
46
 
    return string.join(bins2, ' \\\n            ')
 
54
    return ' \\\n            '.join(bins2)
47
55
 
48
56
class DummyDisplay:
49
57
    def get_resource_class(self, x):
75
83
            'border_width': 29625,
76
84
            'window_class': 2,
77
85
            }
78
 
        self.req_bin_0 = '\x01\xc6\x17\x00' '\xa1\x2e\xb9\x25' \
79
 
            '\x30\xfa\x8f\x21' '\x42\xe9\x11\x8d' \
80
 
            '\x1f\xd7\x5b\xf2' '\xb9\x73\x02\x00' \
81
 
            '\x4d\x3e\x64\x30' '\xff\x7f\x00\x00' \
82
 
            '\x58\x2e\x54\x4e' '\x2c\x67\x7e\x2a' \
83
 
            '\x35\x39\xa1\x1e' '\x2c\x60\x60\x51' \
84
 
            '\x06\x00\x00\x00' '\x06\x00\x00\x00' \
85
 
            '\x01\x00\x00\x00' '\xc4\x0f\xc8\x34' \
86
 
            '\x1e\xac\xf5\x64' '\x01\x00\x00\x00' \
87
 
            '\x00\x00\x00\x00' '\x33\x4a\x4c\x35' \
88
 
            '\xc3\x5e\xcd\x27' '\xb9\xb0\x69\x3a' \
89
 
            '\x28\x59\xfa\x2e'
 
86
        self.req_bin_0 = b'\x01\xc6\x17\x00' b'\xa1\x2e\xb9\x25' \
 
87
            b'\x30\xfa\x8f\x21' b'\x42\xe9\x11\x8d' \
 
88
            b'\x1f\xd7\x5b\xf2' b'\xb9\x73\x02\x00' \
 
89
            b'\x4d\x3e\x64\x30' b'\xff\x7f\x00\x00' \
 
90
            b'\x58\x2e\x54\x4e' b'\x2c\x67\x7e\x2a' \
 
91
            b'\x35\x39\xa1\x1e' b'\x2c\x60\x60\x51' \
 
92
            b'\x06\x00\x00\x00' b'\x06\x00\x00\x00' \
 
93
            b'\x01\x00\x00\x00' b'\xc4\x0f\xc8\x34' \
 
94
            b'\x1e\xac\xf5\x64' b'\x01\x00\x00\x00' \
 
95
            b'\x00\x00\x00\x00' b'\x33\x4a\x4c\x35' \
 
96
            b'\xc3\x5e\xcd\x27' b'\xb9\xb0\x69\x3a' \
 
97
            b'\x28\x59\xfa\x2e'
90
98
 
91
99
 
92
100
    def testPackRequest0(self):
93
 
        bin = apply(request.CreateWindow._request.to_binary, (), self.req_args_0)
 
101
        bin = request.CreateWindow._request.to_binary(*(), **self.req_args_0)
94
102
        try:
95
103
            assert bin == self.req_bin_0
96
104
        except AssertionError:
114
122
            'window': 560274578,
115
123
            'attrs': {'cursor': 1238338372, 'override_redirect': 0, 'bit_gravity': 6, 'event_mask': 1980992429, 'border_pixel': 310964771, 'background_pixel': 1268171782, 'save_under': 1, 'colormap': 171538239, 'do_not_propagate_mask': 135558419, 'backing_store': 2, 'win_gravity': 10, 'backing_planes': 252687930, 'border_pixmap': 287169917, 'backing_pixel': 1114685309, 'background_pixmap': 2004887498},
116
124
            }
117
 
        self.req_bin_0 = '\x02\x00\x12\x00' '\x92\x1c\x65\x21' \
118
 
            '\xff\x7f\x00\x00' '\xca\x27\x80\x77' \
119
 
            '\x06\xc4\x96\x4b' '\x7d\xdd\x1d\x11' \
120
 
            '\x23\xf2\x88\x12' '\x06\x00\x00\x00' \
121
 
            '\x0a\x00\x00\x00' '\x02\x00\x00\x00' \
122
 
            '\x3a\xb6\x0f\x0f' '\x7d\xbf\x70\x42' \
123
 
            '\x00\x00\x00\x00' '\x01\x00\x00\x00' \
124
 
            '\xad\x8b\x13\x76' '\x13\x75\x14\x08' \
125
 
            '\x3f\x77\x39\x0a' '\x44\x8b\xcf\x49'
 
125
        self.req_bin_0 = b'\x02\x00\x12\x00' b'\x92\x1c\x65\x21' \
 
126
            b'\xff\x7f\x00\x00' b'\xca\x27\x80\x77' \
 
127
            b'\x06\xc4\x96\x4b' b'\x7d\xdd\x1d\x11' \
 
128
            b'\x23\xf2\x88\x12' b'\x06\x00\x00\x00' \
 
129
            b'\x0a\x00\x00\x00' b'\x02\x00\x00\x00' \
 
130
            b'\x3a\xb6\x0f\x0f' b'\x7d\xbf\x70\x42' \
 
131
            b'\x00\x00\x00\x00' b'\x01\x00\x00\x00' \
 
132
            b'\xad\x8b\x13\x76' b'\x13\x75\x14\x08' \
 
133
            b'\x3f\x77\x39\x0a' b'\x44\x8b\xcf\x49'
126
134
 
127
135
 
128
136
    def testPackRequest0(self):
129
 
        bin = apply(request.ChangeWindowAttributes._request.to_binary, (), self.req_args_0)
 
137
        bin = request.ChangeWindowAttributes._request.to_binary(*(), **self.req_args_0)
130
138
        try:
131
139
            assert bin == self.req_bin_0
132
140
        except AssertionError:
149
157
        self.req_args_0 = {
150
158
            'window': 1672572666,
151
159
            }
152
 
        self.req_bin_0 = '\x03\x00\x02\x00' '\xfa\x6e\xb1\x63'
 
160
        self.req_bin_0 = b'\x03\x00\x02\x00' b'\xfa\x6e\xb1\x63'
153
161
 
154
162
        self.reply_args_0 = {
155
163
            'do_not_propagate_mask': 33915,
169
177
            'sequence_number': 38504,
170
178
            'colormap': 56062036,
171
179
            }
172
 
        self.reply_bin_0 = '\x01\xd7\x68\x96' '\x03\x00\x00\x00' \
173
 
            '\xb5\x61\x9f\x54' '\x28\x3f\x80\x8c' \
174
 
            '\xce\xd7\xa2\x32' '\x99\xf4\xa7\x37' \
175
 
            '\x01\x01\xa9\x00' '\x54\x70\x57\x03' \
176
 
            '\xb4\x01\xc9\x3d' '\x52\xc6\x49\x0a' \
177
 
            '\x7b\x84\x00\x00'
 
180
        self.reply_bin_0 = b'\x01\xd7\x68\x96' b'\x03\x00\x00\x00' \
 
181
            b'\xb5\x61\x9f\x54' b'\x28\x3f\x80\x8c' \
 
182
            b'\xce\xd7\xa2\x32' b'\x99\xf4\xa7\x37' \
 
183
            b'\x01\x01\xa9\x00' b'\x54\x70\x57\x03' \
 
184
            b'\xb4\x01\xc9\x3d' b'\x52\xc6\x49\x0a' \
 
185
            b'\x7b\x84\x00\x00'
178
186
 
179
187
 
180
188
    def testPackRequest0(self):
181
 
        bin = apply(request.GetWindowAttributes._request.to_binary, (), self.req_args_0)
 
189
        bin = request.GetWindowAttributes._request.to_binary(*(), **self.req_args_0)
182
190
        try:
183
191
            assert bin == self.req_bin_0
184
192
        except AssertionError:
196
204
            raise AssertionError(args)
197
205
 
198
206
    def testPackReply0(self):
199
 
        bin = apply(request.GetWindowAttributes._reply.to_binary, (), self.reply_args_0)
 
207
        bin = request.GetWindowAttributes._reply.to_binary(*(), **self.reply_args_0)
200
208
        try:
201
209
            assert bin == self.reply_bin_0
202
210
        except AssertionError:
219
227
        self.req_args_0 = {
220
228
            'window': 533632985,
221
229
            }
222
 
        self.req_bin_0 = '\x04\x00\x02\x00' '\xd9\x97\xce\x1f'
 
230
        self.req_bin_0 = b'\x04\x00\x02\x00' b'\xd9\x97\xce\x1f'
223
231
 
224
232
 
225
233
    def testPackRequest0(self):
226
 
        bin = apply(request.DestroyWindow._request.to_binary, (), self.req_args_0)
 
234
        bin = request.DestroyWindow._request.to_binary(*(), **self.req_args_0)
227
235
        try:
228
236
            assert bin == self.req_bin_0
229
237
        except AssertionError:
246
254
        self.req_args_0 = {
247
255
            'window': 490680451,
248
256
            }
249
 
        self.req_bin_0 = '\x05\x00\x02\x00' '\x83\x30\x3f\x1d'
 
257
        self.req_bin_0 = b'\x05\x00\x02\x00' b'\x83\x30\x3f\x1d'
250
258
 
251
259
 
252
260
    def testPackRequest0(self):
253
 
        bin = apply(request.DestroySubWindows._request.to_binary, (), self.req_args_0)
 
261
        bin = request.DestroySubWindows._request.to_binary(*(), **self.req_args_0)
254
262
        try:
255
263
            assert bin == self.req_bin_0
256
264
        except AssertionError:
274
282
            'window': 1974200014,
275
283
            'mode': 0,
276
284
            }
277
 
        self.req_bin_0 = '\x06\x00\x02\x00' '\xce\xe6\xab\x75'
 
285
        self.req_bin_0 = b'\x06\x00\x02\x00' b'\xce\xe6\xab\x75'
278
286
 
279
287
 
280
288
    def testPackRequest0(self):
281
 
        bin = apply(request.ChangeSaveSet._request.to_binary, (), self.req_args_0)
 
289
        bin = request.ChangeSaveSet._request.to_binary(*(), **self.req_args_0)
282
290
        try:
283
291
            assert bin == self.req_bin_0
284
292
        except AssertionError:
304
312
            'window': 2127670410,
305
313
            'parent': 1913134105,
306
314
            }
307
 
        self.req_bin_0 = '\x07\x00\x04\x00' '\x8a\xac\xd1\x7e' \
308
 
            '\x19\x1c\x08\x72' '\x10\xb9\x25\xce'
 
315
        self.req_bin_0 = b'\x07\x00\x04\x00' b'\x8a\xac\xd1\x7e' \
 
316
            b'\x19\x1c\x08\x72' b'\x10\xb9\x25\xce'
309
317
 
310
318
 
311
319
    def testPackRequest0(self):
312
 
        bin = apply(request.ReparentWindow._request.to_binary, (), self.req_args_0)
 
320
        bin = request.ReparentWindow._request.to_binary(*(), **self.req_args_0)
313
321
        try:
314
322
            assert bin == self.req_bin_0
315
323
        except AssertionError:
332
340
        self.req_args_0 = {
333
341
            'window': 962670079,
334
342
            }
335
 
        self.req_bin_0 = '\x08\x00\x02\x00' '\xff\x2d\x61\x39'
 
343
        self.req_bin_0 = b'\x08\x00\x02\x00' b'\xff\x2d\x61\x39'
336
344
 
337
345
 
338
346
    def testPackRequest0(self):
339
 
        bin = apply(request.MapWindow._request.to_binary, (), self.req_args_0)
 
347
        bin = request.MapWindow._request.to_binary(*(), **self.req_args_0)
340
348
        try:
341
349
            assert bin == self.req_bin_0
342
350
        except AssertionError:
359
367
        self.req_args_0 = {
360
368
            'window': 447820952,
361
369
            }
362
 
        self.req_bin_0 = '\x09\x00\x02\x00' '\x98\x34\xb1\x1a'
 
370
        self.req_bin_0 = b'\x09\x00\x02\x00' b'\x98\x34\xb1\x1a'
363
371
 
364
372
 
365
373
    def testPackRequest0(self):
366
 
        bin = apply(request.MapSubwindows._request.to_binary, (), self.req_args_0)
 
374
        bin = request.MapSubwindows._request.to_binary(*(), **self.req_args_0)
367
375
        try:
368
376
            assert bin == self.req_bin_0
369
377
        except AssertionError:
386
394
        self.req_args_0 = {
387
395
            'window': 1130502889,
388
396
            }
389
 
        self.req_bin_0 = '\x0a\x00\x02\x00' '\xe9\x1a\x62\x43'
 
397
        self.req_bin_0 = b'\x0a\x00\x02\x00' b'\xe9\x1a\x62\x43'
390
398
 
391
399
 
392
400
    def testPackRequest0(self):
393
 
        bin = apply(request.UnmapWindow._request.to_binary, (), self.req_args_0)
 
401
        bin = request.UnmapWindow._request.to_binary(*(), **self.req_args_0)
394
402
        try:
395
403
            assert bin == self.req_bin_0
396
404
        except AssertionError:
413
421
        self.req_args_0 = {
414
422
            'window': 2009442907,
415
423
            }
416
 
        self.req_bin_0 = '\x0b\x00\x02\x00' '\x5b\xaa\xc5\x77'
 
424
        self.req_bin_0 = b'\x0b\x00\x02\x00' b'\x5b\xaa\xc5\x77'
417
425
 
418
426
 
419
427
    def testPackRequest0(self):
420
 
        bin = apply(request.UnmapSubwindows._request.to_binary, (), self.req_args_0)
 
428
        bin = request.UnmapSubwindows._request.to_binary(*(), **self.req_args_0)
421
429
        try:
422
430
            assert bin == self.req_bin_0
423
431
        except AssertionError:
441
449
            'window': 2092974410,
442
450
            'attrs': {'sibling': 1102940930, 'width': 52077, 'y': -11332, 'x': -11514, 'border_width': -6900, 'stack_mode': 4, 'height': 62050},
443
451
            }
444
 
        self.req_bin_0 = '\x0c\x00\x0a\x00' '\x4a\x41\xc0\x7c' \
445
 
            '\x7f\x00\x00\x00' '\x06\xd3\x00\x00' \
446
 
            '\xbc\xd3\x00\x00' '\x6d\xcb\x00\x00' \
447
 
            '\x62\xf2\x00\x00' '\x0c\xe5\x00\x00' \
448
 
            '\x02\x8b\xbd\x41' '\x04\x00\x00\x00'
 
452
        self.req_bin_0 = b'\x0c\x00\x0a\x00' b'\x4a\x41\xc0\x7c' \
 
453
            b'\x7f\x00\x00\x00' b'\x06\xd3\x00\x00' \
 
454
            b'\xbc\xd3\x00\x00' b'\x6d\xcb\x00\x00' \
 
455
            b'\x62\xf2\x00\x00' b'\x0c\xe5\x00\x00' \
 
456
            b'\x02\x8b\xbd\x41' b'\x04\x00\x00\x00'
449
457
 
450
458
 
451
459
    def testPackRequest0(self):
452
 
        bin = apply(request.ConfigureWindow._request.to_binary, (), self.req_args_0)
 
460
        bin = request.ConfigureWindow._request.to_binary(*(), **self.req_args_0)
453
461
        try:
454
462
            assert bin == self.req_bin_0
455
463
        except AssertionError:
473
481
            'direction': 0,
474
482
            'window': 1132872732,
475
483
            }
476
 
        self.req_bin_0 = '\x0d\x00\x02\x00' '\x1c\x44\x86\x43'
 
484
        self.req_bin_0 = b'\x0d\x00\x02\x00' b'\x1c\x44\x86\x43'
477
485
 
478
486
 
479
487
    def testPackRequest0(self):
480
 
        bin = apply(request.CirculateWindow._request.to_binary, (), self.req_args_0)
 
488
        bin = request.CirculateWindow._request.to_binary(*(), **self.req_args_0)
481
489
        try:
482
490
            assert bin == self.req_bin_0
483
491
        except AssertionError:
500
508
        self.req_args_0 = {
501
509
            'drawable': 2036121058,
502
510
            }
503
 
        self.req_bin_0 = '\x0e\x00\x02\x00' '\xe2\xbd\x5c\x79'
 
511
        self.req_bin_0 = b'\x0e\x00\x02\x00' b'\xe2\xbd\x5c\x79'
504
512
 
505
513
        self.reply_args_0 = {
506
514
            'width': 65264,
512
520
            'sequence_number': 36173,
513
521
            'height': 9014,
514
522
            }
515
 
        self.reply_bin_0 = '\x01\xfd\x4d\x8d' '\x00\x00\x00\x00' \
516
 
            '\xf2\xf9\x63\x1d' '\x90\x8e\xa2\xd0' \
517
 
            '\xf0\xfe\x36\x23' '\xb8\x4d\x00\x00' \
518
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
523
        self.reply_bin_0 = b'\x01\xfd\x4d\x8d' b'\x00\x00\x00\x00' \
 
524
            b'\xf2\xf9\x63\x1d' b'\x90\x8e\xa2\xd0' \
 
525
            b'\xf0\xfe\x36\x23' b'\xb8\x4d\x00\x00' \
 
526
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
519
527
 
520
528
 
521
529
    def testPackRequest0(self):
522
 
        bin = apply(request.GetGeometry._request.to_binary, (), self.req_args_0)
 
530
        bin = request.GetGeometry._request.to_binary(*(), **self.req_args_0)
523
531
        try:
524
532
            assert bin == self.req_bin_0
525
533
        except AssertionError:
537
545
            raise AssertionError(args)
538
546
 
539
547
    def testPackReply0(self):
540
 
        bin = apply(request.GetGeometry._reply.to_binary, (), self.reply_args_0)
 
548
        bin = request.GetGeometry._reply.to_binary(*(), **self.reply_args_0)
541
549
        try:
542
550
            assert bin == self.reply_bin_0
543
551
        except AssertionError:
560
568
        self.req_args_0 = {
561
569
            'window': 884880831,
562
570
            }
563
 
        self.req_bin_0 = '\x0f\x00\x02\x00' '\xbf\x35\xbe\x34'
 
571
        self.req_bin_0 = b'\x0f\x00\x02\x00' b'\xbf\x35\xbe\x34'
564
572
 
565
573
        self.reply_args_0 = {
566
574
            'parent': 701348115,
568
576
            'children': [1089242139, 925689046, 1668140638, 775016596, 1024466546, 1245533043, 1733661379],
569
577
            'sequence_number': 10033,
570
578
            }
571
 
        self.reply_bin_0 = '\x01\x00\x31\x27' '\x07\x00\x00\x00' \
572
 
            '\x35\xea\xdf\x17' '\x13\xb9\xcd\x29' \
573
 
            '\x07\x00\x00\x00' '\x00\x00\x00\x00' \
574
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
575
 
            '\x1b\x84\xec\x40' '\xd6\xe4\x2c\x37' \
576
 
            '\x5e\xce\x6d\x63' '\x94\xd0\x31\x2e' \
577
 
            '\x72\x1e\x10\x3d' '\x73\x53\x3d\x4a' \
578
 
            '\xc3\x92\x55\x67'
 
579
        self.reply_bin_0 = b'\x01\x00\x31\x27' b'\x07\x00\x00\x00' \
 
580
            b'\x35\xea\xdf\x17' b'\x13\xb9\xcd\x29' \
 
581
            b'\x07\x00\x00\x00' b'\x00\x00\x00\x00' \
 
582
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
583
            b'\x1b\x84\xec\x40' b'\xd6\xe4\x2c\x37' \
 
584
            b'\x5e\xce\x6d\x63' b'\x94\xd0\x31\x2e' \
 
585
            b'\x72\x1e\x10\x3d' b'\x73\x53\x3d\x4a' \
 
586
            b'\xc3\x92\x55\x67'
579
587
 
580
588
 
581
589
    def testPackRequest0(self):
582
 
        bin = apply(request.QueryTree._request.to_binary, (), self.req_args_0)
 
590
        bin = request.QueryTree._request.to_binary(*(), **self.req_args_0)
583
591
        try:
584
592
            assert bin == self.req_bin_0
585
593
        except AssertionError:
597
605
            raise AssertionError(args)
598
606
 
599
607
    def testPackReply0(self):
600
 
        bin = apply(request.QueryTree._reply.to_binary, (), self.reply_args_0)
 
608
        bin = request.QueryTree._reply.to_binary(*(), **self.reply_args_0)
601
609
        try:
602
610
            assert bin == self.reply_bin_0
603
611
        except AssertionError:
621
629
            'name': 'fuzzy_prop',
622
630
            'only_if_exists': 0,
623
631
            }
624
 
        self.req_bin_0 = '\x10\x00\x05\x00' '\x0a\x00\x00\x00' \
625
 
            '\x66\x75\x7a\x7a' '\x79\x5f\x70\x72' \
626
 
            '\x6f\x70\x00\x00'
 
632
        self.req_bin_0 = b'\x10\x00\x05\x00' b'\x0a\x00\x00\x00' \
 
633
            b'\x66\x75\x7a\x7a' b'\x79\x5f\x70\x72' \
 
634
            b'\x6f\x70\x00\x00'
627
635
 
628
636
        self.reply_args_0 = {
629
637
            'sequence_number': 14401,
630
638
            'atom': 1112752381,
631
639
            }
632
 
        self.reply_bin_0 = '\x01\x00\x41\x38' '\x00\x00\x00\x00' \
633
 
            '\xfd\x40\x53\x42' '\x00\x00\x00\x00' \
634
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
635
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
640
        self.reply_bin_0 = b'\x01\x00\x41\x38' b'\x00\x00\x00\x00' \
 
641
            b'\xfd\x40\x53\x42' b'\x00\x00\x00\x00' \
 
642
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
643
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
636
644
 
637
645
 
638
646
    def testPackRequest0(self):
639
 
        bin = apply(request.InternAtom._request.to_binary, (), self.req_args_0)
 
647
        bin = request.InternAtom._request.to_binary(*(), **self.req_args_0)
640
648
        try:
641
649
            assert bin == self.req_bin_0
642
650
        except AssertionError:
654
662
            raise AssertionError(args)
655
663
 
656
664
    def testPackReply0(self):
657
 
        bin = apply(request.InternAtom._reply.to_binary, (), self.reply_args_0)
 
665
        bin = request.InternAtom._reply.to_binary(*(), **self.reply_args_0)
658
666
        try:
659
667
            assert bin == self.reply_bin_0
660
668
        except AssertionError:
677
685
        self.req_args_0 = {
678
686
            'atom': 1234624354,
679
687
            }
680
 
        self.req_bin_0 = '\x11\x00\x02\x00' '\x62\xdf\x96\x49'
 
688
        self.req_bin_0 = b'\x11\x00\x02\x00' b'\x62\xdf\x96\x49'
681
689
 
682
690
        self.reply_args_0 = {
683
691
            'name': 'WM_CLASS',
684
692
            'sequence_number': 2504,
685
693
            }
686
 
        self.reply_bin_0 = '\x01\x00\xc8\x09' '\x02\x00\x00\x00' \
687
 
            '\x08\x00\x00\x00' '\x00\x00\x00\x00' \
688
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
689
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
690
 
            '\x57\x4d\x5f\x43' '\x4c\x41\x53\x53'
 
694
        self.reply_bin_0 = b'\x01\x00\xc8\x09' b'\x02\x00\x00\x00' \
 
695
            b'\x08\x00\x00\x00' b'\x00\x00\x00\x00' \
 
696
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
697
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
698
            b'\x57\x4d\x5f\x43' b'\x4c\x41\x53\x53'
691
699
 
692
700
 
693
701
    def testPackRequest0(self):
694
 
        bin = apply(request.GetAtomName._request.to_binary, (), self.req_args_0)
 
702
        bin = request.GetAtomName._request.to_binary(*(), **self.req_args_0)
695
703
        try:
696
704
            assert bin == self.req_bin_0
697
705
        except AssertionError:
709
717
            raise AssertionError(args)
710
718
 
711
719
    def testPackReply0(self):
712
 
        bin = apply(request.GetAtomName._reply.to_binary, (), self.reply_args_0)
 
720
        bin = request.GetAtomName._reply.to_binary(*(), **self.reply_args_0)
713
721
        try:
714
722
            assert bin == self.reply_bin_0
715
723
        except AssertionError:
736
744
            'data': (8, ''),
737
745
            'mode': 2,
738
746
            }
739
 
        self.req_bin_0 = '\x12\x02\x06\x00' '\x25\x5d\xa4\x4a' \
740
 
            '\x09\x59\x27\x0e' '\xb9\xcf\x2f\x48' \
741
 
            '\x08\x00\x00\x00' '\x00\x00\x00\x00'
 
747
        self.req_bin_0 = b'\x12\x02\x06\x00' b'\x25\x5d\xa4\x4a' \
 
748
            b'\x09\x59\x27\x0e' b'\xb9\xcf\x2f\x48' \
 
749
            b'\x08\x00\x00\x00' b'\x00\x00\x00\x00'
742
750
 
743
751
        self.req_args_1 = {
744
752
            'type': 347282449,
747
755
            'data': (8, 'foo'),
748
756
            'mode': 1,
749
757
            }
750
 
        self.req_bin_1 = '\x12\x01\x07\x00' '\x19\xec\x86\x01' \
751
 
            '\x25\x5d\xc9\x25' '\x11\x1c\xb3\x14' \
752
 
            '\x08\x00\x00\x00' '\x03\x00\x00\x00' \
753
 
            '\x66\x6f\x6f\x00'
 
758
        self.req_bin_1 = b'\x12\x01\x07\x00' b'\x19\xec\x86\x01' \
 
759
            b'\x25\x5d\xc9\x25' b'\x11\x1c\xb3\x14' \
 
760
            b'\x08\x00\x00\x00' b'\x03\x00\x00\x00' \
 
761
            b'\x66\x6f\x6f\x00'
754
762
 
755
763
        self.req_args_2 = {
756
764
            'type': 1524334051,
759
767
            'data': (8, 'zoom'),
760
768
            'mode': 1,
761
769
            }
762
 
        self.req_bin_2 = '\x12\x01\x07\x00' '\xc0\xa6\xb7\x1c' \
763
 
            '\xc5\x16\x42\x27' '\xe3\x7d\xdb\x5a' \
764
 
            '\x08\x00\x00\x00' '\x04\x00\x00\x00' \
765
 
            '\x7a\x6f\x6f\x6d'
 
770
        self.req_bin_2 = b'\x12\x01\x07\x00' b'\xc0\xa6\xb7\x1c' \
 
771
            b'\xc5\x16\x42\x27' b'\xe3\x7d\xdb\x5a' \
 
772
            b'\x08\x00\x00\x00' b'\x04\x00\x00\x00' \
 
773
            b'\x7a\x6f\x6f\x6d'
766
774
 
767
775
        self.req_args_3 = {
768
776
            'type': 1895805524,
771
779
            'data': (16, []),
772
780
            'mode': 2,
773
781
            }
774
 
        self.req_bin_3 = '\x12\x02\x06\x00' '\x13\xde\x9c\x0c' \
775
 
            '\xee\xa7\x9f\x01' '\x54\xb2\xff\x70' \
776
 
            '\x10\x00\x00\x00' '\x00\x00\x00\x00'
 
782
        self.req_bin_3 = b'\x12\x02\x06\x00' b'\x13\xde\x9c\x0c' \
 
783
            b'\xee\xa7\x9f\x01' b'\x54\xb2\xff\x70' \
 
784
            b'\x10\x00\x00\x00' b'\x00\x00\x00\x00'
777
785
 
778
786
        self.req_args_4 = {
779
787
            'type': 549788841,
782
790
            'data': (16, [1, 2, 3]),
783
791
            'mode': 0,
784
792
            }
785
 
        self.req_bin_4 = '\x12\x00\x08\x00' '\x3c\x4c\x4d\x59' \
786
 
            '\x31\x43\x70\x6f' '\xa9\x1c\xc5\x20' \
787
 
            '\x10\x00\x00\x00' '\x03\x00\x00\x00' \
788
 
            '\x01\x00\x02\x00' '\x03\x00\x00\x00'
 
793
        self.req_bin_4 = b'\x12\x00\x08\x00' b'\x3c\x4c\x4d\x59' \
 
794
            b'\x31\x43\x70\x6f' b'\xa9\x1c\xc5\x20' \
 
795
            b'\x10\x00\x00\x00' b'\x03\x00\x00\x00' \
 
796
            b'\x01\x00\x02\x00' b'\x03\x00\x00\x00'
789
797
 
790
798
        self.req_args_5 = {
791
799
            'type': 1083661140,
794
802
            'data': (16, [1, 2, 3, 4]),
795
803
            'mode': 2,
796
804
            }
797
 
        self.req_bin_5 = '\x12\x02\x08\x00' '\x66\x3b\x5c\x78' \
798
 
            '\x8f\x6c\x80\x17' '\x54\x5b\x97\x40' \
799
 
            '\x10\x00\x00\x00' '\x04\x00\x00\x00' \
800
 
            '\x01\x00\x02\x00' '\x03\x00\x04\x00'
 
805
        self.req_bin_5 = b'\x12\x02\x08\x00' b'\x66\x3b\x5c\x78' \
 
806
            b'\x8f\x6c\x80\x17' b'\x54\x5b\x97\x40' \
 
807
            b'\x10\x00\x00\x00' b'\x04\x00\x00\x00' \
 
808
            b'\x01\x00\x02\x00' b'\x03\x00\x04\x00'
801
809
 
802
810
        self.req_args_6 = {
803
811
            'type': 761479544,
806
814
            'data': (32, []),
807
815
            'mode': 2,
808
816
            }
809
 
        self.req_bin_6 = '\x12\x02\x06\x00' '\x91\x3e\xf2\x4b' \
810
 
            '\xe1\x3f\xf1\x67' '\x78\x41\x63\x2d' \
811
 
            '\x20\x00\x00\x00' '\x00\x00\x00\x00'
 
817
        self.req_bin_6 = b'\x12\x02\x06\x00' b'\x91\x3e\xf2\x4b' \
 
818
            b'\xe1\x3f\xf1\x67' b'\x78\x41\x63\x2d' \
 
819
            b'\x20\x00\x00\x00' b'\x00\x00\x00\x00'
812
820
 
813
821
        self.req_args_7 = {
814
822
            'type': 956119085,
817
825
            'data': (32, [1, 2, 3]),
818
826
            'mode': 1,
819
827
            }
820
 
        self.req_bin_7 = '\x12\x01\x09\x00' '\x91\x5c\xb8\x3c' \
821
 
            '\xbe\x5c\xe4\x28' '\x2d\x38\xfd\x38' \
822
 
            '\x20\x00\x00\x00' '\x03\x00\x00\x00' \
823
 
            '\x01\x00\x00\x00' '\x02\x00\x00\x00' \
824
 
            '\x03\x00\x00\x00'
 
828
        self.req_bin_7 = b'\x12\x01\x09\x00' b'\x91\x5c\xb8\x3c' \
 
829
            b'\xbe\x5c\xe4\x28' b'\x2d\x38\xfd\x38' \
 
830
            b'\x20\x00\x00\x00' b'\x03\x00\x00\x00' \
 
831
            b'\x01\x00\x00\x00' b'\x02\x00\x00\x00' \
 
832
            b'\x03\x00\x00\x00'
825
833
 
826
834
 
827
835
    def testPackRequest0(self):
828
 
        bin = apply(request.ChangeProperty._request.to_binary, (), self.req_args_0)
 
836
        bin = request.ChangeProperty._request.to_binary(*(), **self.req_args_0)
829
837
        try:
830
838
            assert bin == self.req_bin_0
831
839
        except AssertionError:
843
851
            raise AssertionError(args)
844
852
 
845
853
    def testPackRequest1(self):
846
 
        bin = apply(request.ChangeProperty._request.to_binary, (), self.req_args_1)
 
854
        bin = request.ChangeProperty._request.to_binary(*(), **self.req_args_1)
847
855
        try:
848
856
            assert bin == self.req_bin_1
849
857
        except AssertionError:
861
869
            raise AssertionError(args)
862
870
 
863
871
    def testPackRequest2(self):
864
 
        bin = apply(request.ChangeProperty._request.to_binary, (), self.req_args_2)
 
872
        bin = request.ChangeProperty._request.to_binary(*(), **self.req_args_2)
865
873
        try:
866
874
            assert bin == self.req_bin_2
867
875
        except AssertionError:
879
887
            raise AssertionError(args)
880
888
 
881
889
    def testPackRequest3(self):
882
 
        bin = apply(request.ChangeProperty._request.to_binary, (), self.req_args_3)
 
890
        bin = request.ChangeProperty._request.to_binary(*(), **self.req_args_3)
883
891
        try:
884
892
            assert bin == self.req_bin_3
885
893
        except AssertionError:
897
905
            raise AssertionError(args)
898
906
 
899
907
    def testPackRequest4(self):
900
 
        bin = apply(request.ChangeProperty._request.to_binary, (), self.req_args_4)
 
908
        bin = request.ChangeProperty._request.to_binary(*(), **self.req_args_4)
901
909
        try:
902
910
            assert bin == self.req_bin_4
903
911
        except AssertionError:
915
923
            raise AssertionError(args)
916
924
 
917
925
    def testPackRequest5(self):
918
 
        bin = apply(request.ChangeProperty._request.to_binary, (), self.req_args_5)
 
926
        bin = request.ChangeProperty._request.to_binary(*(), **self.req_args_5)
919
927
        try:
920
928
            assert bin == self.req_bin_5
921
929
        except AssertionError:
933
941
            raise AssertionError(args)
934
942
 
935
943
    def testPackRequest6(self):
936
 
        bin = apply(request.ChangeProperty._request.to_binary, (), self.req_args_6)
 
944
        bin = request.ChangeProperty._request.to_binary(*(), **self.req_args_6)
937
945
        try:
938
946
            assert bin == self.req_bin_6
939
947
        except AssertionError:
951
959
            raise AssertionError(args)
952
960
 
953
961
    def testPackRequest7(self):
954
 
        bin = apply(request.ChangeProperty._request.to_binary, (), self.req_args_7)
 
962
        bin = request.ChangeProperty._request.to_binary(*(), **self.req_args_7)
955
963
        try:
956
964
            assert bin == self.req_bin_7
957
965
        except AssertionError:
975
983
            'window': 1858113940,
976
984
            'property': 754854074,
977
985
            }
978
 
        self.req_bin_0 = '\x13\x00\x03\x00' '\x94\x91\xc0\x6e' \
979
 
            '\xba\x28\xfe\x2c'
 
986
        self.req_bin_0 = b'\x13\x00\x03\x00' b'\x94\x91\xc0\x6e' \
 
987
            b'\xba\x28\xfe\x2c'
980
988
 
981
989
 
982
990
    def testPackRequest0(self):
983
 
        bin = apply(request.DeleteProperty._request.to_binary, (), self.req_args_0)
 
991
        bin = request.DeleteProperty._request.to_binary(*(), **self.req_args_0)
984
992
        try:
985
993
            assert bin == self.req_bin_0
986
994
        except AssertionError:
1008
1016
            'long_length': 1748032051,
1009
1017
            'delete': 0,
1010
1018
            }
1011
 
        self.req_bin_0 = '\x14\x00\x06\x00' '\xda\x26\xe0\x63' \
1012
 
            '\x92\x84\xda\x73' '\x2b\x75\x56\x0d' \
1013
 
            '\x90\x39\xaf\x00' '\x33\xda\x30\x68'
 
1019
        self.req_bin_0 = b'\x14\x00\x06\x00' b'\xda\x26\xe0\x63' \
 
1020
            b'\x92\x84\xda\x73' b'\x2b\x75\x56\x0d' \
 
1021
            b'\x90\x39\xaf\x00' b'\x33\xda\x30\x68'
1014
1022
 
1015
1023
        self.reply_args_0 = {
1016
1024
            'bytes_after': 1264377294,
1018
1026
            'sequence_number': 34281,
1019
1027
            'value': (8, ''),
1020
1028
            }
1021
 
        self.reply_bin_0 = '\x01\x08\xe9\x85' '\x00\x00\x00\x00' \
1022
 
            '\x02\xc9\xe6\x4d' '\xce\xdd\x5c\x4b' \
1023
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
1024
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
1029
        self.reply_bin_0 = b'\x01\x08\xe9\x85' b'\x00\x00\x00\x00' \
 
1030
            b'\x02\xc9\xe6\x4d' b'\xce\xdd\x5c\x4b' \
 
1031
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
1032
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
1025
1033
 
1026
1034
        self.reply_args_1 = {
1027
1035
            'bytes_after': 902042689,
1029
1037
            'sequence_number': 50371,
1030
1038
            'value': (8, 'foo'),
1031
1039
            }
1032
 
        self.reply_bin_1 = '\x01\x08\xc3\xc4' '\x01\x00\x00\x00' \
1033
 
            '\x13\x3f\x14\x6e' '\x41\x14\xc4\x35' \
1034
 
            '\x03\x00\x00\x00' '\x00\x00\x00\x00' \
1035
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
1036
 
            '\x66\x6f\x6f\x00'
 
1040
        self.reply_bin_1 = b'\x01\x08\xc3\xc4' b'\x01\x00\x00\x00' \
 
1041
            b'\x13\x3f\x14\x6e' b'\x41\x14\xc4\x35' \
 
1042
            b'\x03\x00\x00\x00' b'\x00\x00\x00\x00' \
 
1043
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
1044
            b'\x66\x6f\x6f\x00'
1037
1045
 
1038
1046
        self.reply_args_2 = {
1039
1047
            'bytes_after': 1782597051,
1041
1049
            'sequence_number': 58679,
1042
1050
            'value': (8, 'zoom'),
1043
1051
            }
1044
 
        self.reply_bin_2 = '\x01\x08\x37\xe5' '\x01\x00\x00\x00' \
1045
 
            '\x47\xc4\x2e\x60' '\xbb\x45\x40\x6a' \
1046
 
            '\x04\x00\x00\x00' '\x00\x00\x00\x00' \
1047
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
1048
 
            '\x7a\x6f\x6f\x6d'
 
1052
        self.reply_bin_2 = b'\x01\x08\x37\xe5' b'\x01\x00\x00\x00' \
 
1053
            b'\x47\xc4\x2e\x60' b'\xbb\x45\x40\x6a' \
 
1054
            b'\x04\x00\x00\x00' b'\x00\x00\x00\x00' \
 
1055
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
1056
            b'\x7a\x6f\x6f\x6d'
1049
1057
 
1050
1058
        self.reply_args_3 = {
1051
1059
            'bytes_after': 1107167742,
1053
1061
            'sequence_number': 49647,
1054
1062
            'value': (16, []),
1055
1063
            }
1056
 
        self.reply_bin_3 = '\x01\x10\xef\xc1' '\x00\x00\x00\x00' \
1057
 
            '\xfa\x06\x1f\x75' '\xfe\x09\xfe\x41' \
1058
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
1059
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
1064
        self.reply_bin_3 = b'\x01\x10\xef\xc1' b'\x00\x00\x00\x00' \
 
1065
            b'\xfa\x06\x1f\x75' b'\xfe\x09\xfe\x41' \
 
1066
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
1067
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
1060
1068
 
1061
1069
        self.reply_args_4 = {
1062
1070
            'bytes_after': 1602466976,
1064
1072
            'sequence_number': 58268,
1065
1073
            'value': (16, [1, 2, 3]),
1066
1074
            }
1067
 
        self.reply_bin_4 = '\x01\x10\x9c\xe3' '\x02\x00\x00\x00' \
1068
 
            '\x24\x3d\x11\x26' '\xa0\xb4\x83\x5f' \
1069
 
            '\x03\x00\x00\x00' '\x00\x00\x00\x00' \
1070
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
1071
 
            '\x01\x00\x02\x00' '\x03\x00\x00\x00'
 
1075
        self.reply_bin_4 = b'\x01\x10\x9c\xe3' b'\x02\x00\x00\x00' \
 
1076
            b'\x24\x3d\x11\x26' b'\xa0\xb4\x83\x5f' \
 
1077
            b'\x03\x00\x00\x00' b'\x00\x00\x00\x00' \
 
1078
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
1079
            b'\x01\x00\x02\x00' b'\x03\x00\x00\x00'
1072
1080
 
1073
1081
        self.reply_args_5 = {
1074
1082
            'bytes_after': 651542717,
1076
1084
            'sequence_number': 26901,
1077
1085
            'value': (16, [1, 2, 3, 4]),
1078
1086
            }
1079
 
        self.reply_bin_5 = '\x01\x10\x15\x69' '\x02\x00\x00\x00' \
1080
 
            '\xe6\x9d\x78\x38' '\xbd\xc0\xd5\x26' \
1081
 
            '\x04\x00\x00\x00' '\x00\x00\x00\x00' \
1082
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
1083
 
            '\x01\x00\x02\x00' '\x03\x00\x04\x00'
 
1087
        self.reply_bin_5 = b'\x01\x10\x15\x69' b'\x02\x00\x00\x00' \
 
1088
            b'\xe6\x9d\x78\x38' b'\xbd\xc0\xd5\x26' \
 
1089
            b'\x04\x00\x00\x00' b'\x00\x00\x00\x00' \
 
1090
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
1091
            b'\x01\x00\x02\x00' b'\x03\x00\x04\x00'
1084
1092
 
1085
1093
        self.reply_args_6 = {
1086
1094
            'bytes_after': 602498418,
1088
1096
            'sequence_number': 11175,
1089
1097
            'value': (32, []),
1090
1098
            }
1091
 
        self.reply_bin_6 = '\x01\x20\xa7\x2b' '\x00\x00\x00\x00' \
1092
 
            '\x7e\xa7\x98\x02' '\x72\x65\xe9\x23' \
1093
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
1094
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
1099
        self.reply_bin_6 = b'\x01\x20\xa7\x2b' b'\x00\x00\x00\x00' \
 
1100
            b'\x7e\xa7\x98\x02' b'\x72\x65\xe9\x23' \
 
1101
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
1102
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
1095
1103
 
1096
1104
        self.reply_args_7 = {
1097
1105
            'bytes_after': 1661909208,
1099
1107
            'sequence_number': 4347,
1100
1108
            'value': (32, [1, 2, 3]),
1101
1109
            }
1102
 
        self.reply_bin_7 = '\x01\x20\xfb\x10' '\x03\x00\x00\x00' \
1103
 
            '\x08\xf7\x2e\x24' '\xd8\xb8\x0e\x63' \
1104
 
            '\x03\x00\x00\x00' '\x00\x00\x00\x00' \
1105
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
1106
 
            '\x01\x00\x00\x00' '\x02\x00\x00\x00' \
1107
 
            '\x03\x00\x00\x00'
 
1110
        self.reply_bin_7 = b'\x01\x20\xfb\x10' b'\x03\x00\x00\x00' \
 
1111
            b'\x08\xf7\x2e\x24' b'\xd8\xb8\x0e\x63' \
 
1112
            b'\x03\x00\x00\x00' b'\x00\x00\x00\x00' \
 
1113
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
1114
            b'\x01\x00\x00\x00' b'\x02\x00\x00\x00' \
 
1115
            b'\x03\x00\x00\x00'
1108
1116
 
1109
1117
 
1110
1118
    def testPackRequest0(self):
1111
 
        bin = apply(request.GetProperty._request.to_binary, (), self.req_args_0)
 
1119
        bin = request.GetProperty._request.to_binary(*(), **self.req_args_0)
1112
1120
        try:
1113
1121
            assert bin == self.req_bin_0
1114
1122
        except AssertionError:
1126
1134
            raise AssertionError(args)
1127
1135
 
1128
1136
    def testPackReply0(self):
1129
 
        bin = apply(request.GetProperty._reply.to_binary, (), self.reply_args_0)
 
1137
        bin = request.GetProperty._reply.to_binary(*(), **self.reply_args_0)
1130
1138
        try:
1131
1139
            assert bin == self.reply_bin_0
1132
1140
        except AssertionError:
1144
1152
            raise AssertionError(args)
1145
1153
 
1146
1154
    def testPackReply1(self):
1147
 
        bin = apply(request.GetProperty._reply.to_binary, (), self.reply_args_1)
 
1155
        bin = request.GetProperty._reply.to_binary(*(), **self.reply_args_1)
1148
1156
        try:
1149
1157
            assert bin == self.reply_bin_1
1150
1158
        except AssertionError:
1162
1170
            raise AssertionError(args)
1163
1171
 
1164
1172
    def testPackReply2(self):
1165
 
        bin = apply(request.GetProperty._reply.to_binary, (), self.reply_args_2)
 
1173
        bin = request.GetProperty._reply.to_binary(*(), **self.reply_args_2)
1166
1174
        try:
1167
1175
            assert bin == self.reply_bin_2
1168
1176
        except AssertionError:
1180
1188
            raise AssertionError(args)
1181
1189
 
1182
1190
    def testPackReply3(self):
1183
 
        bin = apply(request.GetProperty._reply.to_binary, (), self.reply_args_3)
 
1191
        bin = request.GetProperty._reply.to_binary(*(), **self.reply_args_3)
1184
1192
        try:
1185
1193
            assert bin == self.reply_bin_3
1186
1194
        except AssertionError:
1198
1206
            raise AssertionError(args)
1199
1207
 
1200
1208
    def testPackReply4(self):
1201
 
        bin = apply(request.GetProperty._reply.to_binary, (), self.reply_args_4)
 
1209
        bin = request.GetProperty._reply.to_binary(*(), **self.reply_args_4)
1202
1210
        try:
1203
1211
            assert bin == self.reply_bin_4
1204
1212
        except AssertionError:
1216
1224
            raise AssertionError(args)
1217
1225
 
1218
1226
    def testPackReply5(self):
1219
 
        bin = apply(request.GetProperty._reply.to_binary, (), self.reply_args_5)
 
1227
        bin = request.GetProperty._reply.to_binary(*(), **self.reply_args_5)
1220
1228
        try:
1221
1229
            assert bin == self.reply_bin_5
1222
1230
        except AssertionError:
1234
1242
            raise AssertionError(args)
1235
1243
 
1236
1244
    def testPackReply6(self):
1237
 
        bin = apply(request.GetProperty._reply.to_binary, (), self.reply_args_6)
 
1245
        bin = request.GetProperty._reply.to_binary(*(), **self.reply_args_6)
1238
1246
        try:
1239
1247
            assert bin == self.reply_bin_6
1240
1248
        except AssertionError:
1252
1260
            raise AssertionError(args)
1253
1261
 
1254
1262
    def testPackReply7(self):
1255
 
        bin = apply(request.GetProperty._reply.to_binary, (), self.reply_args_7)
 
1263
        bin = request.GetProperty._reply.to_binary(*(), **self.reply_args_7)
1256
1264
        try:
1257
1265
            assert bin == self.reply_bin_7
1258
1266
        except AssertionError:
1275
1283
        self.req_args_0 = {
1276
1284
            'window': 1002132678,
1277
1285
            }
1278
 
        self.req_bin_0 = '\x15\x00\x02\x00' '\xc6\x54\xbb\x3b'
 
1286
        self.req_bin_0 = b'\x15\x00\x02\x00' b'\xc6\x54\xbb\x3b'
1279
1287
 
1280
1288
        self.reply_args_0 = {
1281
1289
            'sequence_number': 58554,
1282
1290
            'atoms': [497337753, 1561366096, 1429910722, 371682445, 1693790956, 124266489, 819023111, 1575252239, 1958056613, 76461795, 2044963121, 1187630009, 890357857, 639310702, 1708479530, 336050724, 1163834063, 1164094286, 1626309474, 136351014, 1163110454, 1416739018, 1380223836],
1283
1291
            }
1284
 
        self.reply_bin_0 = '\x01\x00\xba\xe4' '\x17\x00\x00\x00' \
1285
 
            '\x17\x00\x00\x00' '\x00\x00\x00\x00' \
1286
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
1287
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
1288
 
            '\x99\xc5\xa4\x1d' '\x50\x8e\x10\x5d' \
1289
 
            '\xc2\xb4\x3a\x55' '\x8d\x6c\x27\x16' \
1290
 
            '\xec\x32\xf5\x64' '\xf9\x27\x68\x07' \
1291
 
            '\x07\x4d\xd1\x30' '\x0f\x71\xe4\x5d' \
1292
 
            '\xa5\x92\xb5\x74' '\xe3\xb6\x8e\x04' \
1293
 
            '\x31\xa9\xe3\x79' '\xb9\xcb\xc9\x46' \
1294
 
            '\x61\xc8\x11\x35' '\x6e\x1b\x1b\x26' \
1295
 
            '\x2a\x54\xd5\x65' '\x24\xba\x07\x14' \
1296
 
            '\xcf\xb2\x5e\x45' '\x4e\xab\x62\x45' \
1297
 
            '\x62\x83\xef\x60' '\x26\x8d\x20\x08' \
1298
 
            '\x36\xa8\x53\x45' '\xca\xb8\x71\x54' \
1299
 
            '\x5c\x8b\x44\x52'
 
1292
        self.reply_bin_0 = b'\x01\x00\xba\xe4' b'\x17\x00\x00\x00' \
 
1293
            b'\x17\x00\x00\x00' b'\x00\x00\x00\x00' \
 
1294
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
1295
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
1296
            b'\x99\xc5\xa4\x1d' b'\x50\x8e\x10\x5d' \
 
1297
            b'\xc2\xb4\x3a\x55' b'\x8d\x6c\x27\x16' \
 
1298
            b'\xec\x32\xf5\x64' b'\xf9\x27\x68\x07' \
 
1299
            b'\x07\x4d\xd1\x30' b'\x0f\x71\xe4\x5d' \
 
1300
            b'\xa5\x92\xb5\x74' b'\xe3\xb6\x8e\x04' \
 
1301
            b'\x31\xa9\xe3\x79' b'\xb9\xcb\xc9\x46' \
 
1302
            b'\x61\xc8\x11\x35' b'\x6e\x1b\x1b\x26' \
 
1303
            b'\x2a\x54\xd5\x65' b'\x24\xba\x07\x14' \
 
1304
            b'\xcf\xb2\x5e\x45' b'\x4e\xab\x62\x45' \
 
1305
            b'\x62\x83\xef\x60' b'\x26\x8d\x20\x08' \
 
1306
            b'\x36\xa8\x53\x45' b'\xca\xb8\x71\x54' \
 
1307
            b'\x5c\x8b\x44\x52'
1300
1308
 
1301
1309
 
1302
1310
    def testPackRequest0(self):
1303
 
        bin = apply(request.ListProperties._request.to_binary, (), self.req_args_0)
 
1311
        bin = request.ListProperties._request.to_binary(*(), **self.req_args_0)
1304
1312
        try:
1305
1313
            assert bin == self.req_bin_0
1306
1314
        except AssertionError:
1318
1326
            raise AssertionError(args)
1319
1327
 
1320
1328
    def testPackReply0(self):
1321
 
        bin = apply(request.ListProperties._reply.to_binary, (), self.reply_args_0)
 
1329
        bin = request.ListProperties._reply.to_binary(*(), **self.reply_args_0)
1322
1330
        try:
1323
1331
            assert bin == self.reply_bin_0
1324
1332
        except AssertionError:
1343
1351
            'selection': 984224380,
1344
1352
            'time': 2112448956,
1345
1353
            }
1346
 
        self.req_bin_0 = '\x16\x00\x04\x00' '\x4d\x88\xcd\x5d' \
1347
 
            '\x7c\x12\xaa\x3a' '\xbc\x69\xe9\x7d'
 
1354
        self.req_bin_0 = b'\x16\x00\x04\x00' b'\x4d\x88\xcd\x5d' \
 
1355
            b'\x7c\x12\xaa\x3a' b'\xbc\x69\xe9\x7d'
1348
1356
 
1349
1357
 
1350
1358
    def testPackRequest0(self):
1351
 
        bin = apply(request.SetSelectionOwner._request.to_binary, (), self.req_args_0)
 
1359
        bin = request.SetSelectionOwner._request.to_binary(*(), **self.req_args_0)
1352
1360
        try:
1353
1361
            assert bin == self.req_bin_0
1354
1362
        except AssertionError:
1371
1379
        self.req_args_0 = {
1372
1380
            'selection': 1209066471,
1373
1381
            }
1374
 
        self.req_bin_0 = '\x17\x00\x02\x00' '\xe7\xe3\x10\x48'
 
1382
        self.req_bin_0 = b'\x17\x00\x02\x00' b'\xe7\xe3\x10\x48'
1375
1383
 
1376
1384
        self.reply_args_0 = {
1377
1385
            'owner': 1608499874,
1378
1386
            'sequence_number': 40856,
1379
1387
            }
1380
 
        self.reply_bin_0 = '\x01\x00\x98\x9f' '\x00\x00\x00\x00' \
1381
 
            '\xa2\xc2\xdf\x5f' '\x00\x00\x00\x00' \
1382
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
1383
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
1388
        self.reply_bin_0 = b'\x01\x00\x98\x9f' b'\x00\x00\x00\x00' \
 
1389
            b'\xa2\xc2\xdf\x5f' b'\x00\x00\x00\x00' \
 
1390
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
1391
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
1384
1392
 
1385
1393
 
1386
1394
    def testPackRequest0(self):
1387
 
        bin = apply(request.GetSelectionOwner._request.to_binary, (), self.req_args_0)
 
1395
        bin = request.GetSelectionOwner._request.to_binary(*(), **self.req_args_0)
1388
1396
        try:
1389
1397
            assert bin == self.req_bin_0
1390
1398
        except AssertionError:
1402
1410
            raise AssertionError(args)
1403
1411
 
1404
1412
    def testPackReply0(self):
1405
 
        bin = apply(request.GetSelectionOwner._reply.to_binary, (), self.reply_args_0)
 
1413
        bin = request.GetSelectionOwner._reply.to_binary(*(), **self.reply_args_0)
1406
1414
        try:
1407
1415
            assert bin == self.reply_bin_0
1408
1416
        except AssertionError:
1429
1437
            'target': 1621875689,
1430
1438
            'time': 385931637,
1431
1439
            }
1432
 
        self.req_bin_0 = '\x18\x00\x06\x00' '\x51\x10\xc4\x09' \
1433
 
            '\xbe\x15\xaf\x0e' '\xe9\xdb\xab\x60' \
1434
 
            '\x0f\x2b\xee\x06' '\x75\xd9\x00\x17'
 
1440
        self.req_bin_0 = b'\x18\x00\x06\x00' b'\x51\x10\xc4\x09' \
 
1441
            b'\xbe\x15\xaf\x0e' b'\xe9\xdb\xab\x60' \
 
1442
            b'\x0f\x2b\xee\x06' b'\x75\xd9\x00\x17'
1435
1443
 
1436
1444
 
1437
1445
    def testPackRequest0(self):
1438
 
        bin = apply(request.ConvertSelection._request.to_binary, (), self.req_args_0)
 
1446
        bin = request.ConvertSelection._request.to_binary(*(), **self.req_args_0)
1439
1447
        try:
1440
1448
            assert bin == self.req_bin_0
1441
1449
        except AssertionError:
1461
1469
            'propagate': 1,
1462
1470
            'event': Xlib.protocol.event.Expose(count = 7721, width = 18606, window = 1339231972, y = 45287, x = 46510, type = 12, sequence_number = 0, height = 44735),
1463
1471
            }
1464
 
        self.req_bin_0 = '\x19\x01\x0b\x00' '\xd8\xda\x29\x62' \
1465
 
            '\x50\xdb\xc4\x3a' '\x0c\x00\x00\x00' \
1466
 
            '\xe4\x0e\xd3\x4f' '\xae\xb5\xe7\xb0' \
1467
 
            '\xae\x48\xbf\xae' '\x29\x1e\x00\x00' \
1468
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
1469
 
            '\x00\x00\x00\x00'
 
1472
        self.req_bin_0 = b'\x19\x01\x0b\x00' b'\xd8\xda\x29\x62' \
 
1473
            b'\x50\xdb\xc4\x3a' b'\x0c\x00\x00\x00' \
 
1474
            b'\xe4\x0e\xd3\x4f' b'\xae\xb5\xe7\xb0' \
 
1475
            b'\xae\x48\xbf\xae' b'\x29\x1e\x00\x00' \
 
1476
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
1477
            b'\x00\x00\x00\x00'
1470
1478
 
1471
1479
 
1472
1480
    def testPackRequest0(self):
1473
 
        bin = apply(request.SendEvent._request.to_binary, (), self.req_args_0)
 
1481
        bin = request.SendEvent._request.to_binary(*(), **self.req_args_0)
1474
1482
        try:
1475
1483
            assert bin == self.req_bin_0
1476
1484
        except AssertionError:
1500
1508
            'grab_window': 1295558486,
1501
1509
            'owner_events': 1,
1502
1510
            }
1503
 
        self.req_bin_0 = '\x1a\x01\x06\x00' '\x56\xa7\x38\x4d' \
1504
 
            '\x12\x6b\x01\x00' '\xca\xe1\x02\x5b' \
1505
 
            '\xe7\xde\xb2\x69' '\xa7\xfa\x3e\x47'
 
1511
        self.req_bin_0 = b'\x1a\x01\x06\x00' b'\x56\xa7\x38\x4d' \
 
1512
            b'\x12\x6b\x01\x00' b'\xca\xe1\x02\x5b' \
 
1513
            b'\xe7\xde\xb2\x69' b'\xa7\xfa\x3e\x47'
1506
1514
 
1507
1515
        self.reply_args_0 = {
1508
1516
            'status': 166,
1509
1517
            'sequence_number': 9454,
1510
1518
            }
1511
 
        self.reply_bin_0 = '\x01\xa6\xee\x24' '\x00\x00\x00\x00' \
1512
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
1513
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
1514
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
1519
        self.reply_bin_0 = b'\x01\xa6\xee\x24' b'\x00\x00\x00\x00' \
 
1520
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
1521
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
1522
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
1515
1523
 
1516
1524
 
1517
1525
    def testPackRequest0(self):
1518
 
        bin = apply(request.GrabPointer._request.to_binary, (), self.req_args_0)
 
1526
        bin = request.GrabPointer._request.to_binary(*(), **self.req_args_0)
1519
1527
        try:
1520
1528
            assert bin == self.req_bin_0
1521
1529
        except AssertionError:
1533
1541
            raise AssertionError(args)
1534
1542
 
1535
1543
    def testPackReply0(self):
1536
 
        bin = apply(request.GrabPointer._reply.to_binary, (), self.reply_args_0)
 
1544
        bin = request.GrabPointer._reply.to_binary(*(), **self.reply_args_0)
1537
1545
        try:
1538
1546
            assert bin == self.reply_bin_0
1539
1547
        except AssertionError:
1556
1564
        self.req_args_0 = {
1557
1565
            'time': 1647345145,
1558
1566
            }
1559
 
        self.req_bin_0 = '\x1b\x00\x02\x00' '\xf9\x7d\x30\x62'
 
1567
        self.req_bin_0 = b'\x1b\x00\x02\x00' b'\xf9\x7d\x30\x62'
1560
1568
 
1561
1569
 
1562
1570
    def testPackRequest0(self):
1563
 
        bin = apply(request.UngrabPointer._request.to_binary, (), self.req_args_0)
 
1571
        bin = request.UngrabPointer._request.to_binary(*(), **self.req_args_0)
1564
1572
        try:
1565
1573
            assert bin == self.req_bin_0
1566
1574
        except AssertionError:
1591
1599
            'grab_window': 2055413885,
1592
1600
            'owner_events': 0,
1593
1601
            }
1594
 
        self.req_bin_0 = '\x1c\x00\x06\x00' '\x7d\x20\x83\x7a' \
1595
 
            '\xa4\x5c\x01\x00' '\xa3\x8d\xf5\x7a' \
1596
 
            '\xd9\x94\x06\x5a' '\xa9\x00\x95\xf4'
 
1602
        self.req_bin_0 = b'\x1c\x00\x06\x00' b'\x7d\x20\x83\x7a' \
 
1603
            b'\xa4\x5c\x01\x00' b'\xa3\x8d\xf5\x7a' \
 
1604
            b'\xd9\x94\x06\x5a' b'\xa9\x00\x95\xf4'
1597
1605
 
1598
1606
 
1599
1607
    def testPackRequest0(self):
1600
 
        bin = apply(request.GrabButton._request.to_binary, (), self.req_args_0)
 
1608
        bin = request.GrabButton._request.to_binary(*(), **self.req_args_0)
1601
1609
        try:
1602
1610
            assert bin == self.req_bin_0
1603
1611
        except AssertionError:
1622
1630
            'modifiers': 32389,
1623
1631
            'grab_window': 1891977189,
1624
1632
            }
1625
 
        self.req_bin_0 = '\x1d\xdc\x03\x00' '\xe5\x47\xc5\x70' \
1626
 
            '\x85\x7e\x00\x00'
 
1633
        self.req_bin_0 = b'\x1d\xdc\x03\x00' b'\xe5\x47\xc5\x70' \
 
1634
            b'\x85\x7e\x00\x00'
1627
1635
 
1628
1636
 
1629
1637
    def testPackRequest0(self):
1630
 
        bin = apply(request.UngrabButton._request.to_binary, (), self.req_args_0)
 
1638
        bin = request.UngrabButton._request.to_binary(*(), **self.req_args_0)
1631
1639
        try:
1632
1640
            assert bin == self.req_bin_0
1633
1641
        except AssertionError:
1652
1660
            'event_mask': 12743,
1653
1661
            'time': 197998305,
1654
1662
            }
1655
 
        self.req_bin_0 = '\x1e\x00\x04\x00' '\x0c\xd9\x5e\x2e' \
1656
 
            '\xe1\x36\xcd\x0b' '\xc7\x31\x00\x00'
 
1663
        self.req_bin_0 = b'\x1e\x00\x04\x00' b'\x0c\xd9\x5e\x2e' \
 
1664
            b'\xe1\x36\xcd\x0b' b'\xc7\x31\x00\x00'
1657
1665
 
1658
1666
 
1659
1667
    def testPackRequest0(self):
1660
 
        bin = apply(request.ChangeActivePointerGrab._request.to_binary, (), self.req_args_0)
 
1668
        bin = request.ChangeActivePointerGrab._request.to_binary(*(), **self.req_args_0)
1661
1669
        try:
1662
1670
            assert bin == self.req_bin_0
1663
1671
        except AssertionError:
1684
1692
            'grab_window': 316814295,
1685
1693
            'owner_events': 0,
1686
1694
            }
1687
 
        self.req_bin_0 = '\x1f\x00\x04\x00' '\xd7\x33\xe2\x12' \
1688
 
            '\x93\x11\x1d\x65' '\x00\x01\x00\x00'
 
1695
        self.req_bin_0 = b'\x1f\x00\x04\x00' b'\xd7\x33\xe2\x12' \
 
1696
            b'\x93\x11\x1d\x65' b'\x00\x01\x00\x00'
1689
1697
 
1690
1698
        self.reply_args_0 = {
1691
1699
            'status': 239,
1692
1700
            'sequence_number': 46747,
1693
1701
            }
1694
 
        self.reply_bin_0 = '\x01\xef\x9b\xb6' '\x00\x00\x00\x00' \
1695
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
1696
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
1697
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
1702
        self.reply_bin_0 = b'\x01\xef\x9b\xb6' b'\x00\x00\x00\x00' \
 
1703
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
1704
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
1705
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
1698
1706
 
1699
1707
 
1700
1708
    def testPackRequest0(self):
1701
 
        bin = apply(request.GrabKeyboard._request.to_binary, (), self.req_args_0)
 
1709
        bin = request.GrabKeyboard._request.to_binary(*(), **self.req_args_0)
1702
1710
        try:
1703
1711
            assert bin == self.req_bin_0
1704
1712
        except AssertionError:
1716
1724
            raise AssertionError(args)
1717
1725
 
1718
1726
    def testPackReply0(self):
1719
 
        bin = apply(request.GrabKeyboard._reply.to_binary, (), self.reply_args_0)
 
1727
        bin = request.GrabKeyboard._reply.to_binary(*(), **self.reply_args_0)
1720
1728
        try:
1721
1729
            assert bin == self.reply_bin_0
1722
1730
        except AssertionError:
1739
1747
        self.req_args_0 = {
1740
1748
            'time': 4211611,
1741
1749
            }
1742
 
        self.req_bin_0 = '\x20\x00\x02\x00' '\x9b\x43\x40\x00'
 
1750
        self.req_bin_0 = b'\x20\x00\x02\x00' b'\x9b\x43\x40\x00'
1743
1751
 
1744
1752
 
1745
1753
    def testPackRequest0(self):
1746
 
        bin = apply(request.UngrabKeyboard._request.to_binary, (), self.req_args_0)
 
1754
        bin = request.UngrabKeyboard._request.to_binary(*(), **self.req_args_0)
1747
1755
        try:
1748
1756
            assert bin == self.req_bin_0
1749
1757
        except AssertionError:
1771
1779
            'grab_window': 882662093,
1772
1780
            'owner_events': 1,
1773
1781
            }
1774
 
        self.req_bin_0 = '\x21\x01\x04\x00' '\xcd\x5a\x9c\x34' \
1775
 
            '\x37\xf2\xaf\x00' '\x00\x00\x00\x00'
 
1782
        self.req_bin_0 = b'\x21\x01\x04\x00' b'\xcd\x5a\x9c\x34' \
 
1783
            b'\x37\xf2\xaf\x00' b'\x00\x00\x00\x00'
1776
1784
 
1777
1785
 
1778
1786
    def testPackRequest0(self):
1779
 
        bin = apply(request.GrabKey._request.to_binary, (), self.req_args_0)
 
1787
        bin = request.GrabKey._request.to_binary(*(), **self.req_args_0)
1780
1788
        try:
1781
1789
            assert bin == self.req_bin_0
1782
1790
        except AssertionError:
1801
1809
            'grab_window': 1389213966,
1802
1810
            'key': 141,
1803
1811
            }
1804
 
        self.req_bin_0 = '\x22\x8d\x03\x00' '\x0e\xb9\xcd\x52' \
1805
 
            '\x9e\x48\x00\x00'
 
1812
        self.req_bin_0 = b'\x22\x8d\x03\x00' b'\x0e\xb9\xcd\x52' \
 
1813
            b'\x9e\x48\x00\x00'
1806
1814
 
1807
1815
 
1808
1816
    def testPackRequest0(self):
1809
 
        bin = apply(request.UngrabKey._request.to_binary, (), self.req_args_0)
 
1817
        bin = request.UngrabKey._request.to_binary(*(), **self.req_args_0)
1810
1818
        try:
1811
1819
            assert bin == self.req_bin_0
1812
1820
        except AssertionError:
1830
1838
            'mode': 7,
1831
1839
            'time': 1088990319,
1832
1840
            }
1833
 
        self.req_bin_0 = '\x23\x07\x02\x00' '\x6f\xac\xe8\x40'
 
1841
        self.req_bin_0 = b'\x23\x07\x02\x00' b'\x6f\xac\xe8\x40'
1834
1842
 
1835
1843
 
1836
1844
    def testPackRequest0(self):
1837
 
        bin = apply(request.AllowEvents._request.to_binary, (), self.req_args_0)
 
1845
        bin = request.AllowEvents._request.to_binary(*(), **self.req_args_0)
1838
1846
        try:
1839
1847
            assert bin == self.req_bin_0
1840
1848
        except AssertionError:
1856
1864
    def setUp(self):
1857
1865
        self.req_args_0 = {
1858
1866
            }
1859
 
        self.req_bin_0 = '\x24\x00\x01\x00'
 
1867
        self.req_bin_0 = b'\x24\x00\x01\x00'
1860
1868
 
1861
1869
 
1862
1870
    def testPackRequest0(self):
1863
 
        bin = apply(request.GrabServer._request.to_binary, (), self.req_args_0)
 
1871
        bin = request.GrabServer._request.to_binary(*(), **self.req_args_0)
1864
1872
        try:
1865
1873
            assert bin == self.req_bin_0
1866
1874
        except AssertionError:
1882
1890
    def setUp(self):
1883
1891
        self.req_args_0 = {
1884
1892
            }
1885
 
        self.req_bin_0 = '\x25\x00\x01\x00'
 
1893
        self.req_bin_0 = b'\x25\x00\x01\x00'
1886
1894
 
1887
1895
 
1888
1896
    def testPackRequest0(self):
1889
 
        bin = apply(request.UngrabServer._request.to_binary, (), self.req_args_0)
 
1897
        bin = request.UngrabServer._request.to_binary(*(), **self.req_args_0)
1890
1898
        try:
1891
1899
            assert bin == self.req_bin_0
1892
1900
        except AssertionError:
1909
1917
        self.req_args_0 = {
1910
1918
            'window': 358895460,
1911
1919
            }
1912
 
        self.req_bin_0 = '\x26\x00\x02\x00' '\x64\x4f\x64\x15'
 
1920
        self.req_bin_0 = b'\x26\x00\x02\x00' b'\x64\x4f\x64\x15'
1913
1921
 
1914
1922
        self.reply_args_0 = {
1915
1923
            'same_screen': 1,
1922
1930
            'sequence_number': 29530,
1923
1931
            'win_y': -19690,
1924
1932
            }
1925
 
        self.reply_bin_0 = '\x01\x01\x5a\x73' '\x00\x00\x00\x00' \
1926
 
            '\x34\xa3\x7b\x6e' '\x9e\xaa\x8d\x7f' \
1927
 
            '\x9d\xf6\x0e\xb8' '\x03\x88\x16\xb3' \
1928
 
            '\x96\x38\x00\x00' '\x00\x00\x00\x00'
 
1933
        self.reply_bin_0 = b'\x01\x01\x5a\x73' b'\x00\x00\x00\x00' \
 
1934
            b'\x34\xa3\x7b\x6e' b'\x9e\xaa\x8d\x7f' \
 
1935
            b'\x9d\xf6\x0e\xb8' b'\x03\x88\x16\xb3' \
 
1936
            b'\x96\x38\x00\x00' b'\x00\x00\x00\x00'
1929
1937
 
1930
1938
 
1931
1939
    def testPackRequest0(self):
1932
 
        bin = apply(request.QueryPointer._request.to_binary, (), self.req_args_0)
 
1940
        bin = request.QueryPointer._request.to_binary(*(), **self.req_args_0)
1933
1941
        try:
1934
1942
            assert bin == self.req_bin_0
1935
1943
        except AssertionError:
1947
1955
            raise AssertionError(args)
1948
1956
 
1949
1957
    def testPackReply0(self):
1950
 
        bin = apply(request.QueryPointer._reply.to_binary, (), self.reply_args_0)
 
1958
        bin = request.QueryPointer._reply.to_binary(*(), **self.reply_args_0)
1951
1959
        try:
1952
1960
            assert bin == self.reply_bin_0
1953
1961
        except AssertionError:
1972
1980
            'window': 528148429,
1973
1981
            'stop': 1808786083,
1974
1982
            }
1975
 
        self.req_bin_0 = '\x27\x00\x04\x00' '\xcd\xe7\x7a\x1f' \
1976
 
            '\x7d\xa5\xc9\x7d' '\xa3\xe2\xcf\x6b'
 
1983
        self.req_bin_0 = b'\x27\x00\x04\x00' b'\xcd\xe7\x7a\x1f' \
 
1984
            b'\x7d\xa5\xc9\x7d' b'\xa3\xe2\xcf\x6b'
1977
1985
 
1978
1986
        self.reply_args_0 = {
1979
1987
            'events': [{'y': -23108, 'x': -3461, 'time': 984326273}, {'y': -4096, 'x': -4908, 'time': 488459157}, {'y': -29782, 'x': -8325, 'time': 1162935901}, {'y': -26418, 'x': -10559, 'time': 275816904}, {'y': -3941, 'x': -2216, 'time': 656439277}],
1980
1988
            'sequence_number': 42652,
1981
1989
            }
1982
 
        self.reply_bin_0 = '\x01\x00\x9c\xa6' '\x0a\x00\x00\x00' \
1983
 
            '\x05\x00\x00\x00' '\x00\x00\x00\x00' \
1984
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
1985
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
1986
 
            '\x81\xa0\xab\x3a' '\x7b\xf2\xbc\xa5' \
1987
 
            '\x95\x4b\x1d\x1d' '\xd4\xec\x00\xf0' \
1988
 
            '\x5d\xfe\x50\x45' '\x7b\xdf\xaa\x8b' \
1989
 
            '\xc8\xa1\x70\x10' '\xc1\xd6\xce\x98' \
1990
 
            '\xed\x77\x20\x27' '\x58\xf7\x9b\xf0'
 
1990
        self.reply_bin_0 = b'\x01\x00\x9c\xa6' b'\x0a\x00\x00\x00' \
 
1991
            b'\x05\x00\x00\x00' b'\x00\x00\x00\x00' \
 
1992
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
1993
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
1994
            b'\x81\xa0\xab\x3a' b'\x7b\xf2\xbc\xa5' \
 
1995
            b'\x95\x4b\x1d\x1d' b'\xd4\xec\x00\xf0' \
 
1996
            b'\x5d\xfe\x50\x45' b'\x7b\xdf\xaa\x8b' \
 
1997
            b'\xc8\xa1\x70\x10' b'\xc1\xd6\xce\x98' \
 
1998
            b'\xed\x77\x20\x27' b'\x58\xf7\x9b\xf0'
1991
1999
 
1992
2000
 
1993
2001
    def testPackRequest0(self):
1994
 
        bin = apply(request.GetMotionEvents._request.to_binary, (), self.req_args_0)
 
2002
        bin = request.GetMotionEvents._request.to_binary(*(), **self.req_args_0)
1995
2003
        try:
1996
2004
            assert bin == self.req_bin_0
1997
2005
        except AssertionError:
2009
2017
            raise AssertionError(args)
2010
2018
 
2011
2019
    def testPackReply0(self):
2012
 
        bin = apply(request.GetMotionEvents._reply.to_binary, (), self.reply_args_0)
 
2020
        bin = request.GetMotionEvents._reply.to_binary(*(), **self.reply_args_0)
2013
2021
        try:
2014
2022
            assert bin == self.reply_bin_0
2015
2023
        except AssertionError:
2035
2043
            'src_x': -18176,
2036
2044
            'src_y': -309,
2037
2045
            }
2038
 
        self.req_bin_0 = '\x28\x00\x04\x00' '\x8d\xc6\x9e\x4a' \
2039
 
            '\xf0\x4f\xaa\x0e' '\x00\xb9\xcb\xfe'
 
2046
        self.req_bin_0 = b'\x28\x00\x04\x00' b'\x8d\xc6\x9e\x4a' \
 
2047
            b'\xf0\x4f\xaa\x0e' b'\x00\xb9\xcb\xfe'
2040
2048
 
2041
2049
        self.reply_args_0 = {
2042
2050
            'y': -24269,
2045
2053
            'same_screen': 0,
2046
2054
            'child': 1548917071,
2047
2055
            }
2048
 
        self.reply_bin_0 = '\x01\x00\x5b\x9a' '\x00\x00\x00\x00' \
2049
 
            '\x4f\x99\x52\x5c' '\xca\x8b\x33\xa1' \
2050
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
2051
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
2056
        self.reply_bin_0 = b'\x01\x00\x5b\x9a' b'\x00\x00\x00\x00' \
 
2057
            b'\x4f\x99\x52\x5c' b'\xca\x8b\x33\xa1' \
 
2058
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
2059
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
2052
2060
 
2053
2061
 
2054
2062
    def testPackRequest0(self):
2055
 
        bin = apply(request.TranslateCoords._request.to_binary, (), self.req_args_0)
 
2063
        bin = request.TranslateCoords._request.to_binary(*(), **self.req_args_0)
2056
2064
        try:
2057
2065
            assert bin == self.req_bin_0
2058
2066
        except AssertionError:
2070
2078
            raise AssertionError(args)
2071
2079
 
2072
2080
    def testPackReply0(self):
2073
 
        bin = apply(request.TranslateCoords._reply.to_binary, (), self.reply_args_0)
 
2081
        bin = request.TranslateCoords._reply.to_binary(*(), **self.reply_args_0)
2074
2082
        try:
2075
2083
            assert bin == self.reply_bin_0
2076
2084
        except AssertionError:
2100
2108
            'dst_window': 2139748563,
2101
2109
            'src_window': 1945176770,
2102
2110
            }
2103
 
        self.req_bin_0 = '\x29\x00\x06\x00' '\xc2\x0a\xf1\x73' \
2104
 
            '\xd3\xf8\x89\x7f' '\xd6\xfa\x4a\xcc' \
2105
 
            '\x49\xb0\x03\x21' '\x62\xc3\xf7\x99'
 
2111
        self.req_bin_0 = b'\x29\x00\x06\x00' b'\xc2\x0a\xf1\x73' \
 
2112
            b'\xd3\xf8\x89\x7f' b'\xd6\xfa\x4a\xcc' \
 
2113
            b'\x49\xb0\x03\x21' b'\x62\xc3\xf7\x99'
2106
2114
 
2107
2115
 
2108
2116
    def testPackRequest0(self):
2109
 
        bin = apply(request.WarpPointer._request.to_binary, (), self.req_args_0)
 
2117
        bin = request.WarpPointer._request.to_binary(*(), **self.req_args_0)
2110
2118
        try:
2111
2119
            assert bin == self.req_bin_0
2112
2120
        except AssertionError:
2131
2139
            'focus': 1068495705,
2132
2140
            'time': 342883486,
2133
2141
            }
2134
 
        self.req_bin_0 = '\x2a\x00\x03\x00' '\x59\xf3\xaf\x3f' \
2135
 
            '\x9e\xfc\x6f\x14'
 
2142
        self.req_bin_0 = b'\x2a\x00\x03\x00' b'\x59\xf3\xaf\x3f' \
 
2143
            b'\x9e\xfc\x6f\x14'
2136
2144
 
2137
2145
 
2138
2146
    def testPackRequest0(self):
2139
 
        bin = apply(request.SetInputFocus._request.to_binary, (), self.req_args_0)
 
2147
        bin = request.SetInputFocus._request.to_binary(*(), **self.req_args_0)
2140
2148
        try:
2141
2149
            assert bin == self.req_bin_0
2142
2150
        except AssertionError:
2158
2166
    def setUp(self):
2159
2167
        self.req_args_0 = {
2160
2168
            }
2161
 
        self.req_bin_0 = '\x2b\x00\x01\x00'
 
2169
        self.req_bin_0 = b'\x2b\x00\x01\x00'
2162
2170
 
2163
2171
        self.reply_args_0 = {
2164
2172
            'revert_to': 129,
2165
2173
            'focus': 1884243837,
2166
2174
            'sequence_number': 9052,
2167
2175
            }
2168
 
        self.reply_bin_0 = '\x01\x81\x5c\x23' '\x00\x00\x00\x00' \
2169
 
            '\x7d\x47\x4f\x70' '\x00\x00\x00\x00' \
2170
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
2171
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
2176
        self.reply_bin_0 = b'\x01\x81\x5c\x23' b'\x00\x00\x00\x00' \
 
2177
            b'\x7d\x47\x4f\x70' b'\x00\x00\x00\x00' \
 
2178
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
2179
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
2172
2180
 
2173
2181
 
2174
2182
    def testPackRequest0(self):
2175
 
        bin = apply(request.GetInputFocus._request.to_binary, (), self.req_args_0)
 
2183
        bin = request.GetInputFocus._request.to_binary(*(), **self.req_args_0)
2176
2184
        try:
2177
2185
            assert bin == self.req_bin_0
2178
2186
        except AssertionError:
2190
2198
            raise AssertionError(args)
2191
2199
 
2192
2200
    def testPackReply0(self):
2193
 
        bin = apply(request.GetInputFocus._reply.to_binary, (), self.reply_args_0)
 
2201
        bin = request.GetInputFocus._reply.to_binary(*(), **self.reply_args_0)
2194
2202
        try:
2195
2203
            assert bin == self.reply_bin_0
2196
2204
        except AssertionError:
2212
2220
    def setUp(self):
2213
2221
        self.req_args_0 = {
2214
2222
            }
2215
 
        self.req_bin_0 = '\x2c\x00\x01\x00'
 
2223
        self.req_bin_0 = b'\x2c\x00\x01\x00'
2216
2224
 
2217
2225
        self.reply_args_0 = {
2218
2226
            'map': [175, 212, 207, 139, 156, 192, 230, 219, 136, 198, 152, 156, 229, 233, 221, 209, 131, 229, 209, 249, 130, 189, 183, 135, 238, 149, 131, 204, 162, 229, 149, 246],
2219
2227
            'sequence_number': 19383,
2220
2228
            }
2221
 
        self.reply_bin_0 = '\x01\x00\xb7\x4b' '\x02\x00\x00\x00' \
2222
 
            '\xaf\xd4\xcf\x8b' '\x9c\xc0\xe6\xdb' \
2223
 
            '\x88\xc6\x98\x9c' '\xe5\xe9\xdd\xd1' \
2224
 
            '\x83\xe5\xd1\xf9' '\x82\xbd\xb7\x87' \
2225
 
            '\xee\x95\x83\xcc' '\xa2\xe5\x95\xf6'
 
2229
        self.reply_bin_0 = b'\x01\x00\xb7\x4b' b'\x02\x00\x00\x00' \
 
2230
            b'\xaf\xd4\xcf\x8b' b'\x9c\xc0\xe6\xdb' \
 
2231
            b'\x88\xc6\x98\x9c' b'\xe5\xe9\xdd\xd1' \
 
2232
            b'\x83\xe5\xd1\xf9' b'\x82\xbd\xb7\x87' \
 
2233
            b'\xee\x95\x83\xcc' b'\xa2\xe5\x95\xf6'
2226
2234
 
2227
2235
 
2228
2236
    def testPackRequest0(self):
2229
 
        bin = apply(request.QueryKeymap._request.to_binary, (), self.req_args_0)
 
2237
        bin = request.QueryKeymap._request.to_binary(*(), **self.req_args_0)
2230
2238
        try:
2231
2239
            assert bin == self.req_bin_0
2232
2240
        except AssertionError:
2244
2252
            raise AssertionError(args)
2245
2253
 
2246
2254
    def testPackReply0(self):
2247
 
        bin = apply(request.QueryKeymap._reply.to_binary, (), self.reply_args_0)
 
2255
        bin = request.QueryKeymap._reply.to_binary(*(), **self.reply_args_0)
2248
2256
        try:
2249
2257
            assert bin == self.reply_bin_0
2250
2258
        except AssertionError:
2268
2276
            'name': 'foofont',
2269
2277
            'fid': 1809550053,
2270
2278
            }
2271
 
        self.req_bin_0 = '\x2d\x00\x05\x00' '\xe5\x8a\xdb\x6b' \
2272
 
            '\x07\x00\x00\x00' '\x66\x6f\x6f\x66' \
2273
 
            '\x6f\x6e\x74\x00'
 
2279
        self.req_bin_0 = b'\x2d\x00\x05\x00' b'\xe5\x8a\xdb\x6b' \
 
2280
            b'\x07\x00\x00\x00' b'\x66\x6f\x6f\x66' \
 
2281
            b'\x6f\x6e\x74\x00'
2274
2282
 
2275
2283
 
2276
2284
    def testPackRequest0(self):
2277
 
        bin = apply(request.OpenFont._request.to_binary, (), self.req_args_0)
 
2285
        bin = request.OpenFont._request.to_binary(*(), **self.req_args_0)
2278
2286
        try:
2279
2287
            assert bin == self.req_bin_0
2280
2288
        except AssertionError:
2297
2305
        self.req_args_0 = {
2298
2306
            'font': 405865016,
2299
2307
            }
2300
 
        self.req_bin_0 = '\x2e\x00\x02\x00' '\x38\x02\x31\x18'
 
2308
        self.req_bin_0 = b'\x2e\x00\x02\x00' b'\x38\x02\x31\x18'
2301
2309
 
2302
2310
 
2303
2311
    def testPackRequest0(self):
2304
 
        bin = apply(request.CloseFont._request.to_binary, (), self.req_args_0)
 
2312
        bin = request.CloseFont._request.to_binary(*(), **self.req_args_0)
2305
2313
        try:
2306
2314
            assert bin == self.req_bin_0
2307
2315
        except AssertionError:
2324
2332
        self.req_args_0 = {
2325
2333
            'font': 173413537,
2326
2334
            }
2327
 
        self.req_bin_0 = '\x2f\x00\x02\x00' '\xa1\x14\x56\x0a'
 
2335
        self.req_bin_0 = b'\x2f\x00\x02\x00' b'\xa1\x14\x56\x0a'
2328
2336
 
2329
2337
        self.reply_args_0 = {
2330
2338
            'max_bounds': {'left_side_bearing': -27346, 'descent': -13574, 'right_side_bearing': -29649, 'attributes': 58157, 'character_width': -6055, 'ascent': -4810},
2342
2350
            'properties': [{'name': 515636466, 'value': 1798456662}],
2343
2351
            'sequence_number': 52469,
2344
2352
            }
2345
 
        self.reply_bin_0 = '\x01\x00\xf5\xcc' '\x12\x00\x00\x00' \
2346
 
            '\x29\xe0\xf8\x83' '\x64\xb3\x6c\xd9' \
2347
 
            '\x6d\x8f\xba\xcd' '\x00\x00\x00\x00' \
2348
 
            '\x2e\x95\x2f\x8c' '\x59\xe8\x36\xed' \
2349
 
            '\xfa\xca\x2d\xe3' '\x00\x00\x00\x00' \
2350
 
            '\x08\xd1\x0a\xbd' '\x13\x6f\x01\x00' \
2351
 
            '\xa5\xc3\xdb\x00' '\x1a\xc2\x6f\xfc' \
2352
 
            '\x03\x00\x00\x00' '\xf2\xfc\xbb\x1e' \
2353
 
            '\x56\x45\x32\x6b' '\xfe\xae\x3f\xf5' \
2354
 
            '\x3d\xd0\xc7\xc9' '\x40\xc4\xfb\xfb' \
2355
 
            '\xfe\xd5\x51\xda' '\x09\x97\x23\xd4' \
2356
 
            '\xa7\xf9\xa8\x74' '\x8e\x87\xaf\x93' \
2357
 
            '\x65\xef\x49\xd0' '\x50\xbe\x82\xde'
 
2353
        self.reply_bin_0 = b'\x01\x00\xf5\xcc' b'\x12\x00\x00\x00' \
 
2354
            b'\x29\xe0\xf8\x83' b'\x64\xb3\x6c\xd9' \
 
2355
            b'\x6d\x8f\xba\xcd' b'\x00\x00\x00\x00' \
 
2356
            b'\x2e\x95\x2f\x8c' b'\x59\xe8\x36\xed' \
 
2357
            b'\xfa\xca\x2d\xe3' b'\x00\x00\x00\x00' \
 
2358
            b'\x08\xd1\x0a\xbd' b'\x13\x6f\x01\x00' \
 
2359
            b'\xa5\xc3\xdb\x00' b'\x1a\xc2\x6f\xfc' \
 
2360
            b'\x03\x00\x00\x00' b'\xf2\xfc\xbb\x1e' \
 
2361
            b'\x56\x45\x32\x6b' b'\xfe\xae\x3f\xf5' \
 
2362
            b'\x3d\xd0\xc7\xc9' b'\x40\xc4\xfb\xfb' \
 
2363
            b'\xfe\xd5\x51\xda' b'\x09\x97\x23\xd4' \
 
2364
            b'\xa7\xf9\xa8\x74' b'\x8e\x87\xaf\x93' \
 
2365
            b'\x65\xef\x49\xd0' b'\x50\xbe\x82\xde'
2358
2366
 
2359
2367
 
2360
2368
    def testPackRequest0(self):
2361
 
        bin = apply(request.QueryFont._request.to_binary, (), self.req_args_0)
 
2369
        bin = request.QueryFont._request.to_binary(*(), **self.req_args_0)
2362
2370
        try:
2363
2371
            assert bin == self.req_bin_0
2364
2372
        except AssertionError:
2376
2384
            raise AssertionError(args)
2377
2385
 
2378
2386
    def testPackReply0(self):
2379
 
        bin = apply(request.QueryFont._reply.to_binary, (), self.reply_args_0)
 
2387
        bin = request.QueryFont._reply.to_binary(*(), **self.reply_args_0)
2380
2388
        try:
2381
2389
            assert bin == self.reply_bin_0
2382
2390
        except AssertionError:
2400
2408
            'font': 1637171782,
2401
2409
            'string': (102, 111, 111),
2402
2410
            }
2403
 
        self.req_bin_0 = '\x30\x01\x04\x00' '\x46\x42\x95\x61' \
2404
 
            '\x00\x66\x00\x6f' '\x00\x6f\x00\x00'
 
2411
        self.req_bin_0 = b'\x30\x01\x04\x00' b'\x46\x42\x95\x61' \
 
2412
            b'\x00\x66\x00\x6f' b'\x00\x6f\x00\x00'
2405
2413
 
2406
2414
        self.reply_args_0 = {
2407
2415
            'font_descent': -10581,
2414
2422
            'sequence_number': 6206,
2415
2423
            'overall_width': -127705892,
2416
2424
            }
2417
 
        self.reply_bin_0 = '\x01\xc3\x3e\x18' '\x00\x00\x00\x00' \
2418
 
            '\x45\xa6\xab\xd6' '\x72\x80\x6a\xb2' \
2419
 
            '\xdc\x5c\x63\xf8' '\x65\x3c\xb5\xb7' \
2420
 
            '\x9a\xb2\x7c\xcf' '\x00\x00\x00\x00'
 
2425
        self.reply_bin_0 = b'\x01\xc3\x3e\x18' b'\x00\x00\x00\x00' \
 
2426
            b'\x45\xa6\xab\xd6' b'\x72\x80\x6a\xb2' \
 
2427
            b'\xdc\x5c\x63\xf8' b'\x65\x3c\xb5\xb7' \
 
2428
            b'\x9a\xb2\x7c\xcf' b'\x00\x00\x00\x00'
2421
2429
 
2422
2430
 
2423
2431
    def testPackRequest0(self):
2424
 
        bin = apply(request.QueryTextExtents._request.to_binary, (), self.req_args_0)
 
2432
        bin = request.QueryTextExtents._request.to_binary(*(), **self.req_args_0)
2425
2433
        try:
2426
2434
            assert bin == self.req_bin_0
2427
2435
        except AssertionError:
2439
2447
            raise AssertionError(args)
2440
2448
 
2441
2449
    def testPackReply0(self):
2442
 
        bin = apply(request.QueryTextExtents._reply.to_binary, (), self.reply_args_0)
 
2450
        bin = request.QueryTextExtents._reply.to_binary(*(), **self.reply_args_0)
2443
2451
        try:
2444
2452
            assert bin == self.reply_bin_0
2445
2453
        except AssertionError:
2463
2471
            'pattern': 'bhazr',
2464
2472
            'max_names': 57427,
2465
2473
            }
2466
 
        self.req_bin_0 = '\x31\x00\x04\x00' '\x53\xe0\x05\x00' \
2467
 
            '\x62\x68\x61\x7a' '\x72\x00\x00\x00'
 
2474
        self.req_bin_0 = b'\x31\x00\x04\x00' b'\x53\xe0\x05\x00' \
 
2475
            b'\x62\x68\x61\x7a' b'\x72\x00\x00\x00'
2468
2476
 
2469
2477
        self.reply_args_0 = {
2470
2478
            'fonts': ['fie', 'fuzzy', 'foozooom'],
2471
2479
            'sequence_number': 39409,
2472
2480
            }
2473
 
        self.reply_bin_0 = '\x01\x00\xf1\x99' '\x05\x00\x00\x00' \
2474
 
            '\x03\x00\x00\x00' '\x00\x00\x00\x00' \
2475
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
2476
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
2477
 
            '\x03\x66\x69\x65' '\x05\x66\x75\x7a' \
2478
 
            '\x7a\x79\x08\x66' '\x6f\x6f\x7a\x6f' \
2479
 
            '\x6f\x6f\x6d\x00'
 
2481
        self.reply_bin_0 = b'\x01\x00\xf1\x99' b'\x05\x00\x00\x00' \
 
2482
            b'\x03\x00\x00\x00' b'\x00\x00\x00\x00' \
 
2483
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
2484
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
2485
            b'\x03\x66\x69\x65' b'\x05\x66\x75\x7a' \
 
2486
            b'\x7a\x79\x08\x66' b'\x6f\x6f\x7a\x6f' \
 
2487
            b'\x6f\x6f\x6d\x00'
2480
2488
 
2481
2489
 
2482
2490
    def testPackRequest0(self):
2483
 
        bin = apply(request.ListFonts._request.to_binary, (), self.req_args_0)
 
2491
        bin = request.ListFonts._request.to_binary(*(), **self.req_args_0)
2484
2492
        try:
2485
2493
            assert bin == self.req_bin_0
2486
2494
        except AssertionError:
2498
2506
            raise AssertionError(args)
2499
2507
 
2500
2508
    def testPackReply0(self):
2501
 
        bin = apply(request.ListFonts._reply.to_binary, (), self.reply_args_0)
 
2509
        bin = request.ListFonts._reply.to_binary(*(), **self.reply_args_0)
2502
2510
        try:
2503
2511
            assert bin == self.reply_bin_0
2504
2512
        except AssertionError:
2522
2530
            'pattern': 'bhazr2',
2523
2531
            'max_names': 52288,
2524
2532
            }
2525
 
        self.req_bin_0 = '\x32\x00\x04\x00' '\x40\xcc\x06\x00' \
2526
 
            '\x62\x68\x61\x7a' '\x72\x32\x00\x00'
 
2533
        self.req_bin_0 = b'\x32\x00\x04\x00' b'\x40\xcc\x06\x00' \
 
2534
            b'\x62\x68\x61\x7a' b'\x72\x32\x00\x00'
2527
2535
 
2528
2536
        self.reply_args_0 = {
2529
2537
            'max_bounds': {'left_side_bearing': -9255, 'descent': -26305, 'right_side_bearing': -6756, 'attributes': 49084, 'character_width': -4462, 'ascent': -3529},
2542
2550
            'properties': [{'name': 213588122, 'value': 1789263183}],
2543
2551
            'sequence_number': 43812,
2544
2552
            }
2545
 
        self.reply_bin_0 = '\x01\x08\x24\xab' '\x0b\x00\x00\x00' \
2546
 
            '\x62\xdf\x86\xb3' '\x5f\xae\x0c\xd9' \
2547
 
            '\xc4\xbd\xd8\x6a' '\x00\x00\x00\x00' \
2548
 
            '\xd9\xdb\x9c\xe5' '\x92\xee\x37\xf2' \
2549
 
            '\x3f\x99\xbc\xbf' '\x00\x00\x00\x00' \
2550
 
            '\x45\xfe\x72\xb0' '\x6b\x98\x01\x00' \
2551
 
            '\xe5\x9e\xdd\x01' '\xce\x96\x37\x9e' \
2552
 
            '\x27\x6f\x9c\x68' '\x9a\x18\xbb\x0c' \
2553
 
            '\x4f\xfd\xa5\x6a' '\x66\x6f\x6e\x74' \
2554
 
            '\x66\x6f\x6e\x74'
 
2553
        self.reply_bin_0 = b'\x01\x08\x24\xab' b'\x0b\x00\x00\x00' \
 
2554
            b'\x62\xdf\x86\xb3' b'\x5f\xae\x0c\xd9' \
 
2555
            b'\xc4\xbd\xd8\x6a' b'\x00\x00\x00\x00' \
 
2556
            b'\xd9\xdb\x9c\xe5' b'\x92\xee\x37\xf2' \
 
2557
            b'\x3f\x99\xbc\xbf' b'\x00\x00\x00\x00' \
 
2558
            b'\x45\xfe\x72\xb0' b'\x6b\x98\x01\x00' \
 
2559
            b'\xe5\x9e\xdd\x01' b'\xce\x96\x37\x9e' \
 
2560
            b'\x27\x6f\x9c\x68' b'\x9a\x18\xbb\x0c' \
 
2561
            b'\x4f\xfd\xa5\x6a' b'\x66\x6f\x6e\x74' \
 
2562
            b'\x66\x6f\x6e\x74'
2555
2563
 
2556
2564
 
2557
2565
    def testPackRequest0(self):
2558
 
        bin = apply(request.ListFontsWithInfo._request.to_binary, (), self.req_args_0)
 
2566
        bin = request.ListFontsWithInfo._request.to_binary(*(), **self.req_args_0)
2559
2567
        try:
2560
2568
            assert bin == self.req_bin_0
2561
2569
        except AssertionError:
2573
2581
            raise AssertionError(args)
2574
2582
 
2575
2583
    def testPackReply0(self):
2576
 
        bin = apply(request.ListFontsWithInfo._reply.to_binary, (), self.reply_args_0)
 
2584
        bin = request.ListFontsWithInfo._reply.to_binary(*(), **self.reply_args_0)
2577
2585
        try:
2578
2586
            assert bin == self.reply_bin_0
2579
2587
        except AssertionError:
2596
2604
        self.req_args_0 = {
2597
2605
            'path': ['foo', 'bar', 'gazonk'],
2598
2606
            }
2599
 
        self.req_bin_0 = '\x33\x00\x06\x00' '\x03\x00\x00\x00' \
2600
 
            '\x03\x66\x6f\x6f' '\x03\x62\x61\x72' \
2601
 
            '\x06\x67\x61\x7a' '\x6f\x6e\x6b\x00'
 
2607
        self.req_bin_0 = b'\x33\x00\x06\x00' b'\x03\x00\x00\x00' \
 
2608
            b'\x03\x66\x6f\x6f' b'\x03\x62\x61\x72' \
 
2609
            b'\x06\x67\x61\x7a' b'\x6f\x6e\x6b\x00'
2602
2610
 
2603
2611
        self.req_args_1 = {
2604
2612
            'path': [],
2605
2613
            }
2606
 
        self.req_bin_1 = '\x33\x00\x02\x00' '\x00\x00\x00\x00'
 
2614
        self.req_bin_1 = b'\x33\x00\x02\x00' b'\x00\x00\x00\x00'
2607
2615
 
2608
2616
 
2609
2617
    def testPackRequest0(self):
2610
 
        bin = apply(request.SetFontPath._request.to_binary, (), self.req_args_0)
 
2618
        bin = request.SetFontPath._request.to_binary(*(), **self.req_args_0)
2611
2619
        try:
2612
2620
            assert bin == self.req_bin_0
2613
2621
        except AssertionError:
2625
2633
            raise AssertionError(args)
2626
2634
 
2627
2635
    def testPackRequest1(self):
2628
 
        bin = apply(request.SetFontPath._request.to_binary, (), self.req_args_1)
 
2636
        bin = request.SetFontPath._request.to_binary(*(), **self.req_args_1)
2629
2637
        try:
2630
2638
            assert bin == self.req_bin_1
2631
2639
        except AssertionError:
2647
2655
    def setUp(self):
2648
2656
        self.req_args_0 = {
2649
2657
            }
2650
 
        self.req_bin_0 = '\x34\x00\x01\x00'
 
2658
        self.req_bin_0 = b'\x34\x00\x01\x00'
2651
2659
 
2652
2660
        self.reply_args_0 = {
2653
2661
            'paths': ['path1', 'path2232'],
2654
2662
            'sequence_number': 17086,
2655
2663
            }
2656
 
        self.reply_bin_0 = '\x01\x00\xbe\x42' '\x04\x00\x00\x00' \
2657
 
            '\x02\x00\x00\x00' '\x00\x00\x00\x00' \
2658
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
2659
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
2660
 
            '\x05\x70\x61\x74' '\x68\x31\x08\x70' \
2661
 
            '\x61\x74\x68\x32' '\x32\x33\x32\x00'
 
2664
        self.reply_bin_0 = b'\x01\x00\xbe\x42' b'\x04\x00\x00\x00' \
 
2665
            b'\x02\x00\x00\x00' b'\x00\x00\x00\x00' \
 
2666
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
2667
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
2668
            b'\x05\x70\x61\x74' b'\x68\x31\x08\x70' \
 
2669
            b'\x61\x74\x68\x32' b'\x32\x33\x32\x00'
2662
2670
 
2663
2671
        self.reply_args_1 = {
2664
2672
            'paths': [],
2665
2673
            'sequence_number': 8511,
2666
2674
            }
2667
 
        self.reply_bin_1 = '\x01\x00\x3f\x21' '\x00\x00\x00\x00' \
2668
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
2669
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
2670
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
2675
        self.reply_bin_1 = b'\x01\x00\x3f\x21' b'\x00\x00\x00\x00' \
 
2676
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
2677
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
2678
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
2671
2679
 
2672
2680
 
2673
2681
    def testPackRequest0(self):
2674
 
        bin = apply(request.GetFontPath._request.to_binary, (), self.req_args_0)
 
2682
        bin = request.GetFontPath._request.to_binary(*(), **self.req_args_0)
2675
2683
        try:
2676
2684
            assert bin == self.req_bin_0
2677
2685
        except AssertionError:
2689
2697
            raise AssertionError(args)
2690
2698
 
2691
2699
    def testPackReply0(self):
2692
 
        bin = apply(request.GetFontPath._reply.to_binary, (), self.reply_args_0)
 
2700
        bin = request.GetFontPath._reply.to_binary(*(), **self.reply_args_0)
2693
2701
        try:
2694
2702
            assert bin == self.reply_bin_0
2695
2703
        except AssertionError:
2707
2715
            raise AssertionError(args)
2708
2716
 
2709
2717
    def testPackReply1(self):
2710
 
        bin = apply(request.GetFontPath._reply.to_binary, (), self.reply_args_1)
 
2718
        bin = request.GetFontPath._reply.to_binary(*(), **self.reply_args_1)
2711
2719
        try:
2712
2720
            assert bin == self.reply_bin_1
2713
2721
        except AssertionError:
2734
2742
            'drawable': 1358709134,
2735
2743
            'height': 16464,
2736
2744
            }
2737
 
        self.req_bin_0 = '\x35\xb3\x04\x00' '\x4a\xd5\x85\x32' \
2738
 
            '\x8e\x41\xfc\x50' '\x4c\x7e\x50\x40'
 
2745
        self.req_bin_0 = b'\x35\xb3\x04\x00' b'\x4a\xd5\x85\x32' \
 
2746
            b'\x8e\x41\xfc\x50' b'\x4c\x7e\x50\x40'
2739
2747
 
2740
2748
 
2741
2749
    def testPackRequest0(self):
2742
 
        bin = apply(request.CreatePixmap._request.to_binary, (), self.req_args_0)
 
2750
        bin = request.CreatePixmap._request.to_binary(*(), **self.req_args_0)
2743
2751
        try:
2744
2752
            assert bin == self.req_bin_0
2745
2753
        except AssertionError:
2762
2770
        self.req_args_0 = {
2763
2771
            'pixmap': 1323266674,
2764
2772
            }
2765
 
        self.req_bin_0 = '\x36\x00\x02\x00' '\x72\x72\xdf\x4e'
 
2773
        self.req_bin_0 = b'\x36\x00\x02\x00' b'\x72\x72\xdf\x4e'
2766
2774
 
2767
2775
 
2768
2776
    def testPackRequest0(self):
2769
 
        bin = apply(request.FreePixmap._request.to_binary, (), self.req_args_0)
 
2777
        bin = request.FreePixmap._request.to_binary(*(), **self.req_args_0)
2770
2778
        try:
2771
2779
            assert bin == self.req_bin_0
2772
2780
        except AssertionError:
2791
2799
            'attrs': {'function': 14, 'foreground': 814230008, 'background': 2072616911, 'clip_x_origin': -6987, 'subwindow_mode': 0, 'cap_style': 1, 'fill_style': 3, 'tile_stipple_y_origin': -25870, 'font': 264499208, 'graphics_exposures': 0, 'join_style': 2, 'line_width': 36600, 'stipple': 870974399, 'dash_offset': 49599, 'clip_y_origin': -5712, 'tile_stipple_x_origin': -32365, 'arc_mode': 0, 'tile': 1597988019, 'line_style': 2, 'plane_mask': 1650697305, 'clip_mask': 402937862, 'fill_rule': 0, 'dashes': 136},
2792
2800
            'cid': 779296774,
2793
2801
            }
2794
 
        self.req_bin_0 = '\x37\x00\x1b\x00' '\x06\x20\x73\x2e' \
2795
 
            '\xb2\x9b\x7c\x31' '\xff\xff\x7f\x00' \
2796
 
            '\x0e\x00\x00\x00' '\x59\xa4\x63\x62' \
2797
 
            '\xf8\x29\x88\x30' '\xcf\x9f\x89\x7b' \
2798
 
            '\xf8\x8e\x00\x00' '\x02\x00\x00\x00' \
2799
 
            '\x01\x00\x00\x00' '\x02\x00\x00\x00' \
2800
 
            '\x03\x00\x00\x00' '\x00\x00\x00\x00' \
2801
 
            '\xb3\x5c\x3f\x5f' '\xbf\x03\xea\x33' \
2802
 
            '\x93\x81\x00\x00' '\xf2\x9a\x00\x00' \
2803
 
            '\x08\xf0\xc3\x0f' '\x00\x00\x00\x00' \
2804
 
            '\x00\x00\x00\x00' '\xb5\xe4\x00\x00' \
2805
 
            '\xb0\xe9\x00\x00' '\x06\x58\x04\x18' \
2806
 
            '\xbf\xc1\x00\x00' '\x88\x00\x00\x00' \
2807
 
            '\x00\x00\x00\x00'
 
2802
        self.req_bin_0 = b'\x37\x00\x1b\x00' b'\x06\x20\x73\x2e' \
 
2803
            b'\xb2\x9b\x7c\x31' b'\xff\xff\x7f\x00' \
 
2804
            b'\x0e\x00\x00\x00' b'\x59\xa4\x63\x62' \
 
2805
            b'\xf8\x29\x88\x30' b'\xcf\x9f\x89\x7b' \
 
2806
            b'\xf8\x8e\x00\x00' b'\x02\x00\x00\x00' \
 
2807
            b'\x01\x00\x00\x00' b'\x02\x00\x00\x00' \
 
2808
            b'\x03\x00\x00\x00' b'\x00\x00\x00\x00' \
 
2809
            b'\xb3\x5c\x3f\x5f' b'\xbf\x03\xea\x33' \
 
2810
            b'\x93\x81\x00\x00' b'\xf2\x9a\x00\x00' \
 
2811
            b'\x08\xf0\xc3\x0f' b'\x00\x00\x00\x00' \
 
2812
            b'\x00\x00\x00\x00' b'\xb5\xe4\x00\x00' \
 
2813
            b'\xb0\xe9\x00\x00' b'\x06\x58\x04\x18' \
 
2814
            b'\xbf\xc1\x00\x00' b'\x88\x00\x00\x00' \
 
2815
            b'\x00\x00\x00\x00'
2808
2816
 
2809
2817
 
2810
2818
    def testPackRequest0(self):
2811
 
        bin = apply(request.CreateGC._request.to_binary, (), self.req_args_0)
 
2819
        bin = request.CreateGC._request.to_binary(*(), **self.req_args_0)
2812
2820
        try:
2813
2821
            assert bin == self.req_bin_0
2814
2822
        except AssertionError:
2832
2840
            'gc': 1996372624,
2833
2841
            'attrs': {'function': 15, 'foreground': 1817174045, 'background': 840850119, 'clip_x_origin': -28415, 'subwindow_mode': 1, 'cap_style': 0, 'fill_style': 0, 'tile_stipple_y_origin': -24832, 'font': 240535139, 'graphics_exposures': 1, 'join_style': 2, 'line_width': 64290, 'stipple': 1739313208, 'dash_offset': 53189, 'clip_y_origin': -2802, 'tile_stipple_x_origin': -4548, 'arc_mode': 1, 'tile': 1091199324, 'line_style': 2, 'plane_mask': 1403123174, 'clip_mask': 1604118463, 'fill_rule': 1, 'dashes': 186},
2834
2842
            }
2835
 
        self.req_bin_0 = '\x38\x00\x1a\x00' '\x90\x3a\xfe\x76' \
2836
 
            '\xff\xff\x7f\x00' '\x0f\x00\x00\x00' \
2837
 
            '\xe6\xf5\xa1\x53' '\x1d\xe0\x4f\x6c' \
2838
 
            '\xc7\x5a\x1e\x32' '\x22\xfb\x00\x00' \
2839
 
            '\x02\x00\x00\x00' '\x00\x00\x00\x00' \
2840
 
            '\x02\x00\x00\x00' '\x00\x00\x00\x00' \
2841
 
            '\x01\x00\x00\x00' '\x5c\x61\x0a\x41' \
2842
 
            '\x38\xd0\xab\x67' '\x3c\xee\x00\x00' \
2843
 
            '\x00\x9f\x00\x00' '\x63\x46\x56\x0e' \
2844
 
            '\x01\x00\x00\x00' '\x01\x00\x00\x00' \
2845
 
            '\x01\x91\x00\x00' '\x0e\xf5\x00\x00' \
2846
 
            '\xbf\xe7\x9c\x5f' '\xc5\xcf\x00\x00' \
2847
 
            '\xba\x00\x00\x00' '\x01\x00\x00\x00'
 
2843
        self.req_bin_0 = b'\x38\x00\x1a\x00' b'\x90\x3a\xfe\x76' \
 
2844
            b'\xff\xff\x7f\x00' b'\x0f\x00\x00\x00' \
 
2845
            b'\xe6\xf5\xa1\x53' b'\x1d\xe0\x4f\x6c' \
 
2846
            b'\xc7\x5a\x1e\x32' b'\x22\xfb\x00\x00' \
 
2847
            b'\x02\x00\x00\x00' b'\x00\x00\x00\x00' \
 
2848
            b'\x02\x00\x00\x00' b'\x00\x00\x00\x00' \
 
2849
            b'\x01\x00\x00\x00' b'\x5c\x61\x0a\x41' \
 
2850
            b'\x38\xd0\xab\x67' b'\x3c\xee\x00\x00' \
 
2851
            b'\x00\x9f\x00\x00' b'\x63\x46\x56\x0e' \
 
2852
            b'\x01\x00\x00\x00' b'\x01\x00\x00\x00' \
 
2853
            b'\x01\x91\x00\x00' b'\x0e\xf5\x00\x00' \
 
2854
            b'\xbf\xe7\x9c\x5f' b'\xc5\xcf\x00\x00' \
 
2855
            b'\xba\x00\x00\x00' b'\x01\x00\x00\x00'
2848
2856
 
2849
2857
 
2850
2858
    def testPackRequest0(self):
2851
 
        bin = apply(request.ChangeGC._request.to_binary, (), self.req_args_0)
 
2859
        bin = request.ChangeGC._request.to_binary(*(), **self.req_args_0)
2852
2860
        try:
2853
2861
            assert bin == self.req_bin_0
2854
2862
        except AssertionError:
2873
2881
            'dst_gc': 2046321491,
2874
2882
            'mask': 996538407,
2875
2883
            }
2876
 
        self.req_bin_0 = '\x39\x00\x04\x00' '\x3a\x47\xae\x5f' \
2877
 
            '\x53\x63\xf8\x79' '\x27\xf8\x65\x3b'
 
2884
        self.req_bin_0 = b'\x39\x00\x04\x00' b'\x3a\x47\xae\x5f' \
 
2885
            b'\x53\x63\xf8\x79' b'\x27\xf8\x65\x3b'
2878
2886
 
2879
2887
 
2880
2888
    def testPackRequest0(self):
2881
 
        bin = apply(request.CopyGC._request.to_binary, (), self.req_args_0)
 
2889
        bin = request.CopyGC._request.to_binary(*(), **self.req_args_0)
2882
2890
        try:
2883
2891
            assert bin == self.req_bin_0
2884
2892
        except AssertionError:
2903
2911
            'gc': 2119954025,
2904
2912
            'dashes': [146, 217, 181, 229, 212, 175, 201, 251, 248],
2905
2913
            }
2906
 
        self.req_bin_0 = '\x3a\x00\x06\x00' '\x69\xee\x5b\x7e' \
2907
 
            '\x8e\x88\x09\x00' '\x92\xd9\xb5\xe5' \
2908
 
            '\xd4\xaf\xc9\xfb' '\xf8\x00\x00\x00'
 
2914
        self.req_bin_0 = b'\x3a\x00\x06\x00' b'\x69\xee\x5b\x7e' \
 
2915
            b'\x8e\x88\x09\x00' b'\x92\xd9\xb5\xe5' \
 
2916
            b'\xd4\xaf\xc9\xfb' b'\xf8\x00\x00\x00'
2909
2917
 
2910
2918
 
2911
2919
    def testPackRequest0(self):
2912
 
        bin = apply(request.SetDashes._request.to_binary, (), self.req_args_0)
 
2920
        bin = request.SetDashes._request.to_binary(*(), **self.req_args_0)
2913
2921
        try:
2914
2922
            assert bin == self.req_bin_0
2915
2923
        except AssertionError:
2936
2944
            'rectangles': [{'y': -27524, 'x': -27245, 'height': 31014, 'width': 52432}, {'y': -8991, 'x': -11302, 'height': 9053, 'width': 11072}],
2937
2945
            'x_origin': -26003,
2938
2946
            }
2939
 
        self.req_bin_0 = '\x3b\x03\x07\x00' '\xc6\x91\xed\x78' \
2940
 
            '\x6d\x9a\x5e\xc3' '\x93\x95\x7c\x94' \
2941
 
            '\xd0\xcc\x26\x79' '\xda\xd3\xe1\xdc' \
2942
 
            '\x40\x2b\x5d\x23'
 
2947
        self.req_bin_0 = b'\x3b\x03\x07\x00' b'\xc6\x91\xed\x78' \
 
2948
            b'\x6d\x9a\x5e\xc3' b'\x93\x95\x7c\x94' \
 
2949
            b'\xd0\xcc\x26\x79' b'\xda\xd3\xe1\xdc' \
 
2950
            b'\x40\x2b\x5d\x23'
2943
2951
 
2944
2952
        self.req_args_1 = {
2945
2953
            'ordering': 1,
2948
2956
            'rectangles': [],
2949
2957
            'x_origin': -23382,
2950
2958
            }
2951
 
        self.req_bin_1 = '\x3b\x01\x03\x00' '\x8d\x63\x46\x09' \
2952
 
            '\xaa\xa4\x4a\x80'
 
2959
        self.req_bin_1 = b'\x3b\x01\x03\x00' b'\x8d\x63\x46\x09' \
 
2960
            b'\xaa\xa4\x4a\x80'
2953
2961
 
2954
2962
 
2955
2963
    def testPackRequest0(self):
2956
 
        bin = apply(request.SetClipRectangles._request.to_binary, (), self.req_args_0)
 
2964
        bin = request.SetClipRectangles._request.to_binary(*(), **self.req_args_0)
2957
2965
        try:
2958
2966
            assert bin == self.req_bin_0
2959
2967
        except AssertionError:
2971
2979
            raise AssertionError(args)
2972
2980
 
2973
2981
    def testPackRequest1(self):
2974
 
        bin = apply(request.SetClipRectangles._request.to_binary, (), self.req_args_1)
 
2982
        bin = request.SetClipRectangles._request.to_binary(*(), **self.req_args_1)
2975
2983
        try:
2976
2984
            assert bin == self.req_bin_1
2977
2985
        except AssertionError:
2994
3002
        self.req_args_0 = {
2995
3003
            'gc': 533809208,
2996
3004
            }
2997
 
        self.req_bin_0 = '\x3c\x00\x02\x00' '\x38\x48\xd1\x1f'
 
3005
        self.req_bin_0 = b'\x3c\x00\x02\x00' b'\x38\x48\xd1\x1f'
2998
3006
 
2999
3007
 
3000
3008
    def testPackRequest0(self):
3001
 
        bin = apply(request.FreeGC._request.to_binary, (), self.req_args_0)
 
3009
        bin = request.FreeGC._request.to_binary(*(), **self.req_args_0)
3002
3010
        try:
3003
3011
            assert bin == self.req_bin_0
3004
3012
        except AssertionError:
3026
3034
            'exposures': 0,
3027
3035
            'height': 27400,
3028
3036
            }
3029
 
        self.req_bin_0 = '\x3d\x00\x04\x00' '\xcc\x01\xe5\x1a' \
3030
 
            '\x61\x88\xdd\xe6' '\xd9\x61\x08\x6b'
 
3037
        self.req_bin_0 = b'\x3d\x00\x04\x00' b'\xcc\x01\xe5\x1a' \
 
3038
            b'\x61\x88\xdd\xe6' b'\xd9\x61\x08\x6b'
3031
3039
 
3032
3040
 
3033
3041
    def testPackRequest0(self):
3034
 
        bin = apply(request.ClearArea._request.to_binary, (), self.req_args_0)
 
3042
        bin = request.ClearArea._request.to_binary(*(), **self.req_args_0)
3035
3043
        try:
3036
3044
            assert bin == self.req_bin_0
3037
3045
        except AssertionError:
3062
3070
            'width': 46860,
3063
3071
            'src_drawable': 197047820,
3064
3072
            }
3065
 
        self.req_bin_0 = '\x3e\x00\x07\x00' '\x0c\xb6\xbe\x0b' \
3066
 
            '\xa6\x6a\x81\x5a' '\x46\x2c\x6e\x20' \
3067
 
            '\x7d\xc5\x9c\x9d' '\x03\xf3\x20\xd8' \
3068
 
            '\x0c\xb7\x01\xb7'
 
3073
        self.req_bin_0 = b'\x3e\x00\x07\x00' b'\x0c\xb6\xbe\x0b' \
 
3074
            b'\xa6\x6a\x81\x5a' b'\x46\x2c\x6e\x20' \
 
3075
            b'\x7d\xc5\x9c\x9d' b'\x03\xf3\x20\xd8' \
 
3076
            b'\x0c\xb7\x01\xb7'
3069
3077
 
3070
3078
 
3071
3079
    def testPackRequest0(self):
3072
 
        bin = apply(request.CopyArea._request.to_binary, (), self.req_args_0)
 
3080
        bin = request.CopyArea._request.to_binary(*(), **self.req_args_0)
3073
3081
        try:
3074
3082
            assert bin == self.req_bin_0
3075
3083
        except AssertionError:
3101
3109
            'width': 12445,
3102
3110
            'src_drawable': 1825271175,
3103
3111
            }
3104
 
        self.req_bin_0 = '\x3f\x00\x08\x00' '\x87\x6d\xcb\x6c' \
3105
 
            '\x2b\x09\x58\x25' '\x3c\xde\x31\x78' \
3106
 
            '\xc3\xc2\x29\xa0' '\x0f\xbc\x31\x9f' \
3107
 
            '\x9d\x30\x2c\x24' '\x82\x1b\x3a\x07'
 
3112
        self.req_bin_0 = b'\x3f\x00\x08\x00' b'\x87\x6d\xcb\x6c' \
 
3113
            b'\x2b\x09\x58\x25' b'\x3c\xde\x31\x78' \
 
3114
            b'\xc3\xc2\x29\xa0' b'\x0f\xbc\x31\x9f' \
 
3115
            b'\x9d\x30\x2c\x24' b'\x82\x1b\x3a\x07'
3108
3116
 
3109
3117
 
3110
3118
    def testPackRequest0(self):
3111
 
        bin = apply(request.CopyPlane._request.to_binary, (), self.req_args_0)
 
3119
        bin = request.CopyPlane._request.to_binary(*(), **self.req_args_0)
3112
3120
        try:
3113
3121
            assert bin == self.req_bin_0
3114
3122
        except AssertionError:
3134
3142
            'points': [{'y': -18047, 'x': -19763}, {'y': -5351, 'x': -20174}, {'y': -10573, 'x': -29362}],
3135
3143
            'gc': 1752128743,
3136
3144
            }
3137
 
        self.req_bin_0 = '\x40\x00\x06\x00' '\x2b\xdd\x32\x43' \
3138
 
            '\xe7\x5c\x6f\x68' '\xcd\xb2\x81\xb9' \
3139
 
            '\x32\xb1\x19\xeb' '\x4e\x8d\xb3\xd6'
 
3145
        self.req_bin_0 = b'\x40\x00\x06\x00' b'\x2b\xdd\x32\x43' \
 
3146
            b'\xe7\x5c\x6f\x68' b'\xcd\xb2\x81\xb9' \
 
3147
            b'\x32\xb1\x19\xeb' b'\x4e\x8d\xb3\xd6'
3140
3148
 
3141
3149
 
3142
3150
    def testPackRequest0(self):
3143
 
        bin = apply(request.PolyPoint._request.to_binary, (), self.req_args_0)
 
3151
        bin = request.PolyPoint._request.to_binary(*(), **self.req_args_0)
3144
3152
        try:
3145
3153
            assert bin == self.req_bin_0
3146
3154
        except AssertionError:
3166
3174
            'points': [{'y': -22360, 'x': -25237}, {'y': -21145, 'x': -28948}, {'y': -16928, 'x': -3515}, {'y': -25838, 'x': -12335}, {'y': -31134, 'x': -12944}],
3167
3175
            'gc': 1308624032,
3168
3176
            }
3169
 
        self.req_bin_0 = '\x41\x01\x08\x00' '\x3f\xf4\xc1\x50' \
3170
 
            '\xa0\x04\x00\x4e' '\x6b\x9d\xa8\xa8' \
3171
 
            '\xec\x8e\x67\xad' '\x45\xf2\xe0\xbd' \
3172
 
            '\xd1\xcf\x12\x9b' '\x70\xcd\x62\x86'
 
3177
        self.req_bin_0 = b'\x41\x01\x08\x00' b'\x3f\xf4\xc1\x50' \
 
3178
            b'\xa0\x04\x00\x4e' b'\x6b\x9d\xa8\xa8' \
 
3179
            b'\xec\x8e\x67\xad' b'\x45\xf2\xe0\xbd' \
 
3180
            b'\xd1\xcf\x12\x9b' b'\x70\xcd\x62\x86'
3173
3181
 
3174
3182
 
3175
3183
    def testPackRequest0(self):
3176
 
        bin = apply(request.PolyLine._request.to_binary, (), self.req_args_0)
 
3184
        bin = request.PolyLine._request.to_binary(*(), **self.req_args_0)
3177
3185
        try:
3178
3186
            assert bin == self.req_bin_0
3179
3187
        except AssertionError:
3198
3206
            'gc': 2022424938,
3199
3207
            'drawable': 158182613,
3200
3208
            }
3201
 
        self.req_bin_0 = '\x42\x00\x05\x00' '\xd5\xac\x6d\x09' \
3202
 
            '\x6a\xc1\x8b\x78' '\x37\xf7\xa8\xf3' \
3203
 
            '\xed\xeb\x08\x97'
 
3209
        self.req_bin_0 = b'\x42\x00\x05\x00' b'\xd5\xac\x6d\x09' \
 
3210
            b'\x6a\xc1\x8b\x78' b'\x37\xf7\xa8\xf3' \
 
3211
            b'\xed\xeb\x08\x97'
3204
3212
 
3205
3213
 
3206
3214
    def testPackRequest0(self):
3207
 
        bin = apply(request.PolySegment._request.to_binary, (), self.req_args_0)
 
3215
        bin = request.PolySegment._request.to_binary(*(), **self.req_args_0)
3208
3216
        try:
3209
3217
            assert bin == self.req_bin_0
3210
3218
        except AssertionError:
3229
3237
            'drawable': 2136753875,
3230
3238
            'rectangles': [{'y': -29358, 'x': -6957, 'height': 19230, 'width': 32377}, {'y': -23694, 'x': -2777, 'height': 48827, 'width': 42548}, {'y': -22773, 'x': -12641, 'height': 9809, 'width': 30955}],
3231
3239
            }
3232
 
        self.req_bin_0 = '\x43\x00\x09\x00' '\xd3\x46\x5c\x7f' \
3233
 
            '\x93\xd8\xc5\x3d' '\xd3\xe4\x52\x8d' \
3234
 
            '\x79\x7e\x1e\x4b' '\x27\xf5\x72\xa3' \
3235
 
            '\x34\xa6\xbb\xbe' '\x9f\xce\x0b\xa7' \
3236
 
            '\xeb\x78\x51\x26'
 
3240
        self.req_bin_0 = b'\x43\x00\x09\x00' b'\xd3\x46\x5c\x7f' \
 
3241
            b'\x93\xd8\xc5\x3d' b'\xd3\xe4\x52\x8d' \
 
3242
            b'\x79\x7e\x1e\x4b' b'\x27\xf5\x72\xa3' \
 
3243
            b'\x34\xa6\xbb\xbe' b'\x9f\xce\x0b\xa7' \
 
3244
            b'\xeb\x78\x51\x26'
3237
3245
 
3238
3246
 
3239
3247
    def testPackRequest0(self):
3240
 
        bin = apply(request.PolyRectangle._request.to_binary, (), self.req_args_0)
 
3248
        bin = request.PolyRectangle._request.to_binary(*(), **self.req_args_0)
3241
3249
        try:
3242
3250
            assert bin == self.req_bin_0
3243
3251
        except AssertionError:
3262
3270
            'gc': 956699423,
3263
3271
            'arcs': [{'width': 36714, 'angle1': -22260, 'angle2': -28493, 'y': -394, 'x': -6756, 'height': 63498}, {'width': 31212, 'angle1': -5166, 'angle2': -19039, 'y': -11179, 'x': -20569, 'height': 27113}, {'width': 62033, 'angle1': -18595, 'angle2': -26291, 'y': -8396, 'x': -7987, 'height': 11428}],
3264
3272
            }
3265
 
        self.req_bin_0 = '\x44\x00\x0c\x00' '\x96\x82\x2c\x7b' \
3266
 
            '\x1f\x13\x06\x39' '\x9c\xe5\x76\xfe' \
3267
 
            '\x6a\x8f\x0a\xf8' '\x0c\xa9\xb3\x90' \
3268
 
            '\xa7\xaf\x55\xd4' '\xec\x79\xe9\x69' \
3269
 
            '\xd2\xeb\xa1\xb5' '\xcd\xe0\x34\xdf' \
3270
 
            '\x51\xf2\xa4\x2c' '\x5d\xb7\x4d\x99'
 
3273
        self.req_bin_0 = b'\x44\x00\x0c\x00' b'\x96\x82\x2c\x7b' \
 
3274
            b'\x1f\x13\x06\x39' b'\x9c\xe5\x76\xfe' \
 
3275
            b'\x6a\x8f\x0a\xf8' b'\x0c\xa9\xb3\x90' \
 
3276
            b'\xa7\xaf\x55\xd4' b'\xec\x79\xe9\x69' \
 
3277
            b'\xd2\xeb\xa1\xb5' b'\xcd\xe0\x34\xdf' \
 
3278
            b'\x51\xf2\xa4\x2c' b'\x5d\xb7\x4d\x99'
3271
3279
 
3272
3280
 
3273
3281
    def testPackRequest0(self):
3274
 
        bin = apply(request.PolyArc._request.to_binary, (), self.req_args_0)
 
3282
        bin = request.PolyArc._request.to_binary(*(), **self.req_args_0)
3275
3283
        try:
3276
3284
            assert bin == self.req_bin_0
3277
3285
        except AssertionError:
3298
3306
            'gc': 112110920,
3299
3307
            'shape': 0,
3300
3308
            }
3301
 
        self.req_bin_0 = '\x45\x00\x07\x00' '\x96\x94\x65\x1f' \
3302
 
            '\x48\xad\xae\x06' '\x00\x01\x00\x00' \
3303
 
            '\xd3\xd1\x03\xfd' '\x8d\xf8\x9b\xd5' \
3304
 
            '\x2c\xfe\xf2\x8b'
 
3309
        self.req_bin_0 = b'\x45\x00\x07\x00' b'\x96\x94\x65\x1f' \
 
3310
            b'\x48\xad\xae\x06' b'\x00\x01\x00\x00' \
 
3311
            b'\xd3\xd1\x03\xfd' b'\x8d\xf8\x9b\xd5' \
 
3312
            b'\x2c\xfe\xf2\x8b'
3305
3313
 
3306
3314
 
3307
3315
    def testPackRequest0(self):
3308
 
        bin = apply(request.FillPoly._request.to_binary, (), self.req_args_0)
 
3316
        bin = request.FillPoly._request.to_binary(*(), **self.req_args_0)
3309
3317
        try:
3310
3318
            assert bin == self.req_bin_0
3311
3319
        except AssertionError:
3330
3338
            'drawable': 878946804,
3331
3339
            'rectangles': [{'y': -29169, 'x': -18095, 'height': 15301, 'width': 12078}, {'y': -7148, 'x': -18997, 'height': 7501, 'width': 17120}],
3332
3340
            }
3333
 
        self.req_bin_0 = '\x46\x00\x07\x00' '\xf4\xa9\x63\x34' \
3334
 
            '\x64\x38\xf1\x1b' '\x51\xb9\x0f\x8e' \
3335
 
            '\x2e\x2f\xc5\x3b' '\xcb\xb5\x14\xe4' \
3336
 
            '\xe0\x42\x4d\x1d'
 
3341
        self.req_bin_0 = b'\x46\x00\x07\x00' b'\xf4\xa9\x63\x34' \
 
3342
            b'\x64\x38\xf1\x1b' b'\x51\xb9\x0f\x8e' \
 
3343
            b'\x2e\x2f\xc5\x3b' b'\xcb\xb5\x14\xe4' \
 
3344
            b'\xe0\x42\x4d\x1d'
3337
3345
 
3338
3346
 
3339
3347
    def testPackRequest0(self):
3340
 
        bin = apply(request.PolyFillRectangle._request.to_binary, (), self.req_args_0)
 
3348
        bin = request.PolyFillRectangle._request.to_binary(*(), **self.req_args_0)
3341
3349
        try:
3342
3350
            assert bin == self.req_bin_0
3343
3351
        except AssertionError:
3362
3370
            'gc': 1256983120,
3363
3371
            'arcs': [{'width': 62526, 'angle1': -17496, 'angle2': -20949, 'y': -21843, 'x': -31746, 'height': 59073}],
3364
3372
            }
3365
 
        self.req_bin_0 = '\x47\x00\x06\x00' '\x34\xfa\xab\x4c' \
3366
 
            '\x50\x0a\xec\x4a' '\xfe\x83\xad\xaa' \
3367
 
            '\x3e\xf4\xc1\xe6' '\xa8\xbb\x2b\xae'
 
3373
        self.req_bin_0 = b'\x47\x00\x06\x00' b'\x34\xfa\xab\x4c' \
 
3374
            b'\x50\x0a\xec\x4a' b'\xfe\x83\xad\xaa' \
 
3375
            b'\x3e\xf4\xc1\xe6' b'\xa8\xbb\x2b\xae'
3368
3376
 
3369
3377
 
3370
3378
    def testPackRequest0(self):
3371
 
        bin = apply(request.PolyFillArc._request.to_binary, (), self.req_args_0)
 
3379
        bin = request.PolyFillArc._request.to_binary(*(), **self.req_args_0)
3372
3380
        try:
3373
3381
            assert bin == self.req_bin_0
3374
3382
        except AssertionError:
3400
3408
            'depth': 218,
3401
3409
            'height': 16464,
3402
3410
            }
3403
 
        self.req_bin_0 = '\x48\x02\x09\x00' '\x1e\xd0\xc5\x37' \
3404
 
            '\x3d\xb4\xbf\x6e' '\x58\x9a\x50\x40' \
3405
 
            '\x1b\xdc\xc8\xb6' '\xde\xda\x00\x00' \
3406
 
            '\x62\x69\x74\x20' '\x6d\x61\x70\x20' \
3407
 
            '\x64\x61\x74\x61'
 
3411
        self.req_bin_0 = b'\x48\x02\x09\x00' b'\x1e\xd0\xc5\x37' \
 
3412
            b'\x3d\xb4\xbf\x6e' b'\x58\x9a\x50\x40' \
 
3413
            b'\x1b\xdc\xc8\xb6' b'\xde\xda\x00\x00' \
 
3414
            b'\x62\x69\x74\x20' b'\x6d\x61\x70\x20' \
 
3415
            b'\x64\x61\x74\x61'
3408
3416
 
3409
3417
 
3410
3418
    def testPackRequest0(self):
3411
 
        bin = apply(request.PutImage._request.to_binary, (), self.req_args_0)
 
3419
        bin = request.PutImage._request.to_binary(*(), **self.req_args_0)
3412
3420
        try:
3413
3421
            assert bin == self.req_bin_0
3414
3422
        except AssertionError:
3437
3445
            'plane_mask': 849117586,
3438
3446
            'height': 24480,
3439
3447
            }
3440
 
        self.req_bin_0 = '\x49\x01\x05\x00' '\x87\xf9\x81\x16' \
3441
 
            '\x3f\x80\x7c\xf5' '\x49\xba\xa0\x5f' \
3442
 
            '\x92\x81\x9c\x32'
 
3448
        self.req_bin_0 = b'\x49\x01\x05\x00' b'\x87\xf9\x81\x16' \
 
3449
            b'\x3f\x80\x7c\xf5' b'\x49\xba\xa0\x5f' \
 
3450
            b'\x92\x81\x9c\x32'
3443
3451
 
3444
3452
        self.reply_args_0 = {
3445
3453
            'depth': 249,
3447
3455
            'visual': 141686402,
3448
3456
            'sequence_number': 47197,
3449
3457
            }
3450
 
        self.reply_bin_0 = '\x01\xf9\x5d\xb8' '\x07\x00\x00\x00' \
3451
 
            '\x82\xf6\x71\x08' '\x00\x00\x00\x00' \
3452
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
3453
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
3454
 
            '\x74\x68\x69\x73' '\x20\x69\x73\x20' \
3455
 
            '\x72\x65\x61\x6c' '\x20\x6c\x79\x20' \
3456
 
            '\x69\x6d\x61\x67' '\x20\x65\x20\x62' \
3457
 
            '\x2d\x6d\x61\x70'
 
3458
        self.reply_bin_0 = b'\x01\xf9\x5d\xb8' b'\x07\x00\x00\x00' \
 
3459
            b'\x82\xf6\x71\x08' b'\x00\x00\x00\x00' \
 
3460
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
3461
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
3462
            b'\x74\x68\x69\x73' b'\x20\x69\x73\x20' \
 
3463
            b'\x72\x65\x61\x6c' b'\x20\x6c\x79\x20' \
 
3464
            b'\x69\x6d\x61\x67' b'\x20\x65\x20\x62' \
 
3465
            b'\x2d\x6d\x61\x70'
3458
3466
 
3459
3467
 
3460
3468
    def testPackRequest0(self):
3461
 
        bin = apply(request.GetImage._request.to_binary, (), self.req_args_0)
 
3469
        bin = request.GetImage._request.to_binary(*(), **self.req_args_0)
3462
3470
        try:
3463
3471
            assert bin == self.req_bin_0
3464
3472
        except AssertionError:
3476
3484
            raise AssertionError(args)
3477
3485
 
3478
3486
    def testPackReply0(self):
3479
 
        bin = apply(request.GetImage._reply.to_binary, (), self.reply_args_0)
 
3487
        bin = request.GetImage._reply.to_binary(*(), **self.reply_args_0)
3480
3488
        try:
3481
3489
            assert bin == self.reply_bin_0
3482
3490
        except AssertionError:
3503
3511
            'gc': 1348241590,
3504
3512
            'x': -27139,
3505
3513
            }
3506
 
        self.req_bin_0 = '\x4a\x00\x08\x00' '\x18\x69\x7f\x67' \
3507
 
            '\xb6\x88\x5c\x50' '\xfd\x95\x84\xe4' \
3508
 
            '\x03\x02\x7a\x6f' '\x6f\xff\x01\x02' \
3509
 
            '\x03\x04\x02\x00' '\x69\x65\x00\x00'
 
3514
        self.req_bin_0 = b'\x4a\x00\x08\x00' b'\x18\x69\x7f\x67' \
 
3515
            b'\xb6\x88\x5c\x50' b'\xfd\x95\x84\xe4' \
 
3516
            b'\x03\x02\x7a\x6f' b'\x6f\xff\x01\x02' \
 
3517
            b'\x03\x04\x02\x00' b'\x69\x65\x00\x00'
3510
3518
 
3511
3519
 
3512
3520
    def testPackRequest0(self):
3513
 
        bin = apply(request.PolyText8._request.to_binary, (), self.req_args_0)
 
3521
        bin = request.PolyText8._request.to_binary(*(), **self.req_args_0)
3514
3522
        try:
3515
3523
            assert bin == self.req_bin_0
3516
3524
        except AssertionError:
3537
3545
            'gc': 327278878,
3538
3546
            'x': -31319,
3539
3547
            }
3540
 
        self.req_bin_0 = '\x4b\x00\x07\x00' '\x50\x96\x80\x63' \
3541
 
            '\x1e\xe1\x81\x13' '\xa9\x85\xd9\xd6' \
3542
 
            '\x02\x02\x10\x23' '\x00\x12\xff\x01' \
3543
 
            '\x02\x03\x04\x00'
 
3548
        self.req_bin_0 = b'\x4b\x00\x07\x00' b'\x50\x96\x80\x63' \
 
3549
            b'\x1e\xe1\x81\x13' b'\xa9\x85\xd9\xd6' \
 
3550
            b'\x02\x02\x10\x23' b'\x00\x12\xff\x01' \
 
3551
            b'\x02\x03\x04\x00'
3544
3552
 
3545
3553
 
3546
3554
    def testPackRequest0(self):
3547
 
        bin = apply(request.PolyText16._request.to_binary, (), self.req_args_0)
 
3555
        bin = request.PolyText16._request.to_binary(*(), **self.req_args_0)
3548
3556
        try:
3549
3557
            assert bin == self.req_bin_0
3550
3558
        except AssertionError:
3571
3579
            'gc': 581816261,
3572
3580
            'string': 'showme',
3573
3581
            }
3574
 
        self.req_bin_0 = '\x4c\x06\x06\x00' '\x50\xb6\x0d\x7f' \
3575
 
            '\xc5\xcf\xad\x22' '\xd3\xc4\x71\xf1' \
3576
 
            '\x73\x68\x6f\x77' '\x6d\x65\x00\x00'
 
3582
        self.req_bin_0 = b'\x4c\x06\x06\x00' b'\x50\xb6\x0d\x7f' \
 
3583
            b'\xc5\xcf\xad\x22' b'\xd3\xc4\x71\xf1' \
 
3584
            b'\x73\x68\x6f\x77' b'\x6d\x65\x00\x00'
3577
3585
 
3578
3586
 
3579
3587
    def testPackRequest0(self):
3580
 
        bin = apply(request.ImageText8._request.to_binary, (), self.req_args_0)
 
3588
        bin = request.ImageText8._request.to_binary(*(), **self.req_args_0)
3581
3589
        try:
3582
3590
            assert bin == self.req_bin_0
3583
3591
        except AssertionError:
3604
3612
            'gc': 145495998,
3605
3613
            'string': (115, 104, 111, 119, 109, 111, 114, 101),
3606
3614
            }
3607
 
        self.req_bin_0 = '\x4d\x08\x08\x00' '\x96\xa8\xff\x55' \
3608
 
            '\xbe\x17\xac\x08' '\xe1\xf4\xce\xfb' \
3609
 
            '\x00\x73\x00\x68' '\x00\x6f\x00\x77' \
3610
 
            '\x00\x6d\x00\x6f' '\x00\x72\x00\x65'
 
3615
        self.req_bin_0 = b'\x4d\x08\x08\x00' b'\x96\xa8\xff\x55' \
 
3616
            b'\xbe\x17\xac\x08' b'\xe1\xf4\xce\xfb' \
 
3617
            b'\x00\x73\x00\x68' b'\x00\x6f\x00\x77' \
 
3618
            b'\x00\x6d\x00\x6f' b'\x00\x72\x00\x65'
3611
3619
 
3612
3620
 
3613
3621
    def testPackRequest0(self):
3614
 
        bin = apply(request.ImageText16._request.to_binary, (), self.req_args_0)
 
3622
        bin = request.ImageText16._request.to_binary(*(), **self.req_args_0)
3615
3623
        try:
3616
3624
            assert bin == self.req_bin_0
3617
3625
        except AssertionError:
3637
3645
            'visual': 1165319270,
3638
3646
            'mid': 1982619692,
3639
3647
            }
3640
 
        self.req_bin_0 = '\x4e\x00\x04\x00' '\x2c\x60\x2c\x76' \
3641
 
            '\xc5\x34\xa3\x52' '\x66\x5c\x75\x45'
 
3648
        self.req_bin_0 = b'\x4e\x00\x04\x00' b'\x2c\x60\x2c\x76' \
 
3649
            b'\xc5\x34\xa3\x52' b'\x66\x5c\x75\x45'
3642
3650
 
3643
3651
 
3644
3652
    def testPackRequest0(self):
3645
 
        bin = apply(request.CreateColormap._request.to_binary, (), self.req_args_0)
 
3653
        bin = request.CreateColormap._request.to_binary(*(), **self.req_args_0)
3646
3654
        try:
3647
3655
            assert bin == self.req_bin_0
3648
3656
        except AssertionError:
3665
3673
        self.req_args_0 = {
3666
3674
            'cmap': 1948229362,
3667
3675
            }
3668
 
        self.req_bin_0 = '\x4f\x00\x02\x00' '\xf2\x9e\x1f\x74'
 
3676
        self.req_bin_0 = b'\x4f\x00\x02\x00' b'\xf2\x9e\x1f\x74'
3669
3677
 
3670
3678
 
3671
3679
    def testPackRequest0(self):
3672
 
        bin = apply(request.FreeColormap._request.to_binary, (), self.req_args_0)
 
3680
        bin = request.FreeColormap._request.to_binary(*(), **self.req_args_0)
3673
3681
        try:
3674
3682
            assert bin == self.req_bin_0
3675
3683
        except AssertionError:
3693
3701
            'src_cmap': 836376231,
3694
3702
            'mid': 1781544437,
3695
3703
            }
3696
 
        self.req_bin_0 = '\x50\x00\x03\x00' '\xf5\x35\x30\x6a' \
3697
 
            '\xa7\x16\xda\x31'
 
3704
        self.req_bin_0 = b'\x50\x00\x03\x00' b'\xf5\x35\x30\x6a' \
 
3705
            b'\xa7\x16\xda\x31'
3698
3706
 
3699
3707
 
3700
3708
    def testPackRequest0(self):
3701
 
        bin = apply(request.CopyColormapAndFree._request.to_binary, (), self.req_args_0)
 
3709
        bin = request.CopyColormapAndFree._request.to_binary(*(), **self.req_args_0)
3702
3710
        try:
3703
3711
            assert bin == self.req_bin_0
3704
3712
        except AssertionError:
3721
3729
        self.req_args_0 = {
3722
3730
            'cmap': 1065317214,
3723
3731
            }
3724
 
        self.req_bin_0 = '\x51\x00\x02\x00' '\x5e\x73\x7f\x3f'
 
3732
        self.req_bin_0 = b'\x51\x00\x02\x00' b'\x5e\x73\x7f\x3f'
3725
3733
 
3726
3734
 
3727
3735
    def testPackRequest0(self):
3728
 
        bin = apply(request.InstallColormap._request.to_binary, (), self.req_args_0)
 
3736
        bin = request.InstallColormap._request.to_binary(*(), **self.req_args_0)
3729
3737
        try:
3730
3738
            assert bin == self.req_bin_0
3731
3739
        except AssertionError:
3748
3756
        self.req_args_0 = {
3749
3757
            'cmap': 1636916558,
3750
3758
            }
3751
 
        self.req_bin_0 = '\x52\x00\x02\x00' '\x4e\x5d\x91\x61'
 
3759
        self.req_bin_0 = b'\x52\x00\x02\x00' b'\x4e\x5d\x91\x61'
3752
3760
 
3753
3761
 
3754
3762
    def testPackRequest0(self):
3755
 
        bin = apply(request.UninstallColormap._request.to_binary, (), self.req_args_0)
 
3763
        bin = request.UninstallColormap._request.to_binary(*(), **self.req_args_0)
3756
3764
        try:
3757
3765
            assert bin == self.req_bin_0
3758
3766
        except AssertionError:
3775
3783
        self.req_args_0 = {
3776
3784
            'window': 198767900,
3777
3785
            }
3778
 
        self.req_bin_0 = '\x53\x00\x02\x00' '\x1c\xf5\xd8\x0b'
 
3786
        self.req_bin_0 = b'\x53\x00\x02\x00' b'\x1c\xf5\xd8\x0b'
3779
3787
 
3780
3788
        self.reply_args_0 = {
3781
3789
            'cmaps': [6854304, 441133660],
3782
3790
            'sequence_number': 56438,
3783
3791
            }
3784
 
        self.reply_bin_0 = '\x01\x00\x76\xdc' '\x02\x00\x00\x00' \
3785
 
            '\x02\x00\x00\x00' '\x00\x00\x00\x00' \
3786
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
3787
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
3788
 
            '\xa0\x96\x68\x00' '\x5c\x2a\x4b\x1a'
 
3792
        self.reply_bin_0 = b'\x01\x00\x76\xdc' b'\x02\x00\x00\x00' \
 
3793
            b'\x02\x00\x00\x00' b'\x00\x00\x00\x00' \
 
3794
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
3795
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
3796
            b'\xa0\x96\x68\x00' b'\x5c\x2a\x4b\x1a'
3789
3797
 
3790
3798
 
3791
3799
    def testPackRequest0(self):
3792
 
        bin = apply(request.ListInstalledColormaps._request.to_binary, (), self.req_args_0)
 
3800
        bin = request.ListInstalledColormaps._request.to_binary(*(), **self.req_args_0)
3793
3801
        try:
3794
3802
            assert bin == self.req_bin_0
3795
3803
        except AssertionError:
3807
3815
            raise AssertionError(args)
3808
3816
 
3809
3817
    def testPackReply0(self):
3810
 
        bin = apply(request.ListInstalledColormaps._reply.to_binary, (), self.reply_args_0)
 
3818
        bin = request.ListInstalledColormaps._reply.to_binary(*(), **self.reply_args_0)
3811
3819
        try:
3812
3820
            assert bin == self.reply_bin_0
3813
3821
        except AssertionError:
3833
3841
            'green': 61383,
3834
3842
            'red': 8870,
3835
3843
            }
3836
 
        self.req_bin_0 = '\x54\x00\x04\x00' '\xdf\x36\xda\x69' \
3837
 
            '\xa6\x22\xc7\xef' '\x24\xe2\x00\x00'
 
3844
        self.req_bin_0 = b'\x54\x00\x04\x00' b'\xdf\x36\xda\x69' \
 
3845
            b'\xa6\x22\xc7\xef' b'\x24\xe2\x00\x00'
3838
3846
 
3839
3847
        self.reply_args_0 = {
3840
3848
            'blue': 22111,
3843
3851
            'sequence_number': 52666,
3844
3852
            'pixel': 1186287049,
3845
3853
            }
3846
 
        self.reply_bin_0 = '\x01\x00\xba\xcd' '\x00\x00\x00\x00' \
3847
 
            '\x61\xd4\x90\x6b' '\x5f\x56\x00\x00' \
3848
 
            '\xc9\x4d\xb5\x46' '\x00\x00\x00\x00' \
3849
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
3854
        self.reply_bin_0 = b'\x01\x00\xba\xcd' b'\x00\x00\x00\x00' \
 
3855
            b'\x61\xd4\x90\x6b' b'\x5f\x56\x00\x00' \
 
3856
            b'\xc9\x4d\xb5\x46' b'\x00\x00\x00\x00' \
 
3857
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
3850
3858
 
3851
3859
 
3852
3860
    def testPackRequest0(self):
3853
 
        bin = apply(request.AllocColor._request.to_binary, (), self.req_args_0)
 
3861
        bin = request.AllocColor._request.to_binary(*(), **self.req_args_0)
3854
3862
        try:
3855
3863
            assert bin == self.req_bin_0
3856
3864
        except AssertionError:
3868
3876
            raise AssertionError(args)
3869
3877
 
3870
3878
    def testPackReply0(self):
3871
 
        bin = apply(request.AllocColor._reply.to_binary, (), self.reply_args_0)
 
3879
        bin = request.AllocColor._reply.to_binary(*(), **self.reply_args_0)
3872
3880
        try:
3873
3881
            assert bin == self.reply_bin_0
3874
3882
        except AssertionError:
3892
3900
            'cmap': 695059054,
3893
3901
            'name': 'octarin',
3894
3902
            }
3895
 
        self.req_bin_0 = '\x55\x00\x05\x00' '\x6e\xc2\x6d\x29' \
3896
 
            '\x07\x00\x00\x00' '\x6f\x63\x74\x61' \
3897
 
            '\x72\x69\x6e\x00'
 
3903
        self.req_bin_0 = b'\x55\x00\x05\x00' b'\x6e\xc2\x6d\x29' \
 
3904
            b'\x07\x00\x00\x00' b'\x6f\x63\x74\x61' \
 
3905
            b'\x72\x69\x6e\x00'
3898
3906
 
3899
3907
        self.reply_args_0 = {
3900
3908
            'exact_red': 45174,
3906
3914
            'sequence_number': 38835,
3907
3915
            'pixel': 580415589,
3908
3916
            }
3909
 
        self.reply_bin_0 = '\x01\x00\xb3\x97' '\x00\x00\x00\x00' \
3910
 
            '\x65\x70\x98\x22' '\x76\xb0\xca\xaf' \
3911
 
            '\xa3\xda\x51\xec' '\x6b\xbb\xd6\x54' \
3912
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
3917
        self.reply_bin_0 = b'\x01\x00\xb3\x97' b'\x00\x00\x00\x00' \
 
3918
            b'\x65\x70\x98\x22' b'\x76\xb0\xca\xaf' \
 
3919
            b'\xa3\xda\x51\xec' b'\x6b\xbb\xd6\x54' \
 
3920
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
3913
3921
 
3914
3922
 
3915
3923
    def testPackRequest0(self):
3916
 
        bin = apply(request.AllocNamedColor._request.to_binary, (), self.req_args_0)
 
3924
        bin = request.AllocNamedColor._request.to_binary(*(), **self.req_args_0)
3917
3925
        try:
3918
3926
            assert bin == self.req_bin_0
3919
3927
        except AssertionError:
3931
3939
            raise AssertionError(args)
3932
3940
 
3933
3941
    def testPackReply0(self):
3934
 
        bin = apply(request.AllocNamedColor._reply.to_binary, (), self.reply_args_0)
 
3942
        bin = request.AllocNamedColor._reply.to_binary(*(), **self.reply_args_0)
3935
3943
        try:
3936
3944
            assert bin == self.reply_bin_0
3937
3945
        except AssertionError:
3957
3965
            'colors': 16292,
3958
3966
            'planes': 14978,
3959
3967
            }
3960
 
        self.req_bin_0 = '\x56\x01\x03\x00' '\xb5\xe9\x73\x7b' \
3961
 
            '\xa4\x3f\x82\x3a'
 
3968
        self.req_bin_0 = b'\x56\x01\x03\x00' b'\xb5\xe9\x73\x7b' \
 
3969
            b'\xa4\x3f\x82\x3a'
3962
3970
 
3963
3971
        self.reply_args_0 = {
3964
3972
            'pixels': [1664874569, 198876857, 135035151, 1499807858, 600240169, 1403510863, 757170725, 929995606, 155550883, 642439566, 971734621, 1359474267, 609593319, 669993327, 1837906914, 1355959290, 835285748],
3965
3973
            'masks': [50898278, 362272940, 1106373487],
3966
3974
            'sequence_number': 57786,
3967
3975
            }
3968
 
        self.reply_bin_0 = '\x01\x00\xba\xe1' '\x14\x00\x00\x00' \
3969
 
            '\x11\x00\x03\x00' '\x00\x00\x00\x00' \
3970
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
3971
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
3972
 
            '\x49\xf8\x3b\x63' '\xb9\x9e\xda\x0b' \
3973
 
            '\x0f\x79\x0c\x08' '\x72\x40\x65\x59' \
3974
 
            '\x29\xf0\xc6\x23' '\x4f\xe0\xa7\x53' \
3975
 
            '\x25\x82\x21\x2d' '\x56\x9b\x6e\x37' \
3976
 
            '\xa3\x84\x45\x09' '\x8e\xd9\x4a\x26' \
3977
 
            '\x5d\x7e\xeb\x39' '\x5b\xee\x07\x51' \
3978
 
            '\xe7\xa7\x55\x24' '\x6f\x49\xef\x27' \
3979
 
            '\xe2\x3b\x8c\x6d' '\xfa\x4b\xd2\x50' \
3980
 
            '\xf4\x72\xc9\x31' '\x66\xa5\x08\x03' \
3981
 
            '\xac\xd8\x97\x15' '\x6f\xeb\xf1\x41'
 
3976
        self.reply_bin_0 = b'\x01\x00\xba\xe1' b'\x14\x00\x00\x00' \
 
3977
            b'\x11\x00\x03\x00' b'\x00\x00\x00\x00' \
 
3978
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
3979
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
3980
            b'\x49\xf8\x3b\x63' b'\xb9\x9e\xda\x0b' \
 
3981
            b'\x0f\x79\x0c\x08' b'\x72\x40\x65\x59' \
 
3982
            b'\x29\xf0\xc6\x23' b'\x4f\xe0\xa7\x53' \
 
3983
            b'\x25\x82\x21\x2d' b'\x56\x9b\x6e\x37' \
 
3984
            b'\xa3\x84\x45\x09' b'\x8e\xd9\x4a\x26' \
 
3985
            b'\x5d\x7e\xeb\x39' b'\x5b\xee\x07\x51' \
 
3986
            b'\xe7\xa7\x55\x24' b'\x6f\x49\xef\x27' \
 
3987
            b'\xe2\x3b\x8c\x6d' b'\xfa\x4b\xd2\x50' \
 
3988
            b'\xf4\x72\xc9\x31' b'\x66\xa5\x08\x03' \
 
3989
            b'\xac\xd8\x97\x15' b'\x6f\xeb\xf1\x41'
3982
3990
 
3983
3991
        self.reply_args_1 = {
3984
3992
            'pixels': [],
3985
3993
            'masks': [],
3986
3994
            'sequence_number': 49324,
3987
3995
            }
3988
 
        self.reply_bin_1 = '\x01\x00\xac\xc0' '\x00\x00\x00\x00' \
3989
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
3990
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
3991
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
3996
        self.reply_bin_1 = b'\x01\x00\xac\xc0' b'\x00\x00\x00\x00' \
 
3997
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
3998
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
3999
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
3992
4000
 
3993
4001
 
3994
4002
    def testPackRequest0(self):
3995
 
        bin = apply(request.AllocColorCells._request.to_binary, (), self.req_args_0)
 
4003
        bin = request.AllocColorCells._request.to_binary(*(), **self.req_args_0)
3996
4004
        try:
3997
4005
            assert bin == self.req_bin_0
3998
4006
        except AssertionError:
4010
4018
            raise AssertionError(args)
4011
4019
 
4012
4020
    def testPackReply0(self):
4013
 
        bin = apply(request.AllocColorCells._reply.to_binary, (), self.reply_args_0)
 
4021
        bin = request.AllocColorCells._reply.to_binary(*(), **self.reply_args_0)
4014
4022
        try:
4015
4023
            assert bin == self.reply_bin_0
4016
4024
        except AssertionError:
4028
4036
            raise AssertionError(args)
4029
4037
 
4030
4038
    def testPackReply1(self):
4031
 
        bin = apply(request.AllocColorCells._reply.to_binary, (), self.reply_args_1)
 
4039
        bin = request.AllocColorCells._reply.to_binary(*(), **self.reply_args_1)
4032
4040
        try:
4033
4041
            assert bin == self.reply_bin_1
4034
4042
        except AssertionError:
4056
4064
            'contiguous': 1,
4057
4065
            'red': 37700,
4058
4066
            }
4059
 
        self.req_bin_0 = '\x57\x01\x04\x00' '\xd7\xef\xa3\x7d' \
4060
 
            '\x7f\x2e\x44\x93' '\xfe\x83\xc1\x85'
 
4067
        self.req_bin_0 = b'\x57\x01\x04\x00' b'\xd7\xef\xa3\x7d' \
 
4068
            b'\x7f\x2e\x44\x93' b'\xfe\x83\xc1\x85'
4061
4069
 
4062
4070
        self.reply_args_0 = {
4063
4071
            'red_mask': 931105404,
4066
4074
            'sequence_number': 17565,
4067
4075
            'green_mask': 1072565720,
4068
4076
            }
4069
 
        self.reply_bin_0 = '\x01\x00\x9d\x44' '\x04\x00\x00\x00' \
4070
 
            '\x04\x00\x00\x00' '\x7c\x8a\x7f\x37' \
4071
 
            '\xd8\x0d\xee\x3f' '\x22\x6f\x22\x34' \
4072
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
4073
 
            '\xc1\x6a\xe4\x63' '\x4c\x82\xa2\x4a' \
4074
 
            '\x37\x09\x41\x02' '\x4a\xdf\xc6\x57'
 
4077
        self.reply_bin_0 = b'\x01\x00\x9d\x44' b'\x04\x00\x00\x00' \
 
4078
            b'\x04\x00\x00\x00' b'\x7c\x8a\x7f\x37' \
 
4079
            b'\xd8\x0d\xee\x3f' b'\x22\x6f\x22\x34' \
 
4080
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
4081
            b'\xc1\x6a\xe4\x63' b'\x4c\x82\xa2\x4a' \
 
4082
            b'\x37\x09\x41\x02' b'\x4a\xdf\xc6\x57'
4075
4083
 
4076
4084
 
4077
4085
    def testPackRequest0(self):
4078
 
        bin = apply(request.AllocColorPlanes._request.to_binary, (), self.req_args_0)
 
4086
        bin = request.AllocColorPlanes._request.to_binary(*(), **self.req_args_0)
4079
4087
        try:
4080
4088
            assert bin == self.req_bin_0
4081
4089
        except AssertionError:
4093
4101
            raise AssertionError(args)
4094
4102
 
4095
4103
    def testPackReply0(self):
4096
 
        bin = apply(request.AllocColorPlanes._reply.to_binary, (), self.reply_args_0)
 
4104
        bin = request.AllocColorPlanes._reply.to_binary(*(), **self.reply_args_0)
4097
4105
        try:
4098
4106
            assert bin == self.reply_bin_0
4099
4107
        except AssertionError:
4118
4126
            'plane_mask': 1074378407,
4119
4127
            'pixels': [2014216051, 1664038241, 1220941033, 1378294408, 197757808, 793595544, 1289781247, 713684847, 1724469541, 1432124373, 1426727603, 1787792301, 406458839, 1918513211, 441394489, 988895943, 146997744],
4120
4128
            }
4121
 
        self.req_bin_0 = '\x58\x00\x14\x00' '\x1e\xdf\xf2\x01' \
4122
 
            '\xa7\xb6\x09\x40' '\x73\x7f\x0e\x78' \
4123
 
            '\x61\x35\x2f\x63' '\xe9\x14\xc6\x48' \
4124
 
            '\x88\x1a\x27\x52' '\x70\x8b\xc9\x0b' \
4125
 
            '\x98\x4e\x4d\x2f' '\xff\x7f\xe0\x4c' \
4126
 
            '\x6f\xf7\x89\x2a' '\x25\x51\xc9\x66' \
4127
 
            '\xd5\x7b\x5c\x55' '\xb3\x22\x0a\x55' \
4128
 
            '\xad\x8b\x8f\x6a' '\xd7\x11\x3a\x18' \
4129
 
            '\x3b\x30\x5a\x72' '\x39\x25\x4f\x1a' \
4130
 
            '\xc7\x5a\xf1\x3a' '\xf0\x01\xc3\x08'
 
4129
        self.req_bin_0 = b'\x58\x00\x14\x00' b'\x1e\xdf\xf2\x01' \
 
4130
            b'\xa7\xb6\x09\x40' b'\x73\x7f\x0e\x78' \
 
4131
            b'\x61\x35\x2f\x63' b'\xe9\x14\xc6\x48' \
 
4132
            b'\x88\x1a\x27\x52' b'\x70\x8b\xc9\x0b' \
 
4133
            b'\x98\x4e\x4d\x2f' b'\xff\x7f\xe0\x4c' \
 
4134
            b'\x6f\xf7\x89\x2a' b'\x25\x51\xc9\x66' \
 
4135
            b'\xd5\x7b\x5c\x55' b'\xb3\x22\x0a\x55' \
 
4136
            b'\xad\x8b\x8f\x6a' b'\xd7\x11\x3a\x18' \
 
4137
            b'\x3b\x30\x5a\x72' b'\x39\x25\x4f\x1a' \
 
4138
            b'\xc7\x5a\xf1\x3a' b'\xf0\x01\xc3\x08'
4131
4139
 
4132
4140
 
4133
4141
    def testPackRequest0(self):
4134
 
        bin = apply(request.FreeColors._request.to_binary, (), self.req_args_0)
 
4142
        bin = request.FreeColors._request.to_binary(*(), **self.req_args_0)
4135
4143
        try:
4136
4144
            assert bin == self.req_bin_0
4137
4145
        except AssertionError:
4155
4163
            'items': [{'blue': 3577, 'flags': 221, 'green': 15650, 'pixel': 330879354, 'red': 30294}, {'blue': 18226, 'flags': 219, 'green': 45614, 'pixel': 302874221, 'red': 54265}, {'blue': 32215, 'flags': 160, 'green': 48737, 'pixel': 1699694808, 'red': 60115}, {'blue': 28524, 'flags': 209, 'green': 37615, 'pixel': 710550693, 'red': 50488}],
4156
4164
            'cmap': 1791140577,
4157
4165
            }
4158
 
        self.req_bin_0 = '\x59\x00\x0e\x00' '\xe1\xa2\xc2\x6a' \
4159
 
            '\x7a\xd1\xb8\x13' '\x56\x76\x22\x3d' \
4160
 
            '\xf9\x0d\xdd\x00' '\x6d\x7e\x0d\x12' \
4161
 
            '\xf9\xd3\x2e\xb2' '\x32\x47\xdb\x00' \
4162
 
            '\xd8\x48\x4f\x65' '\xd3\xea\x61\xbe' \
4163
 
            '\xd7\x7d\xa0\x00' '\xa5\x24\x5a\x2a' \
4164
 
            '\x38\xc5\xef\x92' '\x6c\x6f\xd1\x00'
 
4166
        self.req_bin_0 = b'\x59\x00\x0e\x00' b'\xe1\xa2\xc2\x6a' \
 
4167
            b'\x7a\xd1\xb8\x13' b'\x56\x76\x22\x3d' \
 
4168
            b'\xf9\x0d\xdd\x00' b'\x6d\x7e\x0d\x12' \
 
4169
            b'\xf9\xd3\x2e\xb2' b'\x32\x47\xdb\x00' \
 
4170
            b'\xd8\x48\x4f\x65' b'\xd3\xea\x61\xbe' \
 
4171
            b'\xd7\x7d\xa0\x00' b'\xa5\x24\x5a\x2a' \
 
4172
            b'\x38\xc5\xef\x92' b'\x6c\x6f\xd1\x00'
4165
4173
 
4166
4174
 
4167
4175
    def testPackRequest0(self):
4168
 
        bin = apply(request.StoreColors._request.to_binary, (), self.req_args_0)
 
4176
        bin = request.StoreColors._request.to_binary(*(), **self.req_args_0)
4169
4177
        try:
4170
4178
            assert bin == self.req_bin_0
4171
4179
        except AssertionError:
4191
4199
            'name': 'blue',
4192
4200
            'pixel': 413175613,
4193
4201
            }
4194
 
        self.req_bin_0 = '\x5a\xa9\x05\x00' '\xf4\xd5\xd0\x33' \
4195
 
            '\x3d\x8f\xa0\x18' '\x04\x00\x00\x00' \
4196
 
            '\x62\x6c\x75\x65'
 
4202
        self.req_bin_0 = b'\x5a\xa9\x05\x00' b'\xf4\xd5\xd0\x33' \
 
4203
            b'\x3d\x8f\xa0\x18' b'\x04\x00\x00\x00' \
 
4204
            b'\x62\x6c\x75\x65'
4197
4205
 
4198
4206
 
4199
4207
    def testPackRequest0(self):
4200
 
        bin = apply(request.StoreNamedColor._request.to_binary, (), self.req_args_0)
 
4208
        bin = request.StoreNamedColor._request.to_binary(*(), **self.req_args_0)
4201
4209
        try:
4202
4210
            assert bin == self.req_bin_0
4203
4211
        except AssertionError:
4221
4229
            'cmap': 1750052450,
4222
4230
            'pixels': [1673396539, 1897675292, 1453845591, 816818886, 897340342, 1782049962, 796231465, 722380604],
4223
4231
            }
4224
 
        self.req_bin_0 = '\x5b\x00\x0a\x00' '\x62\xae\x4f\x68' \
4225
 
            '\x3b\x01\xbe\x63' '\x1c\x3a\x1c\x71' \
4226
 
            '\x57\xec\xa7\x56' '\xc6\xaa\xaf\x30' \
4227
 
            '\xb6\x53\x7c\x35' '\xaa\xec\x37\x6a' \
4228
 
            '\x29\x87\x75\x2f' '\x3c\xa7\x0e\x2b'
 
4232
        self.req_bin_0 = b'\x5b\x00\x0a\x00' b'\x62\xae\x4f\x68' \
 
4233
            b'\x3b\x01\xbe\x63' b'\x1c\x3a\x1c\x71' \
 
4234
            b'\x57\xec\xa7\x56' b'\xc6\xaa\xaf\x30' \
 
4235
            b'\xb6\x53\x7c\x35' b'\xaa\xec\x37\x6a' \
 
4236
            b'\x29\x87\x75\x2f' b'\x3c\xa7\x0e\x2b'
4229
4237
 
4230
4238
        self.reply_args_0 = {
4231
4239
            'colors': [{'blue': 63820, 'green': 60107, 'red': 62261}, {'blue': 54480, 'green': 48839, 'red': 10033}, {'blue': 31765, 'green': 31737, 'red': 43117}, {'blue': 50953, 'green': 52009, 'red': 14234}, {'blue': 55150, 'green': 30330, 'red': 55956}],
4232
4240
            'sequence_number': 10895,
4233
4241
            }
4234
 
        self.reply_bin_0 = '\x01\x00\x8f\x2a' '\x0a\x00\x00\x00' \
4235
 
            '\x05\x00\x00\x00' '\x00\x00\x00\x00' \
4236
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
4237
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
4238
 
            '\x35\xf3\xcb\xea' '\x4c\xf9\x00\x00' \
4239
 
            '\x31\x27\xc7\xbe' '\xd0\xd4\x00\x00' \
4240
 
            '\x6d\xa8\xf9\x7b' '\x15\x7c\x00\x00' \
4241
 
            '\x9a\x37\x29\xcb' '\x09\xc7\x00\x00' \
4242
 
            '\x94\xda\x7a\x76' '\x6e\xd7\x00\x00'
 
4242
        self.reply_bin_0 = b'\x01\x00\x8f\x2a' b'\x0a\x00\x00\x00' \
 
4243
            b'\x05\x00\x00\x00' b'\x00\x00\x00\x00' \
 
4244
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
4245
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
4246
            b'\x35\xf3\xcb\xea' b'\x4c\xf9\x00\x00' \
 
4247
            b'\x31\x27\xc7\xbe' b'\xd0\xd4\x00\x00' \
 
4248
            b'\x6d\xa8\xf9\x7b' b'\x15\x7c\x00\x00' \
 
4249
            b'\x9a\x37\x29\xcb' b'\x09\xc7\x00\x00' \
 
4250
            b'\x94\xda\x7a\x76' b'\x6e\xd7\x00\x00'
4243
4251
 
4244
4252
        self.req_args_1 = {
4245
4253
            'cmap': 340337174,
4246
4254
            'pixels': [],
4247
4255
            }
4248
 
        self.req_bin_1 = '\x5b\x00\x02\x00' '\x16\x22\x49\x14'
 
4256
        self.req_bin_1 = b'\x5b\x00\x02\x00' b'\x16\x22\x49\x14'
4249
4257
 
4250
4258
 
4251
4259
    def testPackRequest0(self):
4252
 
        bin = apply(request.QueryColors._request.to_binary, (), self.req_args_0)
 
4260
        bin = request.QueryColors._request.to_binary(*(), **self.req_args_0)
4253
4261
        try:
4254
4262
            assert bin == self.req_bin_0
4255
4263
        except AssertionError:
4267
4275
            raise AssertionError(args)
4268
4276
 
4269
4277
    def testPackRequest1(self):
4270
 
        bin = apply(request.QueryColors._request.to_binary, (), self.req_args_1)
 
4278
        bin = request.QueryColors._request.to_binary(*(), **self.req_args_1)
4271
4279
        try:
4272
4280
            assert bin == self.req_bin_1
4273
4281
        except AssertionError:
4285
4293
            raise AssertionError(args)
4286
4294
 
4287
4295
    def testPackReply0(self):
4288
 
        bin = apply(request.QueryColors._reply.to_binary, (), self.reply_args_0)
 
4296
        bin = request.QueryColors._reply.to_binary(*(), **self.reply_args_0)
4289
4297
        try:
4290
4298
            assert bin == self.reply_bin_0
4291
4299
        except AssertionError:
4309
4317
            'cmap': 2120409969,
4310
4318
            'name': 'octarin',
4311
4319
            }
4312
 
        self.req_bin_0 = '\x5c\x00\x05\x00' '\x71\xe3\x62\x7e' \
4313
 
            '\x07\x00\x00\x00' '\x6f\x63\x74\x61' \
4314
 
            '\x72\x69\x6e\x00'
 
4320
        self.req_bin_0 = b'\x5c\x00\x05\x00' b'\x71\xe3\x62\x7e' \
 
4321
            b'\x07\x00\x00\x00' b'\x6f\x63\x74\x61' \
 
4322
            b'\x72\x69\x6e\x00'
4315
4323
 
4316
4324
        self.reply_args_0 = {
4317
4325
            'exact_red': 63730,
4322
4330
            'screen_red': 26587,
4323
4331
            'sequence_number': 2933,
4324
4332
            }
4325
 
        self.reply_bin_0 = '\x01\x00\x75\x0b' '\x00\x00\x00\x00' \
4326
 
            '\xf2\xf8\x50\x5f' '\x65\x6b\xdb\x67' \
4327
 
            '\x06\x3e\xfb\x24' '\x00\x00\x00\x00' \
4328
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
4333
        self.reply_bin_0 = b'\x01\x00\x75\x0b' b'\x00\x00\x00\x00' \
 
4334
            b'\xf2\xf8\x50\x5f' b'\x65\x6b\xdb\x67' \
 
4335
            b'\x06\x3e\xfb\x24' b'\x00\x00\x00\x00' \
 
4336
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
4329
4337
 
4330
4338
 
4331
4339
    def testPackRequest0(self):
4332
 
        bin = apply(request.LookupColor._request.to_binary, (), self.req_args_0)
 
4340
        bin = request.LookupColor._request.to_binary(*(), **self.req_args_0)
4333
4341
        try:
4334
4342
            assert bin == self.req_bin_0
4335
4343
        except AssertionError:
4347
4355
            raise AssertionError(args)
4348
4356
 
4349
4357
    def testPackReply0(self):
4350
 
        bin = apply(request.LookupColor._reply.to_binary, (), self.reply_args_0)
 
4358
        bin = request.LookupColor._reply.to_binary(*(), **self.reply_args_0)
4351
4359
        try:
4352
4360
            assert bin == self.reply_bin_0
4353
4361
        except AssertionError:
4380
4388
            'x': 731,
4381
4389
            'back_red': 30886,
4382
4390
            }
4383
 
        self.req_bin_0 = '\x5d\x00\x08\x00' '\xa6\x29\xd3\x52' \
4384
 
            '\x5d\x7b\xd1\x7a' '\xf2\xa8\xf2\x57' \
4385
 
            '\x9f\xa7\x3b\x7d' '\xdd\xb1\xa6\x78' \
4386
 
            '\x15\x24\x39\x1d' '\xdb\x02\xa7\x7c'
 
4391
        self.req_bin_0 = b'\x5d\x00\x08\x00' b'\xa6\x29\xd3\x52' \
 
4392
            b'\x5d\x7b\xd1\x7a' b'\xf2\xa8\xf2\x57' \
 
4393
            b'\x9f\xa7\x3b\x7d' b'\xdd\xb1\xa6\x78' \
 
4394
            b'\x15\x24\x39\x1d' b'\xdb\x02\xa7\x7c'
4387
4395
 
4388
4396
 
4389
4397
    def testPackRequest0(self):
4390
 
        bin = apply(request.CreateCursor._request.to_binary, (), self.req_args_0)
 
4398
        bin = request.CreateCursor._request.to_binary(*(), **self.req_args_0)
4391
4399
        try:
4392
4400
            assert bin == self.req_bin_0
4393
4401
        except AssertionError:
4420
4428
            'source_char': 50271,
4421
4429
            'back_red': 13590,
4422
4430
            }
4423
 
        self.req_bin_0 = '\x5e\x00\x08\x00' '\x31\xe7\xc1\x6d' \
4424
 
            '\x2a\x85\x48\x01' '\x50\x9a\x89\x10' \
4425
 
            '\x5f\xc4\xdc\x4a' '\xeb\x23\xfc\xc7' \
4426
 
            '\xb7\x62\x16\x35' '\xed\xd7\xfb\x1c'
 
4431
        self.req_bin_0 = b'\x5e\x00\x08\x00' b'\x31\xe7\xc1\x6d' \
 
4432
            b'\x2a\x85\x48\x01' b'\x50\x9a\x89\x10' \
 
4433
            b'\x5f\xc4\xdc\x4a' b'\xeb\x23\xfc\xc7' \
 
4434
            b'\xb7\x62\x16\x35' b'\xed\xd7\xfb\x1c'
4427
4435
 
4428
4436
 
4429
4437
    def testPackRequest0(self):
4430
 
        bin = apply(request.CreateGlyphCursor._request.to_binary, (), self.req_args_0)
 
4438
        bin = request.CreateGlyphCursor._request.to_binary(*(), **self.req_args_0)
4431
4439
        try:
4432
4440
            assert bin == self.req_bin_0
4433
4441
        except AssertionError:
4450
4458
        self.req_args_0 = {
4451
4459
            'cursor': 830435200,
4452
4460
            }
4453
 
        self.req_bin_0 = '\x5f\x00\x02\x00' '\x80\x6f\x7f\x31'
 
4461
        self.req_bin_0 = b'\x5f\x00\x02\x00' b'\x80\x6f\x7f\x31'
4454
4462
 
4455
4463
 
4456
4464
    def testPackRequest0(self):
4457
 
        bin = apply(request.FreeCursor._request.to_binary, (), self.req_args_0)
 
4465
        bin = request.FreeCursor._request.to_binary(*(), **self.req_args_0)
4458
4466
        try:
4459
4467
            assert bin == self.req_bin_0
4460
4468
        except AssertionError:
4483
4491
            'fore_green': 39148,
4484
4492
            'fore_red': 48154,
4485
4493
            }
4486
 
        self.req_bin_0 = '\x60\x00\x05\x00' '\xc3\xa3\xe5\x23' \
4487
 
            '\x1a\xbc\xec\x98' '\x24\xfa\x82\x17' \
4488
 
            '\x80\xbf\x4f\x3c'
 
4494
        self.req_bin_0 = b'\x60\x00\x05\x00' b'\xc3\xa3\xe5\x23' \
 
4495
            b'\x1a\xbc\xec\x98' b'\x24\xfa\x82\x17' \
 
4496
            b'\x80\xbf\x4f\x3c'
4489
4497
 
4490
4498
 
4491
4499
    def testPackRequest0(self):
4492
 
        bin = apply(request.RecolorCursor._request.to_binary, (), self.req_args_0)
 
4500
        bin = request.RecolorCursor._request.to_binary(*(), **self.req_args_0)
4493
4501
        try:
4494
4502
            assert bin == self.req_bin_0
4495
4503
        except AssertionError:
4515
4523
            'drawable': 1606665099,
4516
4524
            'height': 4701,
4517
4525
            }
4518
 
        self.req_bin_0 = '\x61\x01\x03\x00' '\x8b\xc3\xc3\x5f' \
4519
 
            '\x60\xce\x5d\x12'
 
4526
        self.req_bin_0 = b'\x61\x01\x03\x00' b'\x8b\xc3\xc3\x5f' \
 
4527
            b'\x60\xce\x5d\x12'
4520
4528
 
4521
4529
        self.reply_args_0 = {
4522
4530
            'width': 33709,
4523
4531
            'sequence_number': 43788,
4524
4532
            'height': 12826,
4525
4533
            }
4526
 
        self.reply_bin_0 = '\x01\x00\x0c\xab' '\x00\x00\x00\x00' \
4527
 
            '\xad\x83\x1a\x32' '\x00\x00\x00\x00' \
4528
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
4529
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
4534
        self.reply_bin_0 = b'\x01\x00\x0c\xab' b'\x00\x00\x00\x00' \
 
4535
            b'\xad\x83\x1a\x32' b'\x00\x00\x00\x00' \
 
4536
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
4537
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
4530
4538
 
4531
4539
 
4532
4540
    def testPackRequest0(self):
4533
 
        bin = apply(request.QueryBestSize._request.to_binary, (), self.req_args_0)
 
4541
        bin = request.QueryBestSize._request.to_binary(*(), **self.req_args_0)
4534
4542
        try:
4535
4543
            assert bin == self.req_bin_0
4536
4544
        except AssertionError:
4548
4556
            raise AssertionError(args)
4549
4557
 
4550
4558
    def testPackReply0(self):
4551
 
        bin = apply(request.QueryBestSize._reply.to_binary, (), self.reply_args_0)
 
4559
        bin = request.QueryBestSize._reply.to_binary(*(), **self.reply_args_0)
4552
4560
        try:
4553
4561
            assert bin == self.reply_bin_0
4554
4562
        except AssertionError:
4571
4579
        self.req_args_0 = {
4572
4580
            'name': 'XTRA',
4573
4581
            }
4574
 
        self.req_bin_0 = '\x62\x00\x03\x00' '\x04\x00\x00\x00' \
4575
 
            '\x58\x54\x52\x41'
 
4582
        self.req_bin_0 = b'\x62\x00\x03\x00' b'\x04\x00\x00\x00' \
 
4583
            b'\x58\x54\x52\x41'
4576
4584
 
4577
4585
        self.reply_args_0 = {
4578
4586
            'first_event': 163,
4581
4589
            'present': 1,
4582
4590
            'sequence_number': 3124,
4583
4591
            }
4584
 
        self.reply_bin_0 = '\x01\x00\x34\x0c' '\x00\x00\x00\x00' \
4585
 
            '\x01\xd7\xa3\xa6' '\x00\x00\x00\x00' \
4586
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
4587
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
4592
        self.reply_bin_0 = b'\x01\x00\x34\x0c' b'\x00\x00\x00\x00' \
 
4593
            b'\x01\xd7\xa3\xa6' b'\x00\x00\x00\x00' \
 
4594
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
4595
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
4588
4596
 
4589
4597
 
4590
4598
    def testPackRequest0(self):
4591
 
        bin = apply(request.QueryExtension._request.to_binary, (), self.req_args_0)
 
4599
        bin = request.QueryExtension._request.to_binary(*(), **self.req_args_0)
4592
4600
        try:
4593
4601
            assert bin == self.req_bin_0
4594
4602
        except AssertionError:
4606
4614
            raise AssertionError(args)
4607
4615
 
4608
4616
    def testPackReply0(self):
4609
 
        bin = apply(request.QueryExtension._reply.to_binary, (), self.reply_args_0)
 
4617
        bin = request.QueryExtension._reply.to_binary(*(), **self.reply_args_0)
4610
4618
        try:
4611
4619
            assert bin == self.reply_bin_0
4612
4620
        except AssertionError:
4628
4636
    def setUp(self):
4629
4637
        self.req_args_0 = {
4630
4638
            }
4631
 
        self.req_bin_0 = '\x63\x00\x01\x00'
 
4639
        self.req_bin_0 = b'\x63\x00\x01\x00'
4632
4640
 
4633
4641
        self.reply_args_0 = {
4634
4642
            'names': ['XTRA', 'XTRA-II'],
4635
4643
            'sequence_number': 21122,
4636
4644
            }
4637
 
        self.reply_bin_0 = '\x01\x02\x82\x52' '\x04\x00\x00\x00' \
4638
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
4639
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
4640
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
4641
 
            '\x04\x58\x54\x52' '\x41\x07\x58\x54' \
4642
 
            '\x52\x41\x2d\x49' '\x49\x00\x00\x00'
 
4645
        self.reply_bin_0 = b'\x01\x02\x82\x52' b'\x04\x00\x00\x00' \
 
4646
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
4647
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
4648
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
4649
            b'\x04\x58\x54\x52' b'\x41\x07\x58\x54' \
 
4650
            b'\x52\x41\x2d\x49' b'\x49\x00\x00\x00'
4643
4651
 
4644
4652
 
4645
4653
    def testPackRequest0(self):
4646
 
        bin = apply(request.ListExtensions._request.to_binary, (), self.req_args_0)
 
4654
        bin = request.ListExtensions._request.to_binary(*(), **self.req_args_0)
4647
4655
        try:
4648
4656
            assert bin == self.req_bin_0
4649
4657
        except AssertionError:
4661
4669
            raise AssertionError(args)
4662
4670
 
4663
4671
    def testPackReply0(self):
4664
 
        bin = apply(request.ListExtensions._reply.to_binary, (), self.reply_args_0)
 
4672
        bin = request.ListExtensions._reply.to_binary(*(), **self.reply_args_0)
4665
4673
        try:
4666
4674
            assert bin == self.reply_bin_0
4667
4675
        except AssertionError:
4685
4693
            'first_keycode': 131,
4686
4694
            'keysyms': [[1479273593, 495399194, 1752874714], [183124138, 826800766, 542058728], [519501686, 1358630902, 1051542205], [1363902850, 52079613, 1721268402], [2124568309, 323328202, 1426344655], [1775218167, 1821828429, 1704892958], [1784543283, 783698836, 1882907069], [1165130550, 1276086917, 957090966], [1623553701, 77158667, 420399405], [790514637, 1104383431, 1645303152], [879499287, 349457843, 1313813953], [367336866, 1207824094, 514125338], [767413913, 135340640, 756292967], [475442692, 2076098223, 1252936842], [964050497, 2006979633, 948353974], [1923834215, 1061136894, 1319606154], [1186538913, 1770176901, 715354628], [1470481551, 403222608, 252019996], [260033548, 1553379907, 1096456683], [2027881549, 1992616114, 382810564]],
4687
4695
            }
4688
 
        self.req_bin_0 = '\x64\x14\x3e\x00' '\x83\x03\x00\x00' \
4689
 
            '\x79\xec\x2b\x58' '\x1a\x31\x87\x1d' \
4690
 
            '\xda\xbe\x7a\x68' '\xaa\x40\xea\x0a' \
4691
 
            '\x7e\xfa\x47\x31' '\xe8\x28\x4f\x20' \
4692
 
            '\x76\xf7\xf6\x1e' '\xf6\x0f\xfb\x50' \
4693
 
            '\xbd\x42\xad\x3e' '\x82\x81\x4b\x51' \
4694
 
            '\xfd\xab\x1a\x03' '\xb2\x78\x98\x66' \
4695
 
            '\xf5\x56\xa2\x7e' '\xca\x98\x45\x13' \
4696
 
            '\xcf\x4a\x04\x55' '\xf7\xad\xcf\x69' \
4697
 
            '\x4d\xe5\x96\x6c' '\x1e\x9a\x9e\x65' \
4698
 
            '\x33\xf8\x5d\x6a' '\x94\x4b\xb6\x2e' \
4699
 
            '\xbd\xe1\x3a\x70' '\x36\x7b\x72\x45' \
4700
 
            '\x85\x8a\x0f\x4c' '\x96\x0c\x0c\x39' \
4701
 
            '\xa5\x76\xc5\x60' '\x0b\x59\x99\x04' \
4702
 
            '\x2d\xc9\x0e\x19' '\xcd\x4b\x1e\x2f' \
4703
 
            '\xc7\x8d\xd3\x41' '\x70\x55\x11\x62' \
4704
 
            '\x17\x18\x6c\x34' '\xb3\x4d\xd4\x14' \
4705
 
            '\xc1\x35\x4f\x4e' '\xa2\x1d\xe5\x15' \
4706
 
            '\xde\xee\xfd\x47' '\x1a\xee\xa4\x1e' \
4707
 
            '\x99\xce\xbd\x2d' '\x60\x22\x11\x08' \
4708
 
            '\x67\x1d\x14\x2d' '\x04\xae\x56\x1c' \
4709
 
            '\xaf\xbe\xbe\x7b' '\x8a\x4c\xae\x4a' \
4710
 
            '\x41\x3e\x76\x39' '\x31\x14\xa0\x77' \
4711
 
            '\xb6\xbb\x86\x38' '\x67\x61\xab\x72' \
4712
 
            '\xfe\xa9\x3f\x3f' '\x8a\x97\xa7\x4e' \
4713
 
            '\xa1\x25\xb9\x46' '\x85\xc1\x82\x69' \
4714
 
            '\x04\x72\xa3\x2a' '\x8f\xc4\xa5\x57' \
4715
 
            '\x50\xb0\x08\x18' '\x1c\x85\x05\x0f' \
4716
 
            '\x0c\xcc\x7f\x0f' '\x43\xb2\x96\x5c' \
4717
 
            '\xeb\x99\x5a\x41' '\x4d\x04\xdf\x78' \
4718
 
            '\xb2\xe8\xc4\x76' '\xc4\x39\xd1\x16'
 
4696
        self.req_bin_0 = b'\x64\x14\x3e\x00' b'\x83\x03\x00\x00' \
 
4697
            b'\x79\xec\x2b\x58' b'\x1a\x31\x87\x1d' \
 
4698
            b'\xda\xbe\x7a\x68' b'\xaa\x40\xea\x0a' \
 
4699
            b'\x7e\xfa\x47\x31' b'\xe8\x28\x4f\x20' \
 
4700
            b'\x76\xf7\xf6\x1e' b'\xf6\x0f\xfb\x50' \
 
4701
            b'\xbd\x42\xad\x3e' b'\x82\x81\x4b\x51' \
 
4702
            b'\xfd\xab\x1a\x03' b'\xb2\x78\x98\x66' \
 
4703
            b'\xf5\x56\xa2\x7e' b'\xca\x98\x45\x13' \
 
4704
            b'\xcf\x4a\x04\x55' b'\xf7\xad\xcf\x69' \
 
4705
            b'\x4d\xe5\x96\x6c' b'\x1e\x9a\x9e\x65' \
 
4706
            b'\x33\xf8\x5d\x6a' b'\x94\x4b\xb6\x2e' \
 
4707
            b'\xbd\xe1\x3a\x70' b'\x36\x7b\x72\x45' \
 
4708
            b'\x85\x8a\x0f\x4c' b'\x96\x0c\x0c\x39' \
 
4709
            b'\xa5\x76\xc5\x60' b'\x0b\x59\x99\x04' \
 
4710
            b'\x2d\xc9\x0e\x19' b'\xcd\x4b\x1e\x2f' \
 
4711
            b'\xc7\x8d\xd3\x41' b'\x70\x55\x11\x62' \
 
4712
            b'\x17\x18\x6c\x34' b'\xb3\x4d\xd4\x14' \
 
4713
            b'\xc1\x35\x4f\x4e' b'\xa2\x1d\xe5\x15' \
 
4714
            b'\xde\xee\xfd\x47' b'\x1a\xee\xa4\x1e' \
 
4715
            b'\x99\xce\xbd\x2d' b'\x60\x22\x11\x08' \
 
4716
            b'\x67\x1d\x14\x2d' b'\x04\xae\x56\x1c' \
 
4717
            b'\xaf\xbe\xbe\x7b' b'\x8a\x4c\xae\x4a' \
 
4718
            b'\x41\x3e\x76\x39' b'\x31\x14\xa0\x77' \
 
4719
            b'\xb6\xbb\x86\x38' b'\x67\x61\xab\x72' \
 
4720
            b'\xfe\xa9\x3f\x3f' b'\x8a\x97\xa7\x4e' \
 
4721
            b'\xa1\x25\xb9\x46' b'\x85\xc1\x82\x69' \
 
4722
            b'\x04\x72\xa3\x2a' b'\x8f\xc4\xa5\x57' \
 
4723
            b'\x50\xb0\x08\x18' b'\x1c\x85\x05\x0f' \
 
4724
            b'\x0c\xcc\x7f\x0f' b'\x43\xb2\x96\x5c' \
 
4725
            b'\xeb\x99\x5a\x41' b'\x4d\x04\xdf\x78' \
 
4726
            b'\xb2\xe8\xc4\x76' b'\xc4\x39\xd1\x16'
4719
4727
 
4720
4728
 
4721
4729
    def testPackRequest0(self):
4722
 
        bin = apply(request.ChangeKeyboardMapping._request.to_binary, (), self.req_args_0)
 
4730
        bin = request.ChangeKeyboardMapping._request.to_binary(*(), **self.req_args_0)
4723
4731
        try:
4724
4732
            assert bin == self.req_bin_0
4725
4733
        except AssertionError:
4743
4751
            'first_keycode': 174,
4744
4752
            'count': 233,
4745
4753
            }
4746
 
        self.req_bin_0 = '\x65\x00\x02\x00' '\xae\xe9\x00\x00'
 
4754
        self.req_bin_0 = b'\x65\x00\x02\x00' b'\xae\xe9\x00\x00'
4747
4755
 
4748
4756
        self.reply_args_0 = {
4749
4757
            'keysyms': [[536700486, 90972970, 1834434734], [604690854, 1612992766, 1785113276], [1258017014, 814047417, 79874791], [1752913778, 2069894554, 1342993084], [691283205, 2002270597, 1552550365], [1427239047, 80222814, 380890249], [932130695, 1233544402, 1343201446], [850296480, 830996690, 1219102856], [1427529259, 1334110395, 1423305447], [925543758, 1154246092, 389857513], [782217983, 1673349321, 296773941], [904384636, 788791004, 1427343811], [578056967, 1628142600, 882651915], [1727003528, 1202959768, 59536638], [932784259, 453243643, 1846802632], [1527858524, 2055184942, 1534128611], [134086768, 909769847, 323736641], [2080620639, 1573387975, 566724688], [1393924270, 1408645244, 1610610798], [391612329, 341605408, 484634403]],
4750
4758
            'sequence_number': 27901,
4751
4759
            }
4752
 
        self.reply_bin_0 = '\x01\x03\xfd\x6c' '\x3c\x00\x00\x00' \
4753
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
4754
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
4755
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
4756
 
            '\x46\x66\xfd\x1f' '\x2a\x23\x6c\x05' \
4757
 
            '\xae\x40\x57\x6d' '\xa6\xd9\x0a\x24' \
4758
 
            '\xfe\x50\x24\x60' '\xbc\xaa\x66\x6a' \
4759
 
            '\xf6\xd0\xfb\x4a' '\xb9\x60\x85\x30' \
4760
 
            '\xe7\xca\xc2\x04' '\x72\x57\x7b\x68' \
4761
 
            '\x9a\x15\x60\x7b' '\xbc\x72\x0c\x50' \
4762
 
            '\x05\x25\x34\x29' '\x85\x39\x58\x77' \
4763
 
            '\xdd\x09\x8a\x5c' '\x87\xf0\x11\x55' \
4764
 
            '\x5e\x1a\xc8\x04' '\x89\xec\xb3\x16' \
4765
 
            '\x87\x2f\x8f\x37' '\xd2\x64\x86\x49' \
4766
 
            '\xa6\xa0\x0f\x50' '\xa0\x7e\xae\x32' \
4767
 
            '\xd2\x00\x88\x31' '\x88\x08\xaa\x48' \
4768
 
            '\x2b\x5e\x16\x55' '\xbb\xe8\x84\x4f' \
4769
 
            '\xe7\xea\xd5\x54' '\x4e\xad\x2a\x37' \
4770
 
            '\xcc\x65\xcc\x44' '\xe9\xc0\x3c\x17' \
4771
 
            '\xff\xb2\x9f\x2e' '\xc9\x48\xbd\x63' \
4772
 
            '\x35\x69\xb0\x11' '\x7c\xd0\xe7\x35' \
4773
 
            '\xdc\xfe\x03\x2f' '\xc3\x89\x13\x55' \
4774
 
            '\x07\x73\x74\x22' '\x08\x7c\x0b\x61' \
4775
 
            '\x0b\x33\x9c\x34' '\x88\xfb\xef\x66' \
4776
 
            '\x98\xb5\xb3\x47' '\xfe\x74\x8c\x03' \
4777
 
            '\x83\x28\x99\x37' '\xfb\xf2\x03\x1b' \
4778
 
            '\xc8\xf8\x13\x6e' '\x5c\x45\x11\x5b' \
4779
 
            '\x2e\xa2\x7f\x7a' '\xe3\xf1\x70\x5b' \
4780
 
            '\x70\x00\xfe\x07' '\x77\xfc\x39\x36' \
4781
 
            '\x41\xd4\x4b\x13' '\x5f\xc0\x03\x7c' \
4782
 
            '\xc7\xfe\xc7\x5d' '\x50\x88\xc7\x21' \
4783
 
            '\xae\x98\x15\x53' '\x7c\x38\xf6\x53' \
4784
 
            '\x6e\xf8\xff\x5f' '\xa9\x87\x57\x17' \
4785
 
            '\x20\x7c\x5c\x14' '\x23\xef\xe2\x1c'
 
4760
        self.reply_bin_0 = b'\x01\x03\xfd\x6c' b'\x3c\x00\x00\x00' \
 
4761
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
4762
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
4763
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
4764
            b'\x46\x66\xfd\x1f' b'\x2a\x23\x6c\x05' \
 
4765
            b'\xae\x40\x57\x6d' b'\xa6\xd9\x0a\x24' \
 
4766
            b'\xfe\x50\x24\x60' b'\xbc\xaa\x66\x6a' \
 
4767
            b'\xf6\xd0\xfb\x4a' b'\xb9\x60\x85\x30' \
 
4768
            b'\xe7\xca\xc2\x04' b'\x72\x57\x7b\x68' \
 
4769
            b'\x9a\x15\x60\x7b' b'\xbc\x72\x0c\x50' \
 
4770
            b'\x05\x25\x34\x29' b'\x85\x39\x58\x77' \
 
4771
            b'\xdd\x09\x8a\x5c' b'\x87\xf0\x11\x55' \
 
4772
            b'\x5e\x1a\xc8\x04' b'\x89\xec\xb3\x16' \
 
4773
            b'\x87\x2f\x8f\x37' b'\xd2\x64\x86\x49' \
 
4774
            b'\xa6\xa0\x0f\x50' b'\xa0\x7e\xae\x32' \
 
4775
            b'\xd2\x00\x88\x31' b'\x88\x08\xaa\x48' \
 
4776
            b'\x2b\x5e\x16\x55' b'\xbb\xe8\x84\x4f' \
 
4777
            b'\xe7\xea\xd5\x54' b'\x4e\xad\x2a\x37' \
 
4778
            b'\xcc\x65\xcc\x44' b'\xe9\xc0\x3c\x17' \
 
4779
            b'\xff\xb2\x9f\x2e' b'\xc9\x48\xbd\x63' \
 
4780
            b'\x35\x69\xb0\x11' b'\x7c\xd0\xe7\x35' \
 
4781
            b'\xdc\xfe\x03\x2f' b'\xc3\x89\x13\x55' \
 
4782
            b'\x07\x73\x74\x22' b'\x08\x7c\x0b\x61' \
 
4783
            b'\x0b\x33\x9c\x34' b'\x88\xfb\xef\x66' \
 
4784
            b'\x98\xb5\xb3\x47' b'\xfe\x74\x8c\x03' \
 
4785
            b'\x83\x28\x99\x37' b'\xfb\xf2\x03\x1b' \
 
4786
            b'\xc8\xf8\x13\x6e' b'\x5c\x45\x11\x5b' \
 
4787
            b'\x2e\xa2\x7f\x7a' b'\xe3\xf1\x70\x5b' \
 
4788
            b'\x70\x00\xfe\x07' b'\x77\xfc\x39\x36' \
 
4789
            b'\x41\xd4\x4b\x13' b'\x5f\xc0\x03\x7c' \
 
4790
            b'\xc7\xfe\xc7\x5d' b'\x50\x88\xc7\x21' \
 
4791
            b'\xae\x98\x15\x53' b'\x7c\x38\xf6\x53' \
 
4792
            b'\x6e\xf8\xff\x5f' b'\xa9\x87\x57\x17' \
 
4793
            b'\x20\x7c\x5c\x14' b'\x23\xef\xe2\x1c'
4786
4794
 
4787
4795
 
4788
4796
    def testPackRequest0(self):
4789
 
        bin = apply(request.GetKeyboardMapping._request.to_binary, (), self.req_args_0)
 
4797
        bin = request.GetKeyboardMapping._request.to_binary(*(), **self.req_args_0)
4790
4798
        try:
4791
4799
            assert bin == self.req_bin_0
4792
4800
        except AssertionError:
4804
4812
            raise AssertionError(args)
4805
4813
 
4806
4814
    def testPackReply0(self):
4807
 
        bin = apply(request.GetKeyboardMapping._reply.to_binary, (), self.reply_args_0)
 
4815
        bin = request.GetKeyboardMapping._reply.to_binary(*(), **self.reply_args_0)
4808
4816
        try:
4809
4817
            assert bin == self.reply_bin_0
4810
4818
        except AssertionError:
4827
4835
        self.req_args_0 = {
4828
4836
            'attrs': {'led': 241, 'key': 193, 'bell_duration': -19485, 'auto_repeat_mode': 0, 'bell_pitch': -13220, 'key_click_percent': -3, 'bell_percent': -74, 'led_mode': 1},
4829
4837
            }
4830
 
        self.req_bin_0 = '\x66\x00\x0a\x00' '\xff\x00\x00\x00' \
4831
 
            '\xfd\x00\x00\x00' '\xb6\x00\x00\x00' \
4832
 
            '\x5c\xcc\x00\x00' '\xe3\xb3\x00\x00' \
4833
 
            '\xf1\x00\x00\x00' '\x01\x00\x00\x00' \
4834
 
            '\xc1\x00\x00\x00' '\x00\x00\x00\x00'
 
4838
        self.req_bin_0 = b'\x66\x00\x0a\x00' b'\xff\x00\x00\x00' \
 
4839
            b'\xfd\x00\x00\x00' b'\xb6\x00\x00\x00' \
 
4840
            b'\x5c\xcc\x00\x00' b'\xe3\xb3\x00\x00' \
 
4841
            b'\xf1\x00\x00\x00' b'\x01\x00\x00\x00' \
 
4842
            b'\xc1\x00\x00\x00' b'\x00\x00\x00\x00'
4835
4843
 
4836
4844
 
4837
4845
    def testPackRequest0(self):
4838
 
        bin = apply(request.ChangeKeyboardControl._request.to_binary, (), self.req_args_0)
 
4846
        bin = request.ChangeKeyboardControl._request.to_binary(*(), **self.req_args_0)
4839
4847
        try:
4840
4848
            assert bin == self.req_bin_0
4841
4849
        except AssertionError:
4857
4865
    def setUp(self):
4858
4866
        self.req_args_0 = {
4859
4867
            }
4860
 
        self.req_bin_0 = '\x67\x00\x01\x00'
 
4868
        self.req_bin_0 = b'\x67\x00\x01\x00'
4861
4869
 
4862
4870
        self.reply_args_0 = {
4863
4871
            'led_mask': 1389423883,
4869
4877
            'sequence_number': 62321,
4870
4878
            'key_click_percent': 140,
4871
4879
            }
4872
 
        self.reply_bin_0 = '\x01\x01\x71\xf3' '\x05\x00\x00\x00' \
4873
 
            '\x0b\xed\xd0\x52' '\x8c\x82\xb8\x6b' \
4874
 
            '\xca\x66\x00\x00' '\x81\xd3\xb4\xca' \
4875
 
            '\xda\x91\x81\x88' '\x89\xa5\xd2\xa0' \
4876
 
            '\xe5\xdf\xe2\x82' '\xc5\xe9\xbb\xa6' \
4877
 
            '\xd3\xf1\xad\xb7' '\xb8\xd8\xd8\xda' \
4878
 
            '\xb6\xe0\xaf\xd2'
 
4880
        self.reply_bin_0 = b'\x01\x01\x71\xf3' b'\x05\x00\x00\x00' \
 
4881
            b'\x0b\xed\xd0\x52' b'\x8c\x82\xb8\x6b' \
 
4882
            b'\xca\x66\x00\x00' b'\x81\xd3\xb4\xca' \
 
4883
            b'\xda\x91\x81\x88' b'\x89\xa5\xd2\xa0' \
 
4884
            b'\xe5\xdf\xe2\x82' b'\xc5\xe9\xbb\xa6' \
 
4885
            b'\xd3\xf1\xad\xb7' b'\xb8\xd8\xd8\xda' \
 
4886
            b'\xb6\xe0\xaf\xd2'
4879
4887
 
4880
4888
 
4881
4889
    def testPackRequest0(self):
4882
 
        bin = apply(request.GetKeyboardControl._request.to_binary, (), self.req_args_0)
 
4890
        bin = request.GetKeyboardControl._request.to_binary(*(), **self.req_args_0)
4883
4891
        try:
4884
4892
            assert bin == self.req_bin_0
4885
4893
        except AssertionError:
4897
4905
            raise AssertionError(args)
4898
4906
 
4899
4907
    def testPackReply0(self):
4900
 
        bin = apply(request.GetKeyboardControl._reply.to_binary, (), self.reply_args_0)
 
4908
        bin = request.GetKeyboardControl._reply.to_binary(*(), **self.reply_args_0)
4901
4909
        try:
4902
4910
            assert bin == self.reply_bin_0
4903
4911
        except AssertionError:
4920
4928
        self.req_args_0 = {
4921
4929
            'percent': -14,
4922
4930
            }
4923
 
        self.req_bin_0 = '\x68\xf2\x01\x00'
 
4931
        self.req_bin_0 = b'\x68\xf2\x01\x00'
4924
4932
 
4925
4933
 
4926
4934
    def testPackRequest0(self):
4927
 
        bin = apply(request.Bell._request.to_binary, (), self.req_args_0)
 
4935
        bin = request.Bell._request.to_binary(*(), **self.req_args_0)
4928
4936
        try:
4929
4937
            assert bin == self.req_bin_0
4930
4938
        except AssertionError:
4951
4959
            'accel_denum': -24572,
4952
4960
            'do_thresh': 1,
4953
4961
            }
4954
 
        self.req_bin_0 = '\x69\x00\x03\x00' '\x4e\xea\x04\xa0' \
4955
 
            '\xba\xd6\x01\x01'
 
4962
        self.req_bin_0 = b'\x69\x00\x03\x00' b'\x4e\xea\x04\xa0' \
 
4963
            b'\xba\xd6\x01\x01'
4956
4964
 
4957
4965
 
4958
4966
    def testPackRequest0(self):
4959
 
        bin = apply(request.ChangePointerControl._request.to_binary, (), self.req_args_0)
 
4967
        bin = request.ChangePointerControl._request.to_binary(*(), **self.req_args_0)
4960
4968
        try:
4961
4969
            assert bin == self.req_bin_0
4962
4970
        except AssertionError:
4978
4986
    def setUp(self):
4979
4987
        self.req_args_0 = {
4980
4988
            }
4981
 
        self.req_bin_0 = '\x6a\x00\x01\x00'
 
4989
        self.req_bin_0 = b'\x6a\x00\x01\x00'
4982
4990
 
4983
4991
        self.reply_args_0 = {
4984
4992
            'accel_num': 11888,
4986
4994
            'sequence_number': 62480,
4987
4995
            'accel_denom': 46073,
4988
4996
            }
4989
 
        self.reply_bin_0 = '\x01\x00\x10\xf4' '\x00\x00\x00\x00' \
4990
 
            '\x70\x2e\xf9\xb3' '\xd6\x8f\x00\x00' \
4991
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
4992
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
4997
        self.reply_bin_0 = b'\x01\x00\x10\xf4' b'\x00\x00\x00\x00' \
 
4998
            b'\x70\x2e\xf9\xb3' b'\xd6\x8f\x00\x00' \
 
4999
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
5000
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
4993
5001
 
4994
5002
 
4995
5003
    def testPackRequest0(self):
4996
 
        bin = apply(request.GetPointerControl._request.to_binary, (), self.req_args_0)
 
5004
        bin = request.GetPointerControl._request.to_binary(*(), **self.req_args_0)
4997
5005
        try:
4998
5006
            assert bin == self.req_bin_0
4999
5007
        except AssertionError:
5011
5019
            raise AssertionError(args)
5012
5020
 
5013
5021
    def testPackReply0(self):
5014
 
        bin = apply(request.GetPointerControl._reply.to_binary, (), self.reply_args_0)
 
5022
        bin = request.GetPointerControl._reply.to_binary(*(), **self.reply_args_0)
5015
5023
        try:
5016
5024
            assert bin == self.reply_bin_0
5017
5025
        except AssertionError:
5037
5045
            'timeout': -2423,
5038
5046
            'allow_exposures': 2,
5039
5047
            }
5040
 
        self.req_bin_0 = '\x6b\x00\x03\x00' '\x89\xf6\xee\xb4' \
5041
 
            '\x01\x02\x00\x00'
 
5048
        self.req_bin_0 = b'\x6b\x00\x03\x00' b'\x89\xf6\xee\xb4' \
 
5049
            b'\x01\x02\x00\x00'
5042
5050
 
5043
5051
 
5044
5052
    def testPackRequest0(self):
5045
 
        bin = apply(request.SetScreenSaver._request.to_binary, (), self.req_args_0)
 
5053
        bin = request.SetScreenSaver._request.to_binary(*(), **self.req_args_0)
5046
5054
        try:
5047
5055
            assert bin == self.req_bin_0
5048
5056
        except AssertionError:
5064
5072
    def setUp(self):
5065
5073
        self.req_args_0 = {
5066
5074
            }
5067
 
        self.req_bin_0 = '\x6c\x00\x01\x00'
 
5075
        self.req_bin_0 = b'\x6c\x00\x01\x00'
5068
5076
 
5069
5077
        self.reply_args_0 = {
5070
5078
            'interval': 51464,
5073
5081
            'sequence_number': 45153,
5074
5082
            'allow_exposures': 1,
5075
5083
            }
5076
 
        self.reply_bin_0 = '\x01\x00\x61\xb0' '\x00\x00\x00\x00' \
5077
 
            '\x57\x14\x08\xc9' '\x01\x01\x00\x00' \
5078
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
5079
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
5084
        self.reply_bin_0 = b'\x01\x00\x61\xb0' b'\x00\x00\x00\x00' \
 
5085
            b'\x57\x14\x08\xc9' b'\x01\x01\x00\x00' \
 
5086
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
5087
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
5080
5088
 
5081
5089
 
5082
5090
    def testPackRequest0(self):
5083
 
        bin = apply(request.GetScreenSaver._request.to_binary, (), self.req_args_0)
 
5091
        bin = request.GetScreenSaver._request.to_binary(*(), **self.req_args_0)
5084
5092
        try:
5085
5093
            assert bin == self.req_bin_0
5086
5094
        except AssertionError:
5098
5106
            raise AssertionError(args)
5099
5107
 
5100
5108
    def testPackReply0(self):
5101
 
        bin = apply(request.GetScreenSaver._reply.to_binary, (), self.reply_args_0)
 
5109
        bin = request.GetScreenSaver._reply.to_binary(*(), **self.reply_args_0)
5102
5110
        try:
5103
5111
            assert bin == self.reply_bin_0
5104
5112
        except AssertionError:
5123
5131
            'mode': 0,
5124
5132
            'host_family': 0,
5125
5133
            }
5126
 
        self.req_bin_0 = '\x6d\x00\x03\x00' '\x00\x00\x04\x00' \
5127
 
            '\x96\xc8\xcd\xb6'
 
5134
        self.req_bin_0 = b'\x6d\x00\x03\x00' b'\x00\x00\x04\x00' \
 
5135
            b'\x96\xc8\xcd\xb6'
5128
5136
 
5129
5137
 
5130
5138
    def testPackRequest0(self):
5131
 
        bin = apply(request.ChangeHosts._request.to_binary, (), self.req_args_0)
 
5139
        bin = request.ChangeHosts._request.to_binary(*(), **self.req_args_0)
5132
5140
        try:
5133
5141
            assert bin == self.req_bin_0
5134
5142
        except AssertionError:
5150
5158
    def setUp(self):
5151
5159
        self.req_args_0 = {
5152
5160
            }
5153
 
        self.req_bin_0 = '\x6e\x00\x01\x00'
 
5161
        self.req_bin_0 = b'\x6e\x00\x01\x00'
5154
5162
 
5155
5163
        self.reply_args_0 = {
5156
5164
            'hosts': [{'name': [34, 23, 178, 12], 'family': 0}, {'name': [130, 236, 254, 15], 'family': 0}],
5157
5165
            'mode': 1,
5158
5166
            'sequence_number': 33455,
5159
5167
            }
5160
 
        self.reply_bin_0 = '\x01\x01\xaf\x82' '\x04\x00\x00\x00' \
5161
 
            '\x02\x00\x00\x00' '\x00\x00\x00\x00' \
5162
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
5163
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
5164
 
            '\x00\x00\x04\x00' '\x22\x17\xb2\x0c' \
5165
 
            '\x00\x00\x04\x00' '\x82\xec\xfe\x0f'
 
5168
        self.reply_bin_0 = b'\x01\x01\xaf\x82' b'\x04\x00\x00\x00' \
 
5169
            b'\x02\x00\x00\x00' b'\x00\x00\x00\x00' \
 
5170
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
5171
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
5172
            b'\x00\x00\x04\x00' b'\x22\x17\xb2\x0c' \
 
5173
            b'\x00\x00\x04\x00' b'\x82\xec\xfe\x0f'
5166
5174
 
5167
5175
 
5168
5176
    def testPackRequest0(self):
5169
 
        bin = apply(request.ListHosts._request.to_binary, (), self.req_args_0)
 
5177
        bin = request.ListHosts._request.to_binary(*(), **self.req_args_0)
5170
5178
        try:
5171
5179
            assert bin == self.req_bin_0
5172
5180
        except AssertionError:
5184
5192
            raise AssertionError(args)
5185
5193
 
5186
5194
    def testPackReply0(self):
5187
 
        bin = apply(request.ListHosts._reply.to_binary, (), self.reply_args_0)
 
5195
        bin = request.ListHosts._reply.to_binary(*(), **self.reply_args_0)
5188
5196
        try:
5189
5197
            assert bin == self.reply_bin_0
5190
5198
        except AssertionError:
5207
5215
        self.req_args_0 = {
5208
5216
            'mode': 1,
5209
5217
            }
5210
 
        self.req_bin_0 = '\x6f\x01\x01\x00'
 
5218
        self.req_bin_0 = b'\x6f\x01\x01\x00'
5211
5219
 
5212
5220
 
5213
5221
    def testPackRequest0(self):
5214
 
        bin = apply(request.SetAccessControl._request.to_binary, (), self.req_args_0)
 
5222
        bin = request.SetAccessControl._request.to_binary(*(), **self.req_args_0)
5215
5223
        try:
5216
5224
            assert bin == self.req_bin_0
5217
5225
        except AssertionError:
5234
5242
        self.req_args_0 = {
5235
5243
            'mode': 1,
5236
5244
            }
5237
 
        self.req_bin_0 = '\x70\x01\x01\x00'
 
5245
        self.req_bin_0 = b'\x70\x01\x01\x00'
5238
5246
 
5239
5247
 
5240
5248
    def testPackRequest0(self):
5241
 
        bin = apply(request.SetCloseDownMode._request.to_binary, (), self.req_args_0)
 
5249
        bin = request.SetCloseDownMode._request.to_binary(*(), **self.req_args_0)
5242
5250
        try:
5243
5251
            assert bin == self.req_bin_0
5244
5252
        except AssertionError:
5261
5269
        self.req_args_0 = {
5262
5270
            'resource': 1900634441,
5263
5271
            }
5264
 
        self.req_bin_0 = '\x71\x00\x02\x00' '\x49\x61\x49\x71'
 
5272
        self.req_bin_0 = b'\x71\x00\x02\x00' b'\x49\x61\x49\x71'
5265
5273
 
5266
5274
 
5267
5275
    def testPackRequest0(self):
5268
 
        bin = apply(request.KillClient._request.to_binary, (), self.req_args_0)
 
5276
        bin = request.KillClient._request.to_binary(*(), **self.req_args_0)
5269
5277
        try:
5270
5278
            assert bin == self.req_bin_0
5271
5279
        except AssertionError:
5290
5298
            'properties': [194806244, 1444715269, 486779871, 1850032482, 1083061497, 786546027, 807635511, 1716883082, 80335197, 1654299, 1459844212, 850673646],
5291
5299
            'delta': -27029,
5292
5300
            }
5293
 
        self.req_bin_0 = '\x72\x00\x0f\x00' '\xfd\x1b\x7e\x44' \
5294
 
            '\x0c\x00\x6b\x96' '\xe4\x81\x9c\x0b' \
5295
 
            '\x05\x9b\x1c\x56' '\xdf\xab\x03\x1d' \
5296
 
            '\x62\x41\x45\x6e' '\xf9\x34\x8e\x40' \
5297
 
            '\x6b\xbd\xe1\x2e' '\x37\x8a\x23\x30' \
5298
 
            '\x8a\x8e\x55\x66' '\x5d\xd1\xc9\x04' \
5299
 
            '\x1b\x3e\x19\x00' '\x74\x74\x03\x57' \
5300
 
            '\xee\x3f\xb4\x32'
 
5301
        self.req_bin_0 = b'\x72\x00\x0f\x00' b'\xfd\x1b\x7e\x44' \
 
5302
            b'\x0c\x00\x6b\x96' b'\xe4\x81\x9c\x0b' \
 
5303
            b'\x05\x9b\x1c\x56' b'\xdf\xab\x03\x1d' \
 
5304
            b'\x62\x41\x45\x6e' b'\xf9\x34\x8e\x40' \
 
5305
            b'\x6b\xbd\xe1\x2e' b'\x37\x8a\x23\x30' \
 
5306
            b'\x8a\x8e\x55\x66' b'\x5d\xd1\xc9\x04' \
 
5307
            b'\x1b\x3e\x19\x00' b'\x74\x74\x03\x57' \
 
5308
            b'\xee\x3f\xb4\x32'
5301
5309
 
5302
5310
 
5303
5311
    def testPackRequest0(self):
5304
 
        bin = apply(request.RotateProperties._request.to_binary, (), self.req_args_0)
 
5312
        bin = request.RotateProperties._request.to_binary(*(), **self.req_args_0)
5305
5313
        try:
5306
5314
            assert bin == self.req_bin_0
5307
5315
        except AssertionError:
5324
5332
        self.req_args_0 = {
5325
5333
            'mode': 1,
5326
5334
            }
5327
 
        self.req_bin_0 = '\x73\x01\x01\x00'
 
5335
        self.req_bin_0 = b'\x73\x01\x01\x00'
5328
5336
 
5329
5337
 
5330
5338
    def testPackRequest0(self):
5331
 
        bin = apply(request.ForceScreenSaver._request.to_binary, (), self.req_args_0)
 
5339
        bin = request.ForceScreenSaver._request.to_binary(*(), **self.req_args_0)
5332
5340
        try:
5333
5341
            assert bin == self.req_bin_0
5334
5342
        except AssertionError:
5351
5359
        self.req_args_0 = {
5352
5360
            'map': [130, 178, 229, 218, 178],
5353
5361
            }
5354
 
        self.req_bin_0 = '\x74\x05\x03\x00' '\x82\xb2\xe5\xda' \
5355
 
            '\xb2\x00\x00\x00'
 
5362
        self.req_bin_0 = b'\x74\x05\x03\x00' b'\x82\xb2\xe5\xda' \
 
5363
            b'\xb2\x00\x00\x00'
5356
5364
 
5357
5365
        self.reply_args_0 = {
5358
5366
            'status': 145,
5359
5367
            'sequence_number': 57045,
5360
5368
            }
5361
 
        self.reply_bin_0 = '\x01\x91\xd5\xde' '\x00\x00\x00\x00' \
5362
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
5363
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
5364
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
5369
        self.reply_bin_0 = b'\x01\x91\xd5\xde' b'\x00\x00\x00\x00' \
 
5370
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
5371
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
5372
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
5365
5373
 
5366
5374
 
5367
5375
    def testPackRequest0(self):
5368
 
        bin = apply(request.SetPointerMapping._request.to_binary, (), self.req_args_0)
 
5376
        bin = request.SetPointerMapping._request.to_binary(*(), **self.req_args_0)
5369
5377
        try:
5370
5378
            assert bin == self.req_bin_0
5371
5379
        except AssertionError:
5383
5391
            raise AssertionError(args)
5384
5392
 
5385
5393
    def testPackReply0(self):
5386
 
        bin = apply(request.SetPointerMapping._reply.to_binary, (), self.reply_args_0)
 
5394
        bin = request.SetPointerMapping._reply.to_binary(*(), **self.reply_args_0)
5387
5395
        try:
5388
5396
            assert bin == self.reply_bin_0
5389
5397
        except AssertionError:
5405
5413
    def setUp(self):
5406
5414
        self.req_args_0 = {
5407
5415
            }
5408
 
        self.req_bin_0 = '\x75\x00\x01\x00'
 
5416
        self.req_bin_0 = b'\x75\x00\x01\x00'
5409
5417
 
5410
5418
        self.reply_args_0 = {
5411
5419
            'map': [248, 185, 227, 157, 133],
5412
5420
            'sequence_number': 20072,
5413
5421
            }
5414
 
        self.reply_bin_0 = '\x01\x05\x68\x4e' '\x02\x00\x00\x00' \
5415
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
5416
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
5417
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
5418
 
            '\xf8\xb9\xe3\x9d' '\x85\x00\x00\x00'
 
5422
        self.reply_bin_0 = b'\x01\x05\x68\x4e' b'\x02\x00\x00\x00' \
 
5423
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
5424
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
5425
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
5426
            b'\xf8\xb9\xe3\x9d' b'\x85\x00\x00\x00'
5419
5427
 
5420
5428
 
5421
5429
    def testPackRequest0(self):
5422
 
        bin = apply(request.GetPointerMapping._request.to_binary, (), self.req_args_0)
 
5430
        bin = request.GetPointerMapping._request.to_binary(*(), **self.req_args_0)
5423
5431
        try:
5424
5432
            assert bin == self.req_bin_0
5425
5433
        except AssertionError:
5437
5445
            raise AssertionError(args)
5438
5446
 
5439
5447
    def testPackReply0(self):
5440
 
        bin = apply(request.GetPointerMapping._reply.to_binary, (), self.reply_args_0)
 
5448
        bin = request.GetPointerMapping._reply.to_binary(*(), **self.reply_args_0)
5441
5449
        try:
5442
5450
            assert bin == self.reply_bin_0
5443
5451
        except AssertionError:
5460
5468
        self.req_args_0 = {
5461
5469
            'keycodes': [[6, 191], [94, 123], [46, 94], [104, 116], [132, 158], [35, 75], [128, 63], [135, 221]],
5462
5470
            }
5463
 
        self.req_bin_0 = '\x76\x02\x05\x00' '\x06\xbf\x5e\x7b' \
5464
 
            '\x2e\x5e\x68\x74' '\x84\x9e\x23\x4b' \
5465
 
            '\x80\x3f\x87\xdd'
 
5471
        self.req_bin_0 = b'\x76\x02\x05\x00' b'\x06\xbf\x5e\x7b' \
 
5472
            b'\x2e\x5e\x68\x74' b'\x84\x9e\x23\x4b' \
 
5473
            b'\x80\x3f\x87\xdd'
5466
5474
 
5467
5475
        self.reply_args_0 = {
5468
5476
            'status': 149,
5469
5477
            'sequence_number': 26757,
5470
5478
            }
5471
 
        self.reply_bin_0 = '\x01\x95\x85\x68' '\x00\x00\x00\x00' \
5472
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
5473
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
5474
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
5479
        self.reply_bin_0 = b'\x01\x95\x85\x68' b'\x00\x00\x00\x00' \
 
5480
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
5481
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
5482
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
5475
5483
 
5476
5484
 
5477
5485
    def testPackRequest0(self):
5478
 
        bin = apply(request.SetModifierMapping._request.to_binary, (), self.req_args_0)
 
5486
        bin = request.SetModifierMapping._request.to_binary(*(), **self.req_args_0)
5479
5487
        try:
5480
5488
            assert bin == self.req_bin_0
5481
5489
        except AssertionError:
5493
5501
            raise AssertionError(args)
5494
5502
 
5495
5503
    def testPackReply0(self):
5496
 
        bin = apply(request.SetModifierMapping._reply.to_binary, (), self.reply_args_0)
 
5504
        bin = request.SetModifierMapping._reply.to_binary(*(), **self.reply_args_0)
5497
5505
        try:
5498
5506
            assert bin == self.reply_bin_0
5499
5507
        except AssertionError:
5515
5523
    def setUp(self):
5516
5524
        self.req_args_0 = {
5517
5525
            }
5518
 
        self.req_bin_0 = '\x77\x00\x01\x00'
 
5526
        self.req_bin_0 = b'\x77\x00\x01\x00'
5519
5527
 
5520
5528
        self.reply_args_0 = {
5521
5529
            'keycodes': [[85, 162], [139, 194], [12, 107], [120, 193], [26, 40], [125, 221], [27, 0], [220, 78]],
5522
5530
            'sequence_number': 17677,
5523
5531
            }
5524
 
        self.reply_bin_0 = '\x01\x02\x0d\x45' '\x04\x00\x00\x00' \
5525
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
5526
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
5527
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
5528
 
            '\x55\xa2\x8b\xc2' '\x0c\x6b\x78\xc1' \
5529
 
            '\x1a\x28\x7d\xdd' '\x1b\x00\xdc\x4e'
 
5532
        self.reply_bin_0 = b'\x01\x02\x0d\x45' b'\x04\x00\x00\x00' \
 
5533
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
5534
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
5535
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
5536
            b'\x55\xa2\x8b\xc2' b'\x0c\x6b\x78\xc1' \
 
5537
            b'\x1a\x28\x7d\xdd' b'\x1b\x00\xdc\x4e'
5530
5538
 
5531
5539
 
5532
5540
    def testPackRequest0(self):
5533
 
        bin = apply(request.GetModifierMapping._request.to_binary, (), self.req_args_0)
 
5541
        bin = request.GetModifierMapping._request.to_binary(*(), **self.req_args_0)
5534
5542
        try:
5535
5543
            assert bin == self.req_bin_0
5536
5544
        except AssertionError:
5548
5556
            raise AssertionError(args)
5549
5557
 
5550
5558
    def testPackReply0(self):
5551
 
        bin = apply(request.GetModifierMapping._reply.to_binary, (), self.reply_args_0)
 
5559
        bin = request.GetModifierMapping._reply.to_binary(*(), **self.reply_args_0)
5552
5560
        try:
5553
5561
            assert bin == self.reply_bin_0
5554
5562
        except AssertionError:
5570
5578
    def setUp(self):
5571
5579
        self.req_args_0 = {
5572
5580
            }
5573
 
        self.req_bin_0 = '\x7f\x00\x01\x00'
 
5581
        self.req_bin_0 = b'\x7f\x00\x01\x00'
5574
5582
 
5575
5583
 
5576
5584
    def testPackRequest0(self):
5577
 
        bin = apply(request.NoOperation._request.to_binary, (), self.req_args_0)
 
5585
        bin = request.NoOperation._request.to_binary(*(), **self.req_args_0)
5578
5586
        try:
5579
5587
            assert bin == self.req_bin_0
5580
5588
        except AssertionError: