~bennabiy/+junk/python-xlib

« back to all changes in this revision

Viewing changes to test/test_requests_be.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
            'depth': 186,
76
84
            'width': 51466,
77
85
            }
78
 
        self.req_bin_0 = '\x01\xba\x00\x17' '\x6d\x03\x01\x24' \
79
 
            '\x74\xdb\x41\x4e' '\xae\xdd\xf0\x2f' \
80
 
            '\xc9\x0a\x96\xd0' '\x86\x93\x00\x00' \
81
 
            '\x17\xba\x10\x13' '\x00\x00\x7f\xff' \
82
 
            '\x5e\x67\x63\x43' '\x0c\x77\x07\x07' \
83
 
            '\x76\xc4\x0c\xaa' '\x7f\x48\x9d\x8c' \
84
 
            '\x00\x00\x00\x00' '\x03\x00\x00\x00' \
85
 
            '\x02\x00\x00\x00' '\x56\xac\x9b\x9d' \
86
 
            '\x21\x76\x49\x57' '\x00\x00\x00\x00' \
87
 
            '\x00\x00\x00\x00' '\x15\xf2\xee\x1c' \
88
 
            '\x23\x97\xad\x71' '\x16\x7e\xec\x01' \
89
 
            '\x55\xfd\xbc\xc5'
 
86
        self.req_bin_0 = b'\x01\xba\x00\x17' b'\x6d\x03\x01\x24' \
 
87
            b'\x74\xdb\x41\x4e' b'\xae\xdd\xf0\x2f' \
 
88
            b'\xc9\x0a\x96\xd0' b'\x86\x93\x00\x00' \
 
89
            b'\x17\xba\x10\x13' b'\x00\x00\x7f\xff' \
 
90
            b'\x5e\x67\x63\x43' b'\x0c\x77\x07\x07' \
 
91
            b'\x76\xc4\x0c\xaa' b'\x7f\x48\x9d\x8c' \
 
92
            b'\x00\x00\x00\x00' b'\x03\x00\x00\x00' \
 
93
            b'\x02\x00\x00\x00' b'\x56\xac\x9b\x9d' \
 
94
            b'\x21\x76\x49\x57' b'\x00\x00\x00\x00' \
 
95
            b'\x00\x00\x00\x00' b'\x15\xf2\xee\x1c' \
 
96
            b'\x23\x97\xad\x71' b'\x16\x7e\xec\x01' \
 
97
            b'\x55\xfd\xbc\xc5'
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': 1813552124,
115
123
            'attrs': {'backing_pixel': 59516078, 'cursor': 1682969315, 'background_pixmap': 370313360, 'border_pixmap': 1158771722, 'backing_planes': 1432315664, 'win_gravity': 3, 'backing_store': 1, 'event_mask': 1054128649, 'save_under': 0, 'background_pixel': 1953340842, 'colormap': 1462101672, 'border_pixel': 287436510, 'bit_gravity': 10, 'do_not_propagate_mask': 1283834625, 'override_redirect': 0},
116
124
            }
117
 
        self.req_bin_0 = '\x02\x00\x00\x12' '\x6c\x18\x9b\xfc' \
118
 
            '\x00\x00\x7f\xff' '\x16\x12\x88\x90' \
119
 
            '\x74\x6d\x9d\xaa' '\x45\x11\x74\x0a' \
120
 
            '\x11\x21\xee\xde' '\x0a\x00\x00\x00' \
121
 
            '\x03\x00\x00\x00' '\x01\x00\x00\x00' \
122
 
            '\x55\x5f\x67\x10' '\x03\x8c\x24\xae' \
123
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
124
 
            '\x3e\xd4\xba\x09' '\x4c\x85\xc3\x01' \
125
 
            '\x57\x25\xe6\xa8' '\x64\x50\x12\xe3'
 
125
        self.req_bin_0 = b'\x02\x00\x00\x12' b'\x6c\x18\x9b\xfc' \
 
126
            b'\x00\x00\x7f\xff' b'\x16\x12\x88\x90' \
 
127
            b'\x74\x6d\x9d\xaa' b'\x45\x11\x74\x0a' \
 
128
            b'\x11\x21\xee\xde' b'\x0a\x00\x00\x00' \
 
129
            b'\x03\x00\x00\x00' b'\x01\x00\x00\x00' \
 
130
            b'\x55\x5f\x67\x10' b'\x03\x8c\x24\xae' \
 
131
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
132
            b'\x3e\xd4\xba\x09' b'\x4c\x85\xc3\x01' \
 
133
            b'\x57\x25\xe6\xa8' b'\x64\x50\x12\xe3'
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': 1931593850,
151
159
            }
152
 
        self.req_bin_0 = '\x03\x00\x00\x02' '\x73\x21\xc8\x7a'
 
160
        self.req_bin_0 = b'\x03\x00\x00\x02' b'\x73\x21\xc8\x7a'
153
161
 
154
162
        self.reply_args_0 = {
155
163
            'sequence_number': 60057,
169
177
            'do_not_propagate_mask': 33787,
170
178
            'override_redirect': 0,
171
179
            }
172
 
        self.reply_bin_0 = '\x01\x93\xea\x99' '\x00\x00\x00\x03' \
173
 
            '\x28\xf8\xb5\x19' '\x47\x6c\xfd\x9d' \
174
 
            '\x3b\x04\x67\x99' '\x08\x23\xc5\x49' \
175
 
            '\x00\x00\xb9\x00' '\x45\x39\x51\x8e' \
176
 
            '\x10\x1b\x49\x0c' '\x4f\x6a\xcc\x0f' \
177
 
            '\x83\xfb\x00\x00'
 
180
        self.reply_bin_0 = b'\x01\x93\xea\x99' b'\x00\x00\x00\x03' \
 
181
            b'\x28\xf8\xb5\x19' b'\x47\x6c\xfd\x9d' \
 
182
            b'\x3b\x04\x67\x99' b'\x08\x23\xc5\x49' \
 
183
            b'\x00\x00\xb9\x00' b'\x45\x39\x51\x8e' \
 
184
            b'\x10\x1b\x49\x0c' b'\x4f\x6a\xcc\x0f' \
 
185
            b'\x83\xfb\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': 1622184267,
221
229
            }
222
 
        self.req_bin_0 = '\x04\x00\x00\x02' '\x60\xb0\x91\x4b'
 
230
        self.req_bin_0 = b'\x04\x00\x00\x02' b'\x60\xb0\x91\x4b'
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': 1000376476,
248
256
            }
249
 
        self.req_bin_0 = '\x05\x00\x00\x02' '\x3b\xa0\x88\x9c'
 
257
        self.req_bin_0 = b'\x05\x00\x00\x02' b'\x3b\xa0\x88\x9c'
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': 1577523459,
275
283
            'mode': 0,
276
284
            }
277
 
        self.req_bin_0 = '\x06\x00\x00\x02' '\x5e\x07\x19\x03'
 
285
        self.req_bin_0 = b'\x06\x00\x00\x02' b'\x5e\x07\x19\x03'
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
            'x': -5207,
305
313
            'y': -22675,
306
314
            }
307
 
        self.req_bin_0 = '\x07\x00\x00\x04' '\x4d\x87\xa0\xa0' \
308
 
            '\x04\x4d\x83\x68' '\xeb\xa9\xa7\x6d'
 
315
        self.req_bin_0 = b'\x07\x00\x00\x04' b'\x4d\x87\xa0\xa0' \
 
316
            b'\x04\x4d\x83\x68' b'\xeb\xa9\xa7\x6d'
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': 61469476,
334
342
            }
335
 
        self.req_bin_0 = '\x08\x00\x00\x02' '\x03\xa9\xf3\x24'
 
343
        self.req_bin_0 = b'\x08\x00\x00\x02' b'\x03\xa9\xf3\x24'
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': 818738118,
361
369
            }
362
 
        self.req_bin_0 = '\x09\x00\x00\x02' '\x30\xcc\xf3\xc6'
 
370
        self.req_bin_0 = b'\x09\x00\x00\x02' b'\x30\xcc\xf3\xc6'
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': 1923663468,
388
396
            }
389
 
        self.req_bin_0 = '\x0a\x00\x00\x02' '\x72\xa8\xc6\x6c'
 
397
        self.req_bin_0 = b'\x0a\x00\x00\x02' b'\x72\xa8\xc6\x6c'
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': 999740194,
415
423
            }
416
 
        self.req_bin_0 = '\x0b\x00\x00\x02' '\x3b\x96\xd3\x22'
 
424
        self.req_bin_0 = b'\x0b\x00\x00\x02' b'\x3b\x96\xd3\x22'
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': 190634459,
442
450
            'attrs': {'height': 57788, 'stack_mode': 2, 'border_width': -320, 'width': 53674, 'x': -2248, 'y': -29960, 'sibling': 1012823324},
443
451
            }
444
 
        self.req_bin_0 = '\x0c\x00\x00\x0a' '\x0b\x5c\xd9\xdb' \
445
 
            '\x00\x7f\x00\x00' '\xf7\x38\x00\x00' \
446
 
            '\x8a\xf8\x00\x00' '\xd1\xaa\x00\x00' \
447
 
            '\xe1\xbc\x00\x00' '\xfe\xc0\x00\x00' \
448
 
            '\x3c\x5e\x75\x1c' '\x02\x00\x00\x00'
 
452
        self.req_bin_0 = b'\x0c\x00\x00\x0a' b'\x0b\x5c\xd9\xdb' \
 
453
            b'\x00\x7f\x00\x00' b'\xf7\x38\x00\x00' \
 
454
            b'\x8a\xf8\x00\x00' b'\xd1\xaa\x00\x00' \
 
455
            b'\xe1\xbc\x00\x00' b'\xfe\xc0\x00\x00' \
 
456
            b'\x3c\x5e\x75\x1c' b'\x02\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
            'window': 1712979067,
474
482
            'direction': 1,
475
483
            }
476
 
        self.req_bin_0 = '\x0d\x01\x00\x02' '\x66\x19\xfc\x7b'
 
484
        self.req_bin_0 = b'\x0d\x01\x00\x02' b'\x66\x19\xfc\x7b'
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': 680179490,
502
510
            }
503
 
        self.req_bin_0 = '\x0e\x00\x00\x02' '\x28\x8a\xb7\x22'
 
511
        self.req_bin_0 = b'\x0e\x00\x00\x02' b'\x28\x8a\xb7\x22'
504
512
 
505
513
        self.reply_args_0 = {
506
514
            'height': 64954,
512
520
            'depth': 204,
513
521
            'width': 38433,
514
522
            }
515
 
        self.reply_bin_0 = '\x01\xcc\x9a\x2d' '\x00\x00\x00\x00' \
516
 
            '\x24\x55\x8d\x71' '\xfb\x1b\xd4\x54' \
517
 
            '\x96\x21\xfd\xba' '\x01\xf0\x00\x00' \
518
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
523
        self.reply_bin_0 = b'\x01\xcc\x9a\x2d' b'\x00\x00\x00\x00' \
 
524
            b'\x24\x55\x8d\x71' b'\xfb\x1b\xd4\x54' \
 
525
            b'\x96\x21\xfd\xba' b'\x01\xf0\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': 2052496265,
562
570
            }
563
 
        self.req_bin_0 = '\x0f\x00\x00\x02' '\x7a\x56\x9b\x89'
 
571
        self.req_bin_0 = b'\x0f\x00\x00\x02' b'\x7a\x56\x9b\x89'
564
572
 
565
573
        self.reply_args_0 = {
566
574
            'sequence_number': 33887,
568
576
            'root': 1856577120,
569
577
            'parent': 2105827407,
570
578
            }
571
 
        self.reply_bin_0 = '\x01\x00\x84\x5f' '\x00\x00\x00\x07' \
572
 
            '\x6e\xa9\x1e\x60' '\x7d\x84\x60\x4f' \
573
 
            '\x00\x07\x00\x00' '\x00\x00\x00\x00' \
574
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
575
 
            '\x6b\x09\x3d\x72' '\x59\x14\x21\xa5' \
576
 
            '\x2c\x9a\x2c\x42' '\x2b\x7b\x78\xa1' \
577
 
            '\x4b\x39\x79\x79' '\x03\xd4\x32\x73' \
578
 
            '\x40\xdd\x8e\x53'
 
579
        self.reply_bin_0 = b'\x01\x00\x84\x5f' b'\x00\x00\x00\x07' \
 
580
            b'\x6e\xa9\x1e\x60' b'\x7d\x84\x60\x4f' \
 
581
            b'\x00\x07\x00\x00' b'\x00\x00\x00\x00' \
 
582
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
583
            b'\x6b\x09\x3d\x72' b'\x59\x14\x21\xa5' \
 
584
            b'\x2c\x9a\x2c\x42' b'\x2b\x7b\x78\xa1' \
 
585
            b'\x4b\x39\x79\x79' b'\x03\xd4\x32\x73' \
 
586
            b'\x40\xdd\x8e\x53'
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
            'only_if_exists': 0,
622
630
            'name': 'fuzzy_prop',
623
631
            }
624
 
        self.req_bin_0 = '\x10\x00\x00\x05' '\x00\x0a\x00\x00' \
625
 
            '\x66\x75\x7a\x7a' '\x79\x5f\x70\x72' \
626
 
            '\x6f\x70\x00\x00'
 
632
        self.req_bin_0 = b'\x10\x00\x00\x05' b'\x00\x0a\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
            'atom': 48723297,
630
638
            'sequence_number': 35223,
631
639
            }
632
 
        self.reply_bin_0 = '\x01\x00\x89\x97' '\x00\x00\x00\x00' \
633
 
            '\x02\xe7\x75\x61' '\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\x89\x97' b'\x00\x00\x00\x00' \
 
641
            b'\x02\xe7\x75\x61' 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': 1022286544,
679
687
            }
680
 
        self.req_bin_0 = '\x11\x00\x00\x02' '\x3c\xee\xda\xd0'
 
688
        self.req_bin_0 = b'\x11\x00\x00\x02' b'\x3c\xee\xda\xd0'
681
689
 
682
690
        self.reply_args_0 = {
683
691
            'sequence_number': 22699,
684
692
            'name': 'WM_CLASS',
685
693
            }
686
 
        self.reply_bin_0 = '\x01\x00\x58\xab' '\x00\x00\x00\x02' \
687
 
            '\x00\x08\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\x58\xab' b'\x00\x00\x00\x02' \
 
695
            b'\x00\x08\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
            'window': 266197951,
737
745
            'type': 1343008022,
738
746
            }
739
 
        self.req_bin_0 = '\x12\x00\x00\x06' '\x0f\xdd\xdb\xbf' \
740
 
            '\x7c\x4c\x97\x11' '\x50\x0c\xad\x16' \
741
 
            '\x08\x00\x00\x00' '\x00\x00\x00\x00'
 
747
        self.req_bin_0 = b'\x12\x00\x00\x06' b'\x0f\xdd\xdb\xbf' \
 
748
            b'\x7c\x4c\x97\x11' b'\x50\x0c\xad\x16' \
 
749
            b'\x08\x00\x00\x00' b'\x00\x00\x00\x00'
742
750
 
743
751
        self.req_args_1 = {
744
752
            'mode': 2,
747
755
            'window': 1522118044,
748
756
            'type': 121096013,
749
757
            }
750
 
        self.req_bin_1 = '\x12\x02\x00\x07' '\x5a\xb9\xad\x9c' \
751
 
            '\x1a\xce\x2e\xab' '\x07\x37\xc7\x4d' \
752
 
            '\x08\x00\x00\x00' '\x00\x00\x00\x03' \
753
 
            '\x66\x6f\x6f\x00'
 
758
        self.req_bin_1 = b'\x12\x02\x00\x07' b'\x5a\xb9\xad\x9c' \
 
759
            b'\x1a\xce\x2e\xab' b'\x07\x37\xc7\x4d' \
 
760
            b'\x08\x00\x00\x00' b'\x00\x00\x00\x03' \
 
761
            b'\x66\x6f\x6f\x00'
754
762
 
755
763
        self.req_args_2 = {
756
764
            'mode': 2,
759
767
            'window': 286324270,
760
768
            'type': 1547457396,
761
769
            }
762
 
        self.req_bin_2 = '\x12\x02\x00\x07' '\x11\x10\xf6\x2e' \
763
 
            '\x3c\x30\xf5\x5a' '\x5c\x3c\x53\x74' \
764
 
            '\x08\x00\x00\x00' '\x00\x00\x00\x04' \
765
 
            '\x7a\x6f\x6f\x6d'
 
770
        self.req_bin_2 = b'\x12\x02\x00\x07' b'\x11\x10\xf6\x2e' \
 
771
            b'\x3c\x30\xf5\x5a' b'\x5c\x3c\x53\x74' \
 
772
            b'\x08\x00\x00\x00' b'\x00\x00\x00\x04' \
 
773
            b'\x7a\x6f\x6f\x6d'
766
774
 
767
775
        self.req_args_3 = {
768
776
            'mode': 0,
771
779
            'window': 1964921608,
772
780
            'type': 692879036,
773
781
            }
774
 
        self.req_bin_3 = '\x12\x00\x00\x06' '\x75\x1e\x53\x08' \
775
 
            '\x19\x73\x3e\xc0' '\x29\x4c\x7e\xbc' \
776
 
            '\x10\x00\x00\x00' '\x00\x00\x00\x00'
 
782
        self.req_bin_3 = b'\x12\x00\x00\x06' b'\x75\x1e\x53\x08' \
 
783
            b'\x19\x73\x3e\xc0' b'\x29\x4c\x7e\xbc' \
 
784
            b'\x10\x00\x00\x00' b'\x00\x00\x00\x00'
777
785
 
778
786
        self.req_args_4 = {
779
787
            'mode': 0,
782
790
            'window': 560040176,
783
791
            'type': 2030208993,
784
792
            }
785
 
        self.req_bin_4 = '\x12\x00\x00\x08' '\x21\x61\x88\xf0' \
786
 
            '\x2f\xbe\x64\xa4' '\x79\x02\x87\xe1' \
787
 
            '\x10\x00\x00\x00' '\x00\x00\x00\x03' \
788
 
            '\x00\x01\x00\x02' '\x00\x03\x00\x00'
 
793
        self.req_bin_4 = b'\x12\x00\x00\x08' b'\x21\x61\x88\xf0' \
 
794
            b'\x2f\xbe\x64\xa4' b'\x79\x02\x87\xe1' \
 
795
            b'\x10\x00\x00\x00' b'\x00\x00\x00\x03' \
 
796
            b'\x00\x01\x00\x02' b'\x00\x03\x00\x00'
789
797
 
790
798
        self.req_args_5 = {
791
799
            'mode': 0,
794
802
            'window': 2016421454,
795
803
            'type': 434059096,
796
804
            }
797
 
        self.req_bin_5 = '\x12\x00\x00\x08' '\x78\x30\x26\x4e' \
798
 
            '\x53\x8c\x0f\x22' '\x19\xdf\x37\x58' \
799
 
            '\x10\x00\x00\x00' '\x00\x00\x00\x04' \
800
 
            '\x00\x01\x00\x02' '\x00\x03\x00\x04'
 
805
        self.req_bin_5 = b'\x12\x00\x00\x08' b'\x78\x30\x26\x4e' \
 
806
            b'\x53\x8c\x0f\x22' b'\x19\xdf\x37\x58' \
 
807
            b'\x10\x00\x00\x00' b'\x00\x00\x00\x04' \
 
808
            b'\x00\x01\x00\x02' b'\x00\x03\x00\x04'
801
809
 
802
810
        self.req_args_6 = {
803
811
            'mode': 2,
806
814
            'window': 461926013,
807
815
            'type': 613217208,
808
816
            }
809
 
        self.req_bin_6 = '\x12\x02\x00\x06' '\x1b\x88\x6e\x7d' \
810
 
            '\x3c\x23\x1c\xbb' '\x24\x8c\xf3\xb8' \
811
 
            '\x20\x00\x00\x00' '\x00\x00\x00\x00'
 
817
        self.req_bin_6 = b'\x12\x02\x00\x06' b'\x1b\x88\x6e\x7d' \
 
818
            b'\x3c\x23\x1c\xbb' b'\x24\x8c\xf3\xb8' \
 
819
            b'\x20\x00\x00\x00' b'\x00\x00\x00\x00'
812
820
 
813
821
        self.req_args_7 = {
814
822
            'mode': 1,
817
825
            'window': 367636986,
818
826
            'type': 1085552939,
819
827
            }
820
 
        self.req_bin_7 = '\x12\x01\x00\x09' '\x15\xe9\xb1\xfa' \
821
 
            '\x57\xc4\x9f\x58' '\x40\xb4\x39\x2b' \
822
 
            '\x20\x00\x00\x00' '\x00\x00\x00\x03' \
823
 
            '\x00\x00\x00\x01' '\x00\x00\x00\x02' \
824
 
            '\x00\x00\x00\x03'
 
828
        self.req_bin_7 = b'\x12\x01\x00\x09' b'\x15\xe9\xb1\xfa' \
 
829
            b'\x57\xc4\x9f\x58' b'\x40\xb4\x39\x2b' \
 
830
            b'\x20\x00\x00\x00' b'\x00\x00\x00\x03' \
 
831
            b'\x00\x00\x00\x01' b'\x00\x00\x00\x02' \
 
832
            b'\x00\x00\x00\x03'
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
            'property': 506897017,
976
984
            'window': 381870530,
977
985
            }
978
 
        self.req_bin_0 = '\x13\x00\x00\x03' '\x16\xc2\xe1\xc2' \
979
 
            '\x1e\x36\xa2\x79'
 
986
        self.req_bin_0 = b'\x13\x00\x00\x03' b'\x16\xc2\xe1\xc2' \
 
987
            b'\x1e\x36\xa2\x79'
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
            'window': 1477792536,
1009
1017
            'long_length': 1346507413,
1010
1018
            }
1011
 
        self.req_bin_0 = '\x14\x00\x00\x06' '\x58\x15\x53\x18' \
1012
 
            '\x3c\x11\x6b\x13' '\x5c\xc5\x9b\xa0' \
1013
 
            '\x5d\x30\x8c\xce' '\x50\x42\x12\x95'
 
1019
        self.req_bin_0 = b'\x14\x00\x00\x06' b'\x58\x15\x53\x18' \
 
1020
            b'\x3c\x11\x6b\x13' b'\x5c\xc5\x9b\xa0' \
 
1021
            b'\x5d\x30\x8c\xce' b'\x50\x42\x12\x95'
1014
1022
 
1015
1023
        self.reply_args_0 = {
1016
1024
            'value': (8, ''),
1018
1026
            'property_type': 1392423916,
1019
1027
            'bytes_after': 2046056935,
1020
1028
            }
1021
 
        self.reply_bin_0 = '\x01\x08\x77\x8e' '\x00\x00\x00\x00' \
1022
 
            '\x52\xfe\xb3\xec' '\x79\xf4\x59\xe7' \
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\x77\x8e' b'\x00\x00\x00\x00' \
 
1030
            b'\x52\xfe\xb3\xec' b'\x79\xf4\x59\xe7' \
 
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
            'value': (8, 'foo'),
1029
1037
            'property_type': 186441230,
1030
1038
            'bytes_after': 469299413,
1031
1039
            }
1032
 
        self.reply_bin_1 = '\x01\x08\xac\xf7' '\x00\x00\x00\x01' \
1033
 
            '\x0b\x1c\xde\x0e' '\x1b\xf8\xf0\xd5' \
1034
 
            '\x00\x00\x00\x03' '\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\xac\xf7' b'\x00\x00\x00\x01' \
 
1041
            b'\x0b\x1c\xde\x0e' b'\x1b\xf8\xf0\xd5' \
 
1042
            b'\x00\x00\x00\x03' 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
            'value': (8, 'zoom'),
1041
1049
            'property_type': 1802804296,
1042
1050
            'bytes_after': 1968158856,
1043
1051
            }
1044
 
        self.reply_bin_2 = '\x01\x08\x31\x82' '\x00\x00\x00\x01' \
1045
 
            '\x6b\x74\x9c\x48' '\x75\x4f\xb8\x88' \
1046
 
            '\x00\x00\x00\x04' '\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\x31\x82' b'\x00\x00\x00\x01' \
 
1053
            b'\x6b\x74\x9c\x48' b'\x75\x4f\xb8\x88' \
 
1054
            b'\x00\x00\x00\x04' 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
            'value': (16, []),
1053
1061
            'property_type': 536196393,
1054
1062
            'bytes_after': 1874157309,
1055
1063
            }
1056
 
        self.reply_bin_3 = '\x01\x10\x62\xdf' '\x00\x00\x00\x00' \
1057
 
            '\x1f\xf5\xb5\x29' '\x6f\xb5\x5e\xfd' \
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\x62\xdf' b'\x00\x00\x00\x00' \
 
1065
            b'\x1f\xf5\xb5\x29' b'\x6f\xb5\x5e\xfd' \
 
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
            'value': (16, [1, 2, 3]),
1064
1072
            'property_type': 1046879880,
1065
1073
            'bytes_after': 1952710167,
1066
1074
            }
1067
 
        self.reply_bin_4 = '\x01\x10\x58\x89' '\x00\x00\x00\x02' \
1068
 
            '\x3e\x66\x1e\x88' '\x74\x63\xfe\x17' \
1069
 
            '\x00\x00\x00\x03' '\x00\x00\x00\x00' \
1070
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
1071
 
            '\x00\x01\x00\x02' '\x00\x03\x00\x00'
 
1075
        self.reply_bin_4 = b'\x01\x10\x58\x89' b'\x00\x00\x00\x02' \
 
1076
            b'\x3e\x66\x1e\x88' b'\x74\x63\xfe\x17' \
 
1077
            b'\x00\x00\x00\x03' b'\x00\x00\x00\x00' \
 
1078
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
1079
            b'\x00\x01\x00\x02' b'\x00\x03\x00\x00'
1072
1080
 
1073
1081
        self.reply_args_5 = {
1074
1082
            'value': (16, [1, 2, 3, 4]),
1076
1084
            'property_type': 1014173132,
1077
1085
            'bytes_after': 1791090668,
1078
1086
            }
1079
 
        self.reply_bin_5 = '\x01\x10\x4a\x54' '\x00\x00\x00\x02' \
1080
 
            '\x3c\x73\x0d\xcc' '\x6a\xc1\xdf\xec' \
1081
 
            '\x00\x00\x00\x04' '\x00\x00\x00\x00' \
1082
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
1083
 
            '\x00\x01\x00\x02' '\x00\x03\x00\x04'
 
1087
        self.reply_bin_5 = b'\x01\x10\x4a\x54' b'\x00\x00\x00\x02' \
 
1088
            b'\x3c\x73\x0d\xcc' b'\x6a\xc1\xdf\xec' \
 
1089
            b'\x00\x00\x00\x04' b'\x00\x00\x00\x00' \
 
1090
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
1091
            b'\x00\x01\x00\x02' b'\x00\x03\x00\x04'
1084
1092
 
1085
1093
        self.reply_args_6 = {
1086
1094
            'value': (32, []),
1088
1096
            'property_type': 2053870497,
1089
1097
            'bytes_after': 1727548898,
1090
1098
            }
1091
 
        self.reply_bin_6 = '\x01\x20\xb8\x7a' '\x00\x00\x00\x00' \
1092
 
            '\x7a\x6b\x93\xa1' '\x66\xf8\x4d\xe2' \
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\xb8\x7a' b'\x00\x00\x00\x00' \
 
1100
            b'\x7a\x6b\x93\xa1' b'\x66\xf8\x4d\xe2' \
 
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
            'value': (32, [1, 2, 3]),
1099
1107
            'property_type': 704363625,
1100
1108
            'bytes_after': 1957409055,
1101
1109
            }
1102
 
        self.reply_bin_7 = '\x01\x20\x90\xe6' '\x00\x00\x00\x03' \
1103
 
            '\x29\xfb\xbc\x69' '\x74\xab\xb1\x1f' \
1104
 
            '\x00\x00\x00\x03' '\x00\x00\x00\x00' \
1105
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
1106
 
            '\x00\x00\x00\x01' '\x00\x00\x00\x02' \
1107
 
            '\x00\x00\x00\x03'
 
1110
        self.reply_bin_7 = b'\x01\x20\x90\xe6' b'\x00\x00\x00\x03' \
 
1111
            b'\x29\xfb\xbc\x69' b'\x74\xab\xb1\x1f' \
 
1112
            b'\x00\x00\x00\x03' b'\x00\x00\x00\x00' \
 
1113
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
1114
            b'\x00\x00\x00\x01' b'\x00\x00\x00\x02' \
 
1115
            b'\x00\x00\x00\x03'
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': 91262675,
1277
1285
            }
1278
 
        self.req_bin_0 = '\x15\x00\x00\x02' '\x05\x70\x8e\xd3'
 
1286
        self.req_bin_0 = b'\x15\x00\x00\x02' b'\x05\x70\x8e\xd3'
1279
1287
 
1280
1288
        self.reply_args_0 = {
1281
1289
            'atoms': [580972634, 926488735, 714741529, 408777797, 679906858, 705092899, 2063243279, 893967755, 1591182471, 571137996, 1677110101, 1783836762, 1678219148, 1992402577, 871298793, 1182885899, 1155013854, 1822076326, 2117552706, 1972668469, 1660227078, 1523268962, 694042433],
1282
1290
            'sequence_number': 42191,
1283
1291
            }
1284
 
        self.reply_bin_0 = '\x01\x00\xa4\xcf' '\x00\x00\x00\x17' \
1285
 
            '\x00\x17\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
 
            '\x22\xa0\xf0\x5a' '\x37\x39\x18\x9f' \
1289
 
            '\x2a\x9a\x17\x19' '\x18\x5d\x74\x45' \
1290
 
            '\x28\x86\x8e\x2a' '\x2a\x06\xdd\x23' \
1291
 
            '\x7a\xfa\x98\x0f' '\x35\x48\xdd\x8b' \
1292
 
            '\x5e\xd7\x84\x87' '\x22\x0a\xdf\xcc' \
1293
 
            '\x63\xf6\xab\x55' '\x6a\x53\x30\x5a' \
1294
 
            '\x64\x07\x97\x8c' '\x76\xc1\xa6\x91' \
1295
 
            '\x33\xee\xf6\xe9' '\x46\x81\x68\x0b' \
1296
 
            '\x44\xd8\x1c\xde' '\x6c\x9a\xad\xa6' \
1297
 
            '\x7e\x37\x4a\x42' '\x75\x94\x88\x35' \
1298
 
            '\x62\xf5\x0e\x06' '\x5a\xcb\x3d\x62' \
1299
 
            '\x29\x5e\x3f\x41'
 
1292
        self.reply_bin_0 = b'\x01\x00\xa4\xcf' b'\x00\x00\x00\x17' \
 
1293
            b'\x00\x17\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'\x22\xa0\xf0\x5a' b'\x37\x39\x18\x9f' \
 
1297
            b'\x2a\x9a\x17\x19' b'\x18\x5d\x74\x45' \
 
1298
            b'\x28\x86\x8e\x2a' b'\x2a\x06\xdd\x23' \
 
1299
            b'\x7a\xfa\x98\x0f' b'\x35\x48\xdd\x8b' \
 
1300
            b'\x5e\xd7\x84\x87' b'\x22\x0a\xdf\xcc' \
 
1301
            b'\x63\xf6\xab\x55' b'\x6a\x53\x30\x5a' \
 
1302
            b'\x64\x07\x97\x8c' b'\x76\xc1\xa6\x91' \
 
1303
            b'\x33\xee\xf6\xe9' b'\x46\x81\x68\x0b' \
 
1304
            b'\x44\xd8\x1c\xde' b'\x6c\x9a\xad\xa6' \
 
1305
            b'\x7e\x37\x4a\x42' b'\x75\x94\x88\x35' \
 
1306
            b'\x62\xf5\x0e\x06' b'\x5a\xcb\x3d\x62' \
 
1307
            b'\x29\x5e\x3f\x41'
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
            'window': 1190911777,
1344
1352
            'time': 1606660593,
1345
1353
            }
1346
 
        self.req_bin_0 = '\x16\x00\x00\x04' '\x46\xfb\xdf\x21' \
1347
 
            '\x7b\x74\xe4\x1b' '\x5f\xc3\xb1\xf1'
 
1354
        self.req_bin_0 = b'\x16\x00\x00\x04' b'\x46\xfb\xdf\x21' \
 
1355
            b'\x7b\x74\xe4\x1b' b'\x5f\xc3\xb1\xf1'
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': 819576555,
1373
1381
            }
1374
 
        self.req_bin_0 = '\x17\x00\x00\x02' '\x30\xd9\xbe\xeb'
 
1382
        self.req_bin_0 = b'\x17\x00\x00\x02' b'\x30\xd9\xbe\xeb'
1375
1383
 
1376
1384
        self.reply_args_0 = {
1377
1385
            'sequence_number': 14152,
1378
1386
            'owner': 1922331178,
1379
1387
            }
1380
 
        self.reply_bin_0 = '\x01\x00\x37\x48' '\x00\x00\x00\x00' \
1381
 
            '\x72\x94\x72\x2a' '\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\x37\x48' b'\x00\x00\x00\x00' \
 
1389
            b'\x72\x94\x72\x2a' 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
            'selection': 125139929,
1430
1438
            'requestor': 300355135,
1431
1439
            }
1432
 
        self.req_bin_0 = '\x18\x00\x00\x06' '\x11\xe7\x0e\x3f' \
1433
 
            '\x07\x75\x7b\xd9' '\x75\x8e\x82\x08' \
1434
 
            '\x7f\x6c\x1d\xb7' '\x5f\x0c\x79\xd6'
 
1440
        self.req_bin_0 = b'\x18\x00\x00\x06' b'\x11\xe7\x0e\x3f' \
 
1441
            b'\x07\x75\x7b\xd9' b'\x75\x8e\x82\x08' \
 
1442
            b'\x7f\x6c\x1d\xb7' b'\x5f\x0c\x79\xd6'
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
            'destination': 1369243800,
1462
1470
            'event_mask': 1594482936,
1463
1471
            }
1464
 
        self.req_bin_0 = '\x19\x01\x00\x0b' '\x51\x9d\x00\x98' \
1465
 
            '\x5f\x09\xe0\xf8' '\x0c\x00\x00\x00' \
1466
 
            '\x4e\xce\xfa\x94' '\xcd\x42\xdb\xfc' \
1467
 
            '\x40\xe4\xfd\x10' '\x37\x54\x00\x00' \
1468
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
1469
 
            '\x00\x00\x00\x00'
 
1472
        self.req_bin_0 = b'\x19\x01\x00\x0b' b'\x51\x9d\x00\x98' \
 
1473
            b'\x5f\x09\xe0\xf8' b'\x0c\x00\x00\x00' \
 
1474
            b'\x4e\xce\xfa\x94' b'\xcd\x42\xdb\xfc' \
 
1475
            b'\x40\xe4\xfd\x10' b'\x37\x54\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
            'keyboard_mode': 1,
1501
1509
            'cursor': 17101598,
1502
1510
            }
1503
 
        self.req_bin_0 = '\x1a\x01\x00\x06' '\x7d\x75\x91\xbc' \
1504
 
            '\x08\x1b\x00\x01' '\x76\x82\xb9\x57' \
1505
 
            '\x01\x04\xf3\x1e' '\x4e\x77\x17\xcc'
 
1511
        self.req_bin_0 = b'\x1a\x01\x00\x06' b'\x7d\x75\x91\xbc' \
 
1512
            b'\x08\x1b\x00\x01' b'\x76\x82\xb9\x57' \
 
1513
            b'\x01\x04\xf3\x1e' b'\x4e\x77\x17\xcc'
1506
1514
 
1507
1515
        self.reply_args_0 = {
1508
1516
            'sequence_number': 47539,
1509
1517
            'status': 149,
1510
1518
            }
1511
 
        self.reply_bin_0 = '\x01\x95\xb9\xb3' '\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\x95\xb9\xb3' 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': 209008422,
1558
1566
            }
1559
 
        self.req_bin_0 = '\x1b\x00\x00\x02' '\x0c\x75\x37\x26'
 
1567
        self.req_bin_0 = b'\x1b\x00\x00\x02' b'\x0c\x75\x37\x26'
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
            'keyboard_mode': 1,
1592
1600
            'cursor': 1070323643,
1593
1601
            }
1594
 
        self.req_bin_0 = '\x1c\x01\x00\x06' '\x1f\x60\x42\x88' \
1595
 
            '\x3f\x97\x01\x01' '\x6d\xe8\x6c\x5b' \
1596
 
            '\x3f\xcb\xd7\xbb' '\xd0\x00\x3c\xe5'
 
1602
        self.req_bin_0 = b'\x1c\x01\x00\x06' b'\x1f\x60\x42\x88' \
 
1603
            b'\x3f\x97\x01\x01' b'\x6d\xe8\x6c\x5b' \
 
1604
            b'\x3f\xcb\xd7\xbb' b'\xd0\x00\x3c\xe5'
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
            'button': 240,
1623
1631
            'modifiers': 51717,
1624
1632
            }
1625
 
        self.req_bin_0 = '\x1d\xf0\x00\x03' '\x2f\x69\x0e\x86' \
1626
 
            '\xca\x05\x00\x00'
 
1633
        self.req_bin_0 = b'\x1d\xf0\x00\x03' b'\x2f\x69\x0e\x86' \
 
1634
            b'\xca\x05\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': 23423,
1653
1661
            'cursor': 1696594928,
1654
1662
            }
1655
 
        self.req_bin_0 = '\x1e\x00\x00\x04' '\x65\x1f\xfb\xf0' \
1656
 
            '\x35\x20\xbb\x64' '\x5b\x7f\x00\x00'
 
1663
        self.req_bin_0 = b'\x1e\x00\x00\x04' b'\x65\x1f\xfb\xf0' \
 
1664
            b'\x35\x20\xbb\x64' b'\x5b\x7f\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
            'pointer_mode': 1,
1685
1693
            'keyboard_mode': 1,
1686
1694
            }
1687
 
        self.req_bin_0 = '\x1f\x00\x00\x04' '\x04\x89\xaf\x67' \
1688
 
            '\x5d\x23\x78\xd9' '\x01\x01\x00\x00'
 
1695
        self.req_bin_0 = b'\x1f\x00\x00\x04' b'\x04\x89\xaf\x67' \
 
1696
            b'\x5d\x23\x78\xd9' b'\x01\x01\x00\x00'
1689
1697
 
1690
1698
        self.reply_args_0 = {
1691
1699
            'sequence_number': 9648,
1692
1700
            'status': 129,
1693
1701
            }
1694
 
        self.reply_bin_0 = '\x01\x81\x25\xb0' '\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\x81\x25\xb0' 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': 1352311886,
1741
1749
            }
1742
 
        self.req_bin_0 = '\x20\x00\x00\x02' '\x50\x9a\xa4\x4e'
 
1750
        self.req_bin_0 = b'\x20\x00\x00\x02' b'\x50\x9a\xa4\x4e'
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
            'modifiers': 28819,
1772
1780
            'key': 193,
1773
1781
            }
1774
 
        self.req_bin_0 = '\x21\x01\x00\x04' '\x57\x78\x21\xf0' \
1775
 
            '\x70\x93\xc1\x00' '\x00\x00\x00\x00'
 
1782
        self.req_bin_0 = b'\x21\x01\x00\x04' b'\x57\x78\x21\xf0' \
 
1783
            b'\x70\x93\xc1\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
            'key': 215,
1802
1810
            'modifiers': 60588,
1803
1811
            }
1804
 
        self.req_bin_0 = '\x22\xd7\x00\x03' '\x2d\xe4\x31\xbb' \
1805
 
            '\xec\xac\x00\x00'
 
1812
        self.req_bin_0 = b'\x22\xd7\x00\x03' b'\x2d\xe4\x31\xbb' \
 
1813
            b'\xec\xac\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
            'time': 342147129,
1831
1839
            'mode': 1,
1832
1840
            }
1833
 
        self.req_bin_0 = '\x23\x01\x00\x02' '\x14\x64\xc0\x39'
 
1841
        self.req_bin_0 = b'\x23\x01\x00\x02' b'\x14\x64\xc0\x39'
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\x00\x01'
 
1867
        self.req_bin_0 = b'\x24\x00\x00\x01'
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\x00\x01'
 
1893
        self.req_bin_0 = b'\x25\x00\x00\x01'
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': 561336799,
1911
1919
            }
1912
 
        self.req_bin_0 = '\x26\x00\x00\x02' '\x21\x75\x51\xdf'
 
1920
        self.req_bin_0 = b'\x26\x00\x00\x02' b'\x21\x75\x51\xdf'
1913
1921
 
1914
1922
        self.reply_args_0 = {
1915
1923
            'win_y': -25733,
1922
1930
            'child': 1075058918,
1923
1931
            'win_x': -18858,
1924
1932
            }
1925
 
        self.reply_bin_0 = '\x01\x00\xa1\xe8' '\x00\x00\x00\x00' \
1926
 
            '\x5f\x52\x73\x56' '\x40\x14\x18\xe6' \
1927
 
            '\xef\xa7\xe8\x20' '\xb6\x56\x9b\x7b' \
1928
 
            '\x8c\x73\x00\x00' '\x00\x00\x00\x00'
 
1933
        self.reply_bin_0 = b'\x01\x00\xa1\xe8' b'\x00\x00\x00\x00' \
 
1934
            b'\x5f\x52\x73\x56' b'\x40\x14\x18\xe6' \
 
1935
            b'\xef\xa7\xe8\x20' b'\xb6\x56\x9b\x7b' \
 
1936
            b'\x8c\x73\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
            'start': 1520150500,
1973
1981
            'stop': 11115313,
1974
1982
            }
1975
 
        self.req_bin_0 = '\x27\x00\x00\x04' '\x32\x49\x8f\xf4' \
1976
 
            '\x5a\x9b\xa7\xe4' '\x00\xa9\x9b\x31'
 
1983
        self.req_bin_0 = b'\x27\x00\x00\x04' b'\x32\x49\x8f\xf4' \
 
1984
            b'\x5a\x9b\xa7\xe4' b'\x00\xa9\x9b\x31'
1977
1985
 
1978
1986
        self.reply_args_0 = {
1979
1987
            'sequence_number': 52222,
1980
1988
            'events': [{'time': 2107444516, 'x': -649, 'y': -11631}, {'time': 1827536960, 'x': -18061, 'y': -2301}, {'time': 554175146, 'x': -32111, 'y': -13522}, {'time': 608168588, 'x': -5963, 'y': -24618}, {'time': 590416221, 'x': -3325, 'y': -19656}],
1981
1989
            }
1982
 
        self.reply_bin_0 = '\x01\x00\xcb\xfe' '\x00\x00\x00\x0a' \
1983
 
            '\x00\x00\x00\x05' '\x00\x00\x00\x00' \
1984
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
1985
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
1986
 
            '\x7d\x9d\x0d\x24' '\xfd\x77\xd2\x91' \
1987
 
            '\x6c\xee\x00\x40' '\xb9\x73\xf7\x03' \
1988
 
            '\x21\x08\x0a\xaa' '\x82\x91\xcb\x2e' \
1989
 
            '\x24\x3f\xea\x8c' '\xe8\xb5\x9f\xd6' \
1990
 
            '\x23\x31\x09\x5d' '\xf3\x03\xb3\x38'
 
1990
        self.reply_bin_0 = b'\x01\x00\xcb\xfe' b'\x00\x00\x00\x0a' \
 
1991
            b'\x00\x00\x00\x05' 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'\x7d\x9d\x0d\x24' b'\xfd\x77\xd2\x91' \
 
1995
            b'\x6c\xee\x00\x40' b'\xb9\x73\xf7\x03' \
 
1996
            b'\x21\x08\x0a\xaa' b'\x82\x91\xcb\x2e' \
 
1997
            b'\x24\x3f\xea\x8c' b'\xe8\xb5\x9f\xd6' \
 
1998
            b'\x23\x31\x09\x5d' b'\xf3\x03\xb3\x38'
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_wid': 257619448,
2036
2044
            'dst_wid': 1238981863,
2037
2045
            }
2038
 
        self.req_bin_0 = '\x28\x00\x00\x04' '\x0f\x5a\xf5\xf8' \
2039
 
            '\x49\xd9\x5c\xe7' '\x9d\x0d\x95\x91'
 
2046
        self.req_bin_0 = b'\x28\x00\x00\x04' b'\x0f\x5a\xf5\xf8' \
 
2047
            b'\x49\xd9\x5c\xe7' b'\x9d\x0d\x95\x91'
2040
2048
 
2041
2049
        self.reply_args_0 = {
2042
2050
            'child': 2050350678,
2045
2053
            'x': -18096,
2046
2054
            'y': -5252,
2047
2055
            }
2048
 
        self.reply_bin_0 = '\x01\x01\x97\x01' '\x00\x00\x00\x00' \
2049
 
            '\x7a\x35\xde\x56' '\xb9\x50\xeb\x7c' \
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\x01\x97\x01' b'\x00\x00\x00\x00' \
 
2057
            b'\x7a\x35\xde\x56' b'\xb9\x50\xeb\x7c' \
 
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_x': -30516,
2101
2109
            'dst_y': -24204,
2102
2110
            }
2103
 
        self.req_bin_0 = '\x29\x00\x00\x06' '\x4f\x93\xba\xef' \
2104
 
            '\x28\x44\x07\xf4' '\x96\x11\x9a\x29' \
2105
 
            '\x55\x31\xdd\x3a' '\x88\xcc\xa1\x74'
 
2111
        self.req_bin_0 = b'\x29\x00\x00\x06' b'\x4f\x93\xba\xef' \
 
2112
            b'\x28\x44\x07\xf4' b'\x96\x11\x9a\x29' \
 
2113
            b'\x55\x31\xdd\x3a' b'\x88\xcc\xa1\x74'
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
            'time': 1079702500,
2132
2140
            'focus': 1026400247,
2133
2141
            }
2134
 
        self.req_bin_0 = '\x2a\x01\x00\x03' '\x3d\x2d\x9f\xf7' \
2135
 
            '\x40\x5a\xf3\xe4'
 
2142
        self.req_bin_0 = b'\x2a\x01\x00\x03' b'\x3d\x2d\x9f\xf7' \
 
2143
            b'\x40\x5a\xf3\xe4'
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\x00\x01'
 
2169
        self.req_bin_0 = b'\x2b\x00\x00\x01'
2162
2170
 
2163
2171
        self.reply_args_0 = {
2164
2172
            'revert_to': 152,
2165
2173
            'sequence_number': 16002,
2166
2174
            'focus': 2024022965,
2167
2175
            }
2168
 
        self.reply_bin_0 = '\x01\x98\x3e\x82' '\x00\x00\x00\x00' \
2169
 
            '\x78\xa4\x23\xb5' '\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\x98\x3e\x82' b'\x00\x00\x00\x00' \
 
2177
            b'\x78\xa4\x23\xb5' 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\x00\x01'
 
2223
        self.req_bin_0 = b'\x2c\x00\x00\x01'
2216
2224
 
2217
2225
        self.reply_args_0 = {
2218
2226
            'sequence_number': 16233,
2219
2227
            'map': [186, 167, 191, 213, 241, 231, 234, 175, 154, 169, 132, 146, 215, 191, 196, 212, 158, 156, 177, 233, 220, 192, 130, 226, 181, 233, 238, 141, 129, 215, 245, 215],
2220
2228
            }
2221
 
        self.reply_bin_0 = '\x01\x00\x3f\x69' '\x00\x00\x00\x02' \
2222
 
            '\xba\xa7\xbf\xd5' '\xf1\xe7\xea\xaf' \
2223
 
            '\x9a\xa9\x84\x92' '\xd7\xbf\xc4\xd4' \
2224
 
            '\x9e\x9c\xb1\xe9' '\xdc\xc0\x82\xe2' \
2225
 
            '\xb5\xe9\xee\x8d' '\x81\xd7\xf5\xd7'
 
2229
        self.reply_bin_0 = b'\x01\x00\x3f\x69' b'\x00\x00\x00\x02' \
 
2230
            b'\xba\xa7\xbf\xd5' b'\xf1\xe7\xea\xaf' \
 
2231
            b'\x9a\xa9\x84\x92' b'\xd7\xbf\xc4\xd4' \
 
2232
            b'\x9e\x9c\xb1\xe9' b'\xdc\xc0\x82\xe2' \
 
2233
            b'\xb5\xe9\xee\x8d' b'\x81\xd7\xf5\xd7'
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
            'fid': 1728036313,
2269
2277
            'name': 'foofont',
2270
2278
            }
2271
 
        self.req_bin_0 = '\x2d\x00\x00\x05' '\x66\xff\xbd\xd9' \
2272
 
            '\x00\x07\x00\x00' '\x66\x6f\x6f\x66' \
2273
 
            '\x6f\x6e\x74\x00'
 
2279
        self.req_bin_0 = b'\x2d\x00\x00\x05' b'\x66\xff\xbd\xd9' \
 
2280
            b'\x00\x07\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': 1139770507,
2299
2307
            }
2300
 
        self.req_bin_0 = '\x2e\x00\x00\x02' '\x43\xef\x84\x8b'
 
2308
        self.req_bin_0 = b'\x2e\x00\x00\x02' b'\x43\xef\x84\x8b'
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': 1867659050,
2326
2334
            }
2327
 
        self.req_bin_0 = '\x2f\x00\x00\x02' '\x6f\x52\x37\x2a'
 
2335
        self.req_bin_0 = b'\x2f\x00\x00\x02' b'\x6f\x52\x37\x2a'
2328
2336
 
2329
2337
        self.reply_args_0 = {
2330
2338
            'sequence_number': 8877,
2342
2350
            'font_descent': -23067,
2343
2351
            'max_bounds': {'descent': -24292, 'ascent': -26972, 'character_width': -19286, 'left_side_bearing': -16363, 'right_side_bearing': -3149, 'attributes': 35968},
2344
2352
            }
2345
 
        self.reply_bin_0 = '\x01\x00\x22\xad' '\x00\x00\x00\x12' \
2346
 
            '\xae\xfc\xab\x3e' '\xeb\x5a\x96\x67' \
2347
 
            '\x8b\x8b\x2c\x80' '\x00\x00\x00\x00' \
2348
 
            '\xc0\x15\xf3\xb3' '\xb4\xaa\x96\xa4' \
2349
 
            '\xa1\x1c\x8c\x80' '\x00\x00\x00\x00' \
2350
 
            '\xc0\xd0\x09\xd4' '\x23\x22\x00\x01' \
2351
 
            '\x8f\xbe\xa8\x01' '\xc2\xe2\xa5\xe5' \
2352
 
            '\x00\x00\x00\x03' '\x56\x76\x30\xf3' \
2353
 
            '\x7d\xc9\x5e\x19' '\xee\x57\xd9\x6d' \
2354
 
            '\x90\x97\xc7\x8a' '\xfe\xb5\xd7\x97' \
2355
 
            '\xb0\x53\x9d\x9d' '\xee\x4c\xe7\x7a' \
2356
 
            '\xb6\xcd\x73\x24' '\xb1\x9c\xfc\x76' \
2357
 
            '\xaa\xa1\xf6\xb6' '\xb8\x33\x86\x51'
 
2353
        self.reply_bin_0 = b'\x01\x00\x22\xad' b'\x00\x00\x00\x12' \
 
2354
            b'\xae\xfc\xab\x3e' b'\xeb\x5a\x96\x67' \
 
2355
            b'\x8b\x8b\x2c\x80' b'\x00\x00\x00\x00' \
 
2356
            b'\xc0\x15\xf3\xb3' b'\xb4\xaa\x96\xa4' \
 
2357
            b'\xa1\x1c\x8c\x80' b'\x00\x00\x00\x00' \
 
2358
            b'\xc0\xd0\x09\xd4' b'\x23\x22\x00\x01' \
 
2359
            b'\x8f\xbe\xa8\x01' b'\xc2\xe2\xa5\xe5' \
 
2360
            b'\x00\x00\x00\x03' b'\x56\x76\x30\xf3' \
 
2361
            b'\x7d\xc9\x5e\x19' b'\xee\x57\xd9\x6d' \
 
2362
            b'\x90\x97\xc7\x8a' b'\xfe\xb5\xd7\x97' \
 
2363
            b'\xb0\x53\x9d\x9d' b'\xee\x4c\xe7\x7a' \
 
2364
            b'\xb6\xcd\x73\x24' b'\xb1\x9c\xfc\x76' \
 
2365
            b'\xaa\xa1\xf6\xb6' b'\xb8\x33\x86\x51'
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': 1562125736,
2401
2409
            'string': (102, 111, 111),
2402
2410
            }
2403
 
        self.req_bin_0 = '\x30\x01\x00\x04' '\x5d\x1c\x25\xa8' \
2404
 
            '\x00\x66\x00\x6f' '\x00\x6f\x00\x00'
 
2411
        self.req_bin_0 = b'\x30\x01\x00\x04' b'\x5d\x1c\x25\xa8' \
 
2412
            b'\x00\x66\x00\x6f' b'\x00\x6f\x00\x00'
2405
2413
 
2406
2414
        self.reply_args_0 = {
2407
2415
            'overall_width': -1378352414,
2414
2422
            'overall_left': -1046976699,
2415
2423
            'font_descent': -14179,
2416
2424
            }
2417
 
        self.reply_bin_0 = '\x01\xdb\x1a\x87' '\x00\x00\x00\x00' \
2418
 
            '\xbd\xed\xc8\x9d' '\xa6\x82\xf8\xfd' \
2419
 
            '\xad\xd8\x02\xe2' '\xc1\x98\x67\x45' \
2420
 
            '\xe0\x64\x80\xea' '\x00\x00\x00\x00'
 
2425
        self.reply_bin_0 = b'\x01\xdb\x1a\x87' b'\x00\x00\x00\x00' \
 
2426
            b'\xbd\xed\xc8\x9d' b'\xa6\x82\xf8\xfd' \
 
2427
            b'\xad\xd8\x02\xe2' b'\xc1\x98\x67\x45' \
 
2428
            b'\xe0\x64\x80\xea' 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
            'max_names': 53961,
2464
2472
            'pattern': 'bhazr',
2465
2473
            }
2466
 
        self.req_bin_0 = '\x31\x00\x00\x04' '\xd2\xc9\x00\x05' \
2467
 
            '\x62\x68\x61\x7a' '\x72\x00\x00\x00'
 
2474
        self.req_bin_0 = b'\x31\x00\x00\x04' b'\xd2\xc9\x00\x05' \
 
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': 38267,
2472
2480
            }
2473
 
        self.reply_bin_0 = '\x01\x00\x95\x7b' '\x00\x00\x00\x05' \
2474
 
            '\x00\x03\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\x95\x7b' b'\x00\x00\x00\x05' \
 
2482
            b'\x00\x03\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
            'max_names': 46571,
2523
2531
            'pattern': 'bhazr2',
2524
2532
            }
2525
 
        self.req_bin_0 = '\x32\x00\x00\x04' '\xb5\xeb\x00\x06' \
2526
 
            '\x62\x68\x61\x7a' '\x72\x32\x00\x00'
 
2533
        self.req_bin_0 = b'\x32\x00\x00\x04' b'\xb5\xeb\x00\x06' \
 
2534
            b'\x62\x68\x61\x7a' b'\x72\x32\x00\x00'
2527
2535
 
2528
2536
        self.reply_args_0 = {
2529
2537
            'sequence_number': 20014,
2542
2550
            'font_descent': -28978,
2543
2551
            'max_bounds': {'descent': -20692, 'ascent': -6999, 'character_width': -15180, 'left_side_bearing': -7789, 'right_side_bearing': -5339, 'attributes': 1068},
2544
2552
            }
2545
 
        self.reply_bin_0 = '\x01\x08\x4e\x2e' '\x00\x00\x00\x0b' \
2546
 
            '\x8b\xb9\x83\x5c' '\xcd\x1e\xc6\x49' \
2547
 
            '\x93\x43\x09\xa1' '\x00\x00\x00\x00' \
2548
 
            '\xe1\x93\xeb\x25' '\xc4\xb4\xe4\xa9' \
2549
 
            '\xaf\x2c\x04\x2c' '\x00\x00\x00\x00' \
2550
 
            '\x68\x0e\x09\xaf' '\x42\x91\x00\x01' \
2551
 
            '\xc0\xd6\xd9\x00' '\x88\xaa\x8e\xce' \
2552
 
            '\x76\x53\x9a\xa2' '\x19\xfc\x2b\xb0' \
2553
 
            '\x7d\xca\x9c\xc9' '\x66\x6f\x6e\x74' \
2554
 
            '\x66\x6f\x6e\x74'
 
2553
        self.reply_bin_0 = b'\x01\x08\x4e\x2e' b'\x00\x00\x00\x0b' \
 
2554
            b'\x8b\xb9\x83\x5c' b'\xcd\x1e\xc6\x49' \
 
2555
            b'\x93\x43\x09\xa1' b'\x00\x00\x00\x00' \
 
2556
            b'\xe1\x93\xeb\x25' b'\xc4\xb4\xe4\xa9' \
 
2557
            b'\xaf\x2c\x04\x2c' b'\x00\x00\x00\x00' \
 
2558
            b'\x68\x0e\x09\xaf' b'\x42\x91\x00\x01' \
 
2559
            b'\xc0\xd6\xd9\x00' b'\x88\xaa\x8e\xce' \
 
2560
            b'\x76\x53\x9a\xa2' b'\x19\xfc\x2b\xb0' \
 
2561
            b'\x7d\xca\x9c\xc9' 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\x00\x06' '\x00\x03\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\x00\x06' b'\x00\x03\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\x00\x02' '\x00\x00\x00\x00'
 
2614
        self.req_bin_1 = b'\x33\x00\x00\x02' 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\x00\x01'
 
2658
        self.req_bin_0 = b'\x34\x00\x00\x01'
2651
2659
 
2652
2660
        self.reply_args_0 = {
2653
2661
            'sequence_number': 21510,
2654
2662
            'paths': ['path1', 'path2232'],
2655
2663
            }
2656
 
        self.reply_bin_0 = '\x01\x00\x54\x06' '\x00\x00\x00\x04' \
2657
 
            '\x00\x02\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\x54\x06' b'\x00\x00\x00\x04' \
 
2665
            b'\x00\x02\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
            'sequence_number': 62463,
2665
2673
            'paths': [],
2666
2674
            }
2667
 
        self.reply_bin_1 = '\x01\x00\xf3\xff' '\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\xf3\xff' 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
            'depth': 145,
2735
2743
            'width': 5641,
2736
2744
            }
2737
 
        self.req_bin_0 = '\x35\x91\x00\x04' '\x37\x39\x21\x50' \
2738
 
            '\x09\xab\xe8\xd2' '\x16\x09\xff\xeb'
 
2745
        self.req_bin_0 = b'\x35\x91\x00\x04' b'\x37\x39\x21\x50' \
 
2746
            b'\x09\xab\xe8\xd2' b'\x16\x09\xff\xeb'
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': 213012851,
2764
2772
            }
2765
 
        self.req_bin_0 = '\x36\x00\x00\x02' '\x0c\xb2\x51\x73'
 
2773
        self.req_bin_0 = b'\x36\x00\x00\x02' b'\x0c\xb2\x51\x73'
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
            'drawable': 456876463,
2792
2800
            'attrs': {'dashes': 183, 'fill_rule': 0, 'clip_mask': 620422624, 'plane_mask': 1797423280, 'line_style': 1, 'tile': 77620460, 'arc_mode': 0, 'clip_y_origin': -7419, 'dash_offset': 62459, 'line_width': 50494, 'background': 44336037, 'clip_x_origin': -32045, 'join_style': 2, 'graphics_exposures': 0, 'font': 95118395, 'tile_stipple_y_origin': -17619, 'stipple': 631657813, 'fill_style': 0, 'cap_style': 0, 'subwindow_mode': 0, 'tile_stipple_x_origin': -12494, 'foreground': 2096879871, 'function': 10},
2793
2801
            }
2794
 
        self.req_bin_0 = '\x37\x00\x00\x1b' '\x3f\x38\x5c\x6a' \
2795
 
            '\x1b\x3b\x61\xaf' '\x00\x7f\xff\xff' \
2796
 
            '\x0a\x00\x00\x00' '\x6b\x22\x80\xb0' \
2797
 
            '\x7c\xfb\xd8\xff' '\x02\xa4\x83\xa5' \
2798
 
            '\xc5\x3e\x00\x00' '\x01\x00\x00\x00' \
2799
 
            '\x00\x00\x00\x00' '\x02\x00\x00\x00' \
2800
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
2801
 
            '\x04\xa0\x64\xec' '\x25\xa6\x55\x55' \
2802
 
            '\xcf\x32\x00\x00' '\xbb\x2d\x00\x00' \
2803
 
            '\x05\xab\x64\x3b' '\x00\x00\x00\x00' \
2804
 
            '\x00\x00\x00\x00' '\x82\xd3\x00\x00' \
2805
 
            '\xe3\x05\x00\x00' '\x24\xfa\xe5\xe0' \
2806
 
            '\xf3\xfb\x00\x00' '\xb7\x00\x00\x00' \
2807
 
            '\x00\x00\x00\x00'
 
2802
        self.req_bin_0 = b'\x37\x00\x00\x1b' b'\x3f\x38\x5c\x6a' \
 
2803
            b'\x1b\x3b\x61\xaf' b'\x00\x7f\xff\xff' \
 
2804
            b'\x0a\x00\x00\x00' b'\x6b\x22\x80\xb0' \
 
2805
            b'\x7c\xfb\xd8\xff' b'\x02\xa4\x83\xa5' \
 
2806
            b'\xc5\x3e\x00\x00' b'\x01\x00\x00\x00' \
 
2807
            b'\x00\x00\x00\x00' b'\x02\x00\x00\x00' \
 
2808
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
2809
            b'\x04\xa0\x64\xec' b'\x25\xa6\x55\x55' \
 
2810
            b'\xcf\x32\x00\x00' b'\xbb\x2d\x00\x00' \
 
2811
            b'\x05\xab\x64\x3b' b'\x00\x00\x00\x00' \
 
2812
            b'\x00\x00\x00\x00' b'\x82\xd3\x00\x00' \
 
2813
            b'\xe3\x05\x00\x00' b'\x24\xfa\xe5\xe0' \
 
2814
            b'\xf3\xfb\x00\x00' b'\xb7\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
            'attrs': {'dashes': 249, 'fill_rule': 1, 'clip_mask': 496525721, 'plane_mask': 1467281901, 'line_style': 2, 'tile': 1713935374, 'arc_mode': 0, 'clip_y_origin': -24572, 'dash_offset': 46636, 'line_width': 61036, 'background': 1598773587, 'clip_x_origin': -19725, 'join_style': 1, 'graphics_exposures': 0, 'font': 429323306, 'tile_stipple_y_origin': -11767, 'stipple': 1365263649, 'fill_style': 2, 'cap_style': 1, 'subwindow_mode': 1, 'tile_stipple_x_origin': -23501, 'foreground': 1272378077, 'function': 11},
2833
2841
            'gc': 518903558,
2834
2842
            }
2835
 
        self.req_bin_0 = '\x38\x00\x00\x1a' '\x1e\xed\xd7\x06' \
2836
 
            '\x00\x7f\xff\xff' '\x0b\x00\x00\x00' \
2837
 
            '\x57\x74\xf1\xed' '\x4b\xd6\xf2\xdd' \
2838
 
            '\x5f\x4b\x59\x53' '\xee\x6c\x00\x00' \
2839
 
            '\x02\x00\x00\x00' '\x01\x00\x00\x00' \
2840
 
            '\x01\x00\x00\x00' '\x02\x00\x00\x00' \
2841
 
            '\x01\x00\x00\x00' '\x66\x28\x94\x0e' \
2842
 
            '\x51\x60\x45\x21' '\xa4\x33\x00\x00' \
2843
 
            '\xd2\x09\x00\x00' '\x19\x96\xf4\x2a' \
2844
 
            '\x01\x00\x00\x00' '\x00\x00\x00\x00' \
2845
 
            '\xb2\xf3\x00\x00' '\xa0\x04\x00\x00' \
2846
 
            '\x1d\x98\x61\x99' '\xb6\x2c\x00\x00' \
2847
 
            '\xf9\x00\x00\x00' '\x00\x00\x00\x00'
 
2843
        self.req_bin_0 = b'\x38\x00\x00\x1a' b'\x1e\xed\xd7\x06' \
 
2844
            b'\x00\x7f\xff\xff' b'\x0b\x00\x00\x00' \
 
2845
            b'\x57\x74\xf1\xed' b'\x4b\xd6\xf2\xdd' \
 
2846
            b'\x5f\x4b\x59\x53' b'\xee\x6c\x00\x00' \
 
2847
            b'\x02\x00\x00\x00' b'\x01\x00\x00\x00' \
 
2848
            b'\x01\x00\x00\x00' b'\x02\x00\x00\x00' \
 
2849
            b'\x01\x00\x00\x00' b'\x66\x28\x94\x0e' \
 
2850
            b'\x51\x60\x45\x21' b'\xa4\x33\x00\x00' \
 
2851
            b'\xd2\x09\x00\x00' b'\x19\x96\xf4\x2a' \
 
2852
            b'\x01\x00\x00\x00' b'\x00\x00\x00\x00' \
 
2853
            b'\xb2\xf3\x00\x00' b'\xa0\x04\x00\x00' \
 
2854
            b'\x1d\x98\x61\x99' b'\xb6\x2c\x00\x00' \
 
2855
            b'\xf9\x00\x00\x00' b'\x00\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
            'src_gc': 1958847367,
2874
2882
            'dst_gc': 1311353896,
2875
2883
            }
2876
 
        self.req_bin_0 = '\x39\x00\x00\x04' '\x74\xc1\xa3\x87' \
2877
 
            '\x4e\x29\xac\x28' '\x3d\xfc\x5c\x92'
 
2884
        self.req_bin_0 = b'\x39\x00\x00\x04' b'\x74\xc1\xa3\x87' \
 
2885
            b'\x4e\x29\xac\x28' b'\x3d\xfc\x5c\x92'
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
            'dash_offset': 51693,
2904
2912
            'gc': 1639787502,
2905
2913
            }
2906
 
        self.req_bin_0 = '\x3a\x00\x00\x06' '\x61\xbd\x2b\xee' \
2907
 
            '\xc9\xed\x00\x09' '\xa9\xf1\x9e\xee' \
2908
 
            '\xad\x9f\xb6\x8b' '\x8b\x00\x00\x00'
 
2914
        self.req_bin_0 = b'\x3a\x00\x00\x06' b'\x61\xbd\x2b\xee' \
 
2915
            b'\xc9\xed\x00\x09' b'\xa9\xf1\x9e\xee' \
 
2916
            b'\xad\x9f\xb6\x8b' b'\x8b\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
            'y_origin': -16557,
2937
2945
            'ordering': 3,
2938
2946
            }
2939
 
        self.req_bin_0 = '\x3b\x03\x00\x07' '\x41\xe7\x44\x74' \
2940
 
            '\xa7\x18\xbf\x53' '\xc3\xba\xf4\x3f' \
2941
 
            '\xb6\x51\xe7\xff' '\xc9\x22\x9e\xe7' \
2942
 
            '\x1e\x66\x26\x9b'
 
2947
        self.req_bin_0 = b'\x3b\x03\x00\x07' b'\x41\xe7\x44\x74' \
 
2948
            b'\xa7\x18\xbf\x53' b'\xc3\xba\xf4\x3f' \
 
2949
            b'\xb6\x51\xe7\xff' b'\xc9\x22\x9e\xe7' \
 
2950
            b'\x1e\x66\x26\x9b'
2943
2951
 
2944
2952
        self.req_args_1 = {
2945
2953
            'rectangles': [],
2948
2956
            'y_origin': -10293,
2949
2957
            'ordering': 0,
2950
2958
            }
2951
 
        self.req_bin_1 = '\x3b\x00\x00\x03' '\x11\x60\x29\xbb' \
2952
 
            '\x8b\x55\xd7\xcb'
 
2959
        self.req_bin_1 = b'\x3b\x00\x00\x03' b'\x11\x60\x29\xbb' \
 
2960
            b'\x8b\x55\xd7\xcb'
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': 371787524,
2996
3004
            }
2997
 
        self.req_bin_0 = '\x3c\x00\x00\x02' '\x16\x29\x07\x04'
 
3005
        self.req_bin_0 = b'\x3c\x00\x00\x02' b'\x16\x29\x07\x04'
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
            'x': -1843,
3027
3035
            'y': -32148,
3028
3036
            }
3029
 
        self.req_bin_0 = '\x3d\x00\x00\x04' '\x4a\xbe\x68\xe1' \
3030
 
            '\xf8\xcd\x82\x6c' '\xf9\x4d\xd2\x10'
 
3037
        self.req_bin_0 = b'\x3d\x00\x00\x04' b'\x4a\xbe\x68\xe1' \
 
3038
            b'\xf8\xcd\x82\x6c' b'\xf9\x4d\xd2\x10'
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
            'dst_x': -19068,
3063
3071
            'dst_y': -4602,
3064
3072
            }
3065
 
        self.req_bin_0 = '\x3e\x00\x00\x07' '\x13\x2d\x11\x29' \
3066
 
            '\x0f\x05\x83\xf1' '\x07\x83\xb2\x60' \
3067
 
            '\x9c\x38\xdf\x4c' '\xb5\x84\xee\x06' \
3068
 
            '\xc1\x06\xf0\x3e'
 
3073
        self.req_bin_0 = b'\x3e\x00\x00\x07' b'\x13\x2d\x11\x29' \
 
3074
            b'\x0f\x05\x83\xf1' b'\x07\x83\xb2\x60' \
 
3075
            b'\x9c\x38\xdf\x4c' b'\xb5\x84\xee\x06' \
 
3076
            b'\xc1\x06\xf0\x3e'
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
            'dst_x': -24940,
3102
3110
            'dst_y': -13009,
3103
3111
            }
3104
 
        self.req_bin_0 = '\x3f\x00\x00\x08' '\x76\x88\x65\x19' \
3105
 
            '\x7e\x6a\x2e\xa4' '\x4b\x78\x61\xdd' \
3106
 
            '\xee\x42\xa8\x7f' '\x9e\x94\xcd\x2f' \
3107
 
            '\xa1\x19\x83\xfb' '\x7a\x50\x0a\x28'
 
3112
        self.req_bin_0 = b'\x3f\x00\x00\x08' b'\x76\x88\x65\x19' \
 
3113
            b'\x7e\x6a\x2e\xa4' b'\x4b\x78\x61\xdd' \
 
3114
            b'\xee\x42\xa8\x7f' b'\x9e\x94\xcd\x2f' \
 
3115
            b'\xa1\x19\x83\xfb' b'\x7a\x50\x0a\x28'
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
            'drawable': 1008674,
3135
3143
            'coord_mode': 1,
3136
3144
            }
3137
 
        self.req_bin_0 = '\x40\x01\x00\x06' '\x00\x0f\x64\x22' \
3138
 
            '\x0c\x4b\x61\x09' '\xa8\x4f\xbe\xb6' \
3139
 
            '\xbf\xaf\xcd\xce' '\xb3\x60\xcc\xb5'
 
3145
        self.req_bin_0 = b'\x40\x01\x00\x06' b'\x00\x0f\x64\x22' \
 
3146
            b'\x0c\x4b\x61\x09' b'\xa8\x4f\xbe\xb6' \
 
3147
            b'\xbf\xaf\xcd\xce' b'\xb3\x60\xcc\xb5'
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
            'drawable': 1668889192,
3167
3175
            'coord_mode': 1,
3168
3176
            }
3169
 
        self.req_bin_0 = '\x41\x01\x00\x08' '\x63\x79\x3a\x68' \
3170
 
            '\x50\xcc\xb9\xcd' '\xd2\x21\xb6\xa3' \
3171
 
            '\xac\x83\xa7\x3e' '\xbb\x55\xca\x7d' \
3172
 
            '\x98\x4f\xb4\x67' '\xd1\xfd\x98\x88'
 
3177
        self.req_bin_0 = b'\x41\x01\x00\x08' b'\x63\x79\x3a\x68' \
 
3178
            b'\x50\xcc\xb9\xcd' b'\xd2\x21\xb6\xa3' \
 
3179
            b'\xac\x83\xa7\x3e' b'\xbb\x55\xca\x7d' \
 
3180
            b'\x98\x4f\xb4\x67' b'\xd1\xfd\x98\x88'
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
            'drawable': 146511635,
3199
3207
            'gc': 53385255,
3200
3208
            }
3201
 
        self.req_bin_0 = '\x42\x00\x00\x05' '\x08\xbb\x97\x13' \
3202
 
            '\x03\x2e\x98\x27' '\xce\xbe\xa1\x44' \
3203
 
            '\x9b\x56\xa8\x05'
 
3209
        self.req_bin_0 = b'\x42\x00\x00\x05' b'\x08\xbb\x97\x13' \
 
3210
            b'\x03\x2e\x98\x27' b'\xce\xbe\xa1\x44' \
 
3211
            b'\x9b\x56\xa8\x05'
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
            'gc': 410140275,
3230
3238
            'rectangles': [{'height': 63567, 'x': -16992, 'width': 11122, 'y': -21320}, {'height': 34652, 'x': -18051, 'width': 59622, 'y': -30426}, {'height': 45646, 'x': -1111, 'width': 46231, 'y': -25261}],
3231
3239
            }
3232
 
        self.req_bin_0 = '\x43\x00\x00\x09' '\x72\xe3\x09\x3d' \
3233
 
            '\x18\x72\x3e\x73' '\xbd\xa0\xac\xb8' \
3234
 
            '\x2b\x72\xf8\x4f' '\xb9\x7d\x89\x26' \
3235
 
            '\xe8\xe6\x87\x5c' '\xfb\xa9\x9d\x53' \
3236
 
            '\xb4\x97\xb2\x4e'
 
3240
        self.req_bin_0 = b'\x43\x00\x00\x09' b'\x72\xe3\x09\x3d' \
 
3241
            b'\x18\x72\x3e\x73' b'\xbd\xa0\xac\xb8' \
 
3242
            b'\x2b\x72\xf8\x4f' b'\xb9\x7d\x89\x26' \
 
3243
            b'\xe8\xe6\x87\x5c' b'\xfb\xa9\x9d\x53' \
 
3244
            b'\xb4\x97\xb2\x4e'
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
            'drawable': 718777148,
3263
3271
            'gc': 1127021391,
3264
3272
            }
3265
 
        self.req_bin_0 = '\x44\x00\x00\x0c' '\x2a\xd7\xab\x3c' \
3266
 
            '\x43\x2c\xfb\x4f' '\xec\xb1\xdc\x0b' \
3267
 
            '\xff\xa8\x92\xad' '\xbd\xad\x9b\xce' \
3268
 
            '\xc9\xd7\xa6\xb2' '\xf2\xdd\x24\x6a' \
3269
 
            '\xae\xd3\xde\xce' '\xce\x6b\xe2\x82' \
3270
 
            '\xf8\xf4\xf7\x22' '\xfb\x31\xfc\xd7'
 
3273
        self.req_bin_0 = b'\x44\x00\x00\x0c' b'\x2a\xd7\xab\x3c' \
 
3274
            b'\x43\x2c\xfb\x4f' b'\xec\xb1\xdc\x0b' \
 
3275
            b'\xff\xa8\x92\xad' b'\xbd\xad\x9b\xce' \
 
3276
            b'\xc9\xd7\xa6\xb2' b'\xf2\xdd\x24\x6a' \
 
3277
            b'\xae\xd3\xde\xce' b'\xce\x6b\xe2\x82' \
 
3278
            b'\xf8\xf4\xf7\x22' b'\xfb\x31\xfc\xd7'
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
            'drawable': 1326525185,
3299
3307
            'coord_mode': 0,
3300
3308
            }
3301
 
        self.req_bin_0 = '\x45\x00\x00\x07' '\x4f\x11\x2b\x01' \
3302
 
            '\x3f\xce\x79\x1a' '\x01\x00\x00\x00' \
3303
 
            '\xb6\xc3\xb4\x29' '\xdd\x38\x96\xbc' \
3304
 
            '\xcb\xe8\xdb\x0a'
 
3309
        self.req_bin_0 = b'\x45\x00\x00\x07' b'\x4f\x11\x2b\x01' \
 
3310
            b'\x3f\xce\x79\x1a' b'\x01\x00\x00\x00' \
 
3311
            b'\xb6\xc3\xb4\x29' b'\xdd\x38\x96\xbc' \
 
3312
            b'\xcb\xe8\xdb\x0a'
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
            'gc': 1965498255,
3331
3339
            'rectangles': [{'height': 36920, 'x': -2965, 'width': 26437, 'y': -3568}, {'height': 44383, 'x': -18327, 'width': 37730, 'y': -26752}],
3332
3340
            }
3333
 
        self.req_bin_0 = '\x46\x00\x00\x07' '\x65\xd8\x42\xcc' \
3334
 
            '\x75\x27\x1f\x8f' '\xf4\x6b\xf2\x10' \
3335
 
            '\x67\x45\x90\x38' '\xb8\x69\x97\x80' \
3336
 
            '\x93\x62\xad\x5f'
 
3341
        self.req_bin_0 = b'\x46\x00\x00\x07' b'\x65\xd8\x42\xcc' \
 
3342
            b'\x75\x27\x1f\x8f' b'\xf4\x6b\xf2\x10' \
 
3343
            b'\x67\x45\x90\x38' b'\xb8\x69\x97\x80' \
 
3344
            b'\x93\x62\xad\x5f'
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
            'drawable': 2083870696,
3363
3371
            'gc': 414470877,
3364
3372
            }
3365
 
        self.req_bin_0 = '\x47\x00\x00\x06' '\x7c\x35\x57\xe8' \
3366
 
            '\x18\xb4\x52\xdd' '\xd5\xfe\xb3\x9d' \
3367
 
            '\xd2\x3b\xfa\x72' '\x91\x38\xe5\xc8'
 
3373
        self.req_bin_0 = b'\x47\x00\x00\x06' b'\x7c\x35\x57\xe8' \
 
3374
            b'\x18\xb4\x52\xdd' b'\xd5\xfe\xb3\x9d' \
 
3375
            b'\xd2\x3b\xfa\x72' b'\x91\x38\xe5\xc8'
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
            'width': 62850,
3401
3409
            'dst_y': -30693,
3402
3410
            }
3403
 
        self.req_bin_0 = '\x48\x01\x00\x09' '\x5b\x79\x56\xff' \
3404
 
            '\x0c\x83\x06\x83' '\xf5\x82\x26\x9b' \
3405
 
            '\xf3\x2c\x88\x1b' '\x93\xad\x00\x00' \
3406
 
            '\x62\x69\x74\x20' '\x6d\x61\x70\x20' \
3407
 
            '\x64\x61\x74\x61'
 
3411
        self.req_bin_0 = b'\x48\x01\x00\x09' b'\x5b\x79\x56\xff' \
 
3412
            b'\x0c\x83\x06\x83' b'\xf5\x82\x26\x9b' \
 
3413
            b'\xf3\x2c\x88\x1b' b'\x93\xad\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
            'format': 1,
3438
3446
            'width': 58993,
3439
3447
            }
3440
 
        self.req_bin_0 = '\x49\x01\x00\x05' '\x4f\x3e\x5f\x83' \
3441
 
            '\x93\xe8\x87\x75' '\xe6\x71\xa6\xa1' \
3442
 
            '\x68\xae\xae\x00'
 
3448
        self.req_bin_0 = b'\x49\x01\x00\x05' b'\x4f\x3e\x5f\x83' \
 
3449
            b'\x93\xe8\x87\x75' b'\xe6\x71\xa6\xa1' \
 
3450
            b'\x68\xae\xae\x00'
3443
3451
 
3444
3452
        self.reply_args_0 = {
3445
3453
            'sequence_number': 54997,
3447
3455
            'visual': 1108632607,
3448
3456
            'depth': 181,
3449
3457
            }
3450
 
        self.reply_bin_0 = '\x01\xb5\xd6\xd5' '\x00\x00\x00\x07' \
3451
 
            '\x42\x14\x64\x1f' '\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\xb5\xd6\xd5' b'\x00\x00\x00\x07' \
 
3459
            b'\x42\x14\x64\x1f' 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
            'items': [{'delta': 2, 'string': 'zoo'}, 16909060, {'delta': 0, 'string': 'ie'}],
3504
3512
            'y': -8902,
3505
3513
            }
3506
 
        self.req_bin_0 = '\x4a\x00\x00\x08' '\x5c\x72\x5c\x8a' \
3507
 
            '\x58\x4e\xe2\x69' '\xcb\x14\xdd\x3a' \
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\x00\x08' b'\x5c\x72\x5c\x8a' \
 
3515
            b'\x58\x4e\xe2\x69' b'\xcb\x14\xdd\x3a' \
 
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
            'items': [{'delta': 2, 'string': (4131, 18)}, 16909060],
3538
3546
            'y': -2741,
3539
3547
            }
3540
 
        self.req_bin_0 = '\x4b\x00\x00\x07' '\x5e\xda\xf1\xf4' \
3541
 
            '\x17\xe2\x28\x18' '\x84\x82\xf5\x4b' \
3542
 
            '\x02\x02\x10\x23' '\x00\x12\xff\x01' \
3543
 
            '\x02\x03\x04\x00'
 
3548
        self.req_bin_0 = b'\x4b\x00\x00\x07' b'\x5e\xda\xf1\xf4' \
 
3549
            b'\x17\xe2\x28\x18' b'\x84\x82\xf5\x4b' \
 
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
            'x': -16077,
3572
3580
            'y': -4873,
3573
3581
            }
3574
 
        self.req_bin_0 = '\x4c\x06\x00\x06' '\x6c\xb1\xdd\x5d' \
3575
 
            '\x53\x10\x80\x21' '\xc1\x33\xec\xf7' \
3576
 
            '\x73\x68\x6f\x77' '\x6d\x65\x00\x00'
 
3582
        self.req_bin_0 = b'\x4c\x06\x00\x06' b'\x6c\xb1\xdd\x5d' \
 
3583
            b'\x53\x10\x80\x21' b'\xc1\x33\xec\xf7' \
 
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
            'x': -21343,
3605
3613
            'y': -24237,
3606
3614
            }
3607
 
        self.req_bin_0 = '\x4d\x08\x00\x08' '\x02\x00\xce\x10' \
3608
 
            '\x65\x77\x08\xde' '\xac\xa1\xa1\x53' \
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\x00\x08' b'\x02\x00\xce\x10' \
 
3616
            b'\x65\x77\x08\xde' b'\xac\xa1\xa1\x53' \
 
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': 813982403,
3638
3646
            'window': 698475631,
3639
3647
            }
3640
 
        self.req_bin_0 = '\x4e\x00\x00\x04' '\x09\x63\xd1\xab' \
3641
 
            '\x29\xa1\xe4\x6f' '\x30\x84\x62\xc3'
 
3648
        self.req_bin_0 = b'\x4e\x00\x00\x04' b'\x09\x63\xd1\xab' \
 
3649
            b'\x29\xa1\xe4\x6f' b'\x30\x84\x62\xc3'
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': 1296514923,
3667
3675
            }
3668
 
        self.req_bin_0 = '\x4f\x00\x00\x02' '\x4d\x47\x3f\x6b'
 
3676
        self.req_bin_0 = b'\x4f\x00\x00\x02' b'\x4d\x47\x3f\x6b'
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': 1049336329,
3694
3702
            'mid': 1237242690,
3695
3703
            }
3696
 
        self.req_bin_0 = '\x50\x00\x00\x03' '\x49\xbe\xd3\x42' \
3697
 
            '\x3e\x8b\x9a\x09'
 
3704
        self.req_bin_0 = b'\x50\x00\x00\x03' b'\x49\xbe\xd3\x42' \
 
3705
            b'\x3e\x8b\x9a\x09'
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': 1539075582,
3723
3731
            }
3724
 
        self.req_bin_0 = '\x51\x00\x00\x02' '\x5b\xbc\x6d\xfe'
 
3732
        self.req_bin_0 = b'\x51\x00\x00\x02' b'\x5b\xbc\x6d\xfe'
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': 959493342,
3750
3758
            }
3751
 
        self.req_bin_0 = '\x52\x00\x00\x02' '\x39\x30\xb4\xde'
 
3759
        self.req_bin_0 = b'\x52\x00\x00\x02' b'\x39\x30\xb4\xde'
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': 1517864638,
3777
3785
            }
3778
 
        self.req_bin_0 = '\x53\x00\x00\x02' '\x5a\x78\xc6\xbe'
 
3786
        self.req_bin_0 = b'\x53\x00\x00\x02' b'\x5a\x78\xc6\xbe'
3779
3787
 
3780
3788
        self.reply_args_0 = {
3781
3789
            'cmaps': [2146327722, 1361260227],
3782
3790
            'sequence_number': 61652,
3783
3791
            }
3784
 
        self.reply_bin_0 = '\x01\x00\xf0\xd4' '\x00\x00\x00\x02' \
3785
 
            '\x00\x02\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
 
            '\x7f\xee\x5c\xaa' '\x51\x23\x2e\xc3'
 
3792
        self.reply_bin_0 = b'\x01\x00\xf0\xd4' b'\x00\x00\x00\x02' \
 
3793
            b'\x00\x02\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'\x7f\xee\x5c\xaa' b'\x51\x23\x2e\xc3'
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
            'cmap': 523356125,
3834
3842
            'blue': 49580,
3835
3843
            }
3836
 
        self.req_bin_0 = '\x54\x00\x00\x04' '\x1f\x31\xc7\xdd' \
3837
 
            '\x9b\x2d\xc2\xbe' '\xc1\xac\x00\x00'
 
3844
        self.req_bin_0 = b'\x54\x00\x00\x04' b'\x1f\x31\xc7\xdd' \
 
3845
            b'\x9b\x2d\xc2\xbe' b'\xc1\xac\x00\x00'
3838
3846
 
3839
3847
        self.reply_args_0 = {
3840
3848
            'sequence_number': 10904,
3843
3851
            'pixel': 1067923656,
3844
3852
            'blue': 14525,
3845
3853
            }
3846
 
        self.reply_bin_0 = '\x01\x00\x2a\x98' '\x00\x00\x00\x00' \
3847
 
            '\xab\x08\x0c\x62' '\x38\xbd\x00\x00' \
3848
 
            '\x3f\xa7\x38\xc8' '\x00\x00\x00\x00' \
3849
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
3854
        self.reply_bin_0 = b'\x01\x00\x2a\x98' b'\x00\x00\x00\x00' \
 
3855
            b'\xab\x08\x0c\x62' b'\x38\xbd\x00\x00' \
 
3856
            b'\x3f\xa7\x38\xc8' 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': 128217824,
3893
3901
            'name': 'octarin',
3894
3902
            }
3895
 
        self.req_bin_0 = '\x55\x00\x00\x05' '\x07\xa4\x72\xe0' \
3896
 
            '\x00\x07\x00\x00' '\x6f\x63\x74\x61' \
3897
 
            '\x72\x69\x6e\x00'
 
3903
        self.req_bin_0 = b'\x55\x00\x00\x05' b'\x07\xa4\x72\xe0' \
 
3904
            b'\x00\x07\x00\x00' b'\x6f\x63\x74\x61' \
 
3905
            b'\x72\x69\x6e\x00'
3898
3906
 
3899
3907
        self.reply_args_0 = {
3900
3908
            'sequence_number': 19971,
3906
3914
            'screen_blue': 43109,
3907
3915
            'exact_red': 64213,
3908
3916
            }
3909
 
        self.reply_bin_0 = '\x01\x00\x4e\x03' '\x00\x00\x00\x00' \
3910
 
            '\x4e\xee\x49\x76' '\xfa\xd5\x71\x8b' \
3911
 
            '\xe5\xbb\x82\x63' '\xc5\x43\xa8\x65' \
3912
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
3917
        self.reply_bin_0 = b'\x01\x00\x4e\x03' b'\x00\x00\x00\x00' \
 
3918
            b'\x4e\xee\x49\x76' b'\xfa\xd5\x71\x8b' \
 
3919
            b'\xe5\xbb\x82\x63' b'\xc5\x43\xa8\x65' \
 
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
            'cmap': 675372338,
3958
3966
            'contiguous': 1,
3959
3967
            }
3960
 
        self.req_bin_0 = '\x56\x01\x00\x03' '\x28\x41\x5d\x32' \
3961
 
            '\xe5\x4a\x80\x63'
 
3968
        self.req_bin_0 = b'\x56\x01\x00\x03' b'\x28\x41\x5d\x32' \
 
3969
            b'\xe5\x4a\x80\x63'
3962
3970
 
3963
3971
        self.reply_args_0 = {
3964
3972
            'masks': [733927381, 1023311668, 595898647],
3965
3973
            'pixels': [693075497, 1294879029, 1478712895, 1781963728, 1442185575, 1654003869, 787619123, 1049825849, 1773935772, 1689075922, 1626562257, 177731275, 661046122, 1970509470, 1918486395, 688539096, 41044851],
3966
3974
            'sequence_number': 54025,
3967
3975
            }
3968
 
        self.reply_bin_0 = '\x01\x00\xd3\x09' '\x00\x00\x00\x14' \
3969
 
            '\x00\x11\x00\x03' '\x00\x00\x00\x00' \
3970
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
3971
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
3972
 
            '\x29\x4f\x7e\x29' '\x4d\x2e\x49\x35' \
3973
 
            '\x58\x23\x5e\x3f' '\x6a\x36\x9b\xd0' \
3974
 
            '\x55\xf6\x01\x67' '\x62\x96\x18\x9d' \
3975
 
            '\x2e\xf2\x1d\x33' '\x3e\x93\x12\x39' \
3976
 
            '\x69\xbc\x1c\x9c' '\x64\xad\x40\xd2' \
3977
 
            '\x60\xf3\x5e\xd1' '\x0a\x97\xf6\xcb' \
3978
 
            '\x27\x66\xc3\x6a' '\x75\x73\x96\x9e' \
3979
 
            '\x72\x59\xc7\x7b' '\x29\x0a\x45\xd8' \
3980
 
            '\x02\x72\x4b\x73' '\x2b\xbe\xd7\xd5' \
3981
 
            '\x3c\xfe\x7f\x34' '\x23\x84\xb1\x17'
 
3976
        self.reply_bin_0 = b'\x01\x00\xd3\x09' b'\x00\x00\x00\x14' \
 
3977
            b'\x00\x11\x00\x03' 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'\x29\x4f\x7e\x29' b'\x4d\x2e\x49\x35' \
 
3981
            b'\x58\x23\x5e\x3f' b'\x6a\x36\x9b\xd0' \
 
3982
            b'\x55\xf6\x01\x67' b'\x62\x96\x18\x9d' \
 
3983
            b'\x2e\xf2\x1d\x33' b'\x3e\x93\x12\x39' \
 
3984
            b'\x69\xbc\x1c\x9c' b'\x64\xad\x40\xd2' \
 
3985
            b'\x60\xf3\x5e\xd1' b'\x0a\x97\xf6\xcb' \
 
3986
            b'\x27\x66\xc3\x6a' b'\x75\x73\x96\x9e' \
 
3987
            b'\x72\x59\xc7\x7b' b'\x29\x0a\x45\xd8' \
 
3988
            b'\x02\x72\x4b\x73' b'\x2b\xbe\xd7\xd5' \
 
3989
            b'\x3c\xfe\x7f\x34' b'\x23\x84\xb1\x17'
3982
3990
 
3983
3991
        self.reply_args_1 = {
3984
3992
            'masks': [],
3985
3993
            'pixels': [],
3986
3994
            'sequence_number': 6273,
3987
3995
            }
3988
 
        self.reply_bin_1 = '\x01\x00\x18\x81' '\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\x18\x81' 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': 0,
4057
4065
            'blue': 23880,
4058
4066
            }
4059
 
        self.req_bin_0 = '\x57\x00\x00\x04' '\x12\x5c\x02\x63' \
4060
 
            '\xe3\xa3\x59\x5c' '\x24\xd1\x5d\x48'
 
4067
        self.req_bin_0 = b'\x57\x00\x00\x04' b'\x12\x5c\x02\x63' \
 
4068
            b'\xe3\xa3\x59\x5c' b'\x24\xd1\x5d\x48'
4061
4069
 
4062
4070
        self.reply_args_0 = {
4063
4071
            'green_mask': 265888391,
4066
4074
            'blue_mask': 44676180,
4067
4075
            'red_mask': 734623206,
4068
4076
            }
4069
 
        self.reply_bin_0 = '\x01\x00\x8d\x4f' '\x00\x00\x00\x04' \
4070
 
            '\x00\x04\x00\x00' '\x2b\xc9\x75\xe6' \
4071
 
            '\x0f\xd9\x22\x87' '\x02\xa9\xb4\x54' \
4072
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
4073
 
            '\x1d\x52\xbe\x09' '\x4d\x99\x83\xbe' \
4074
 
            '\x5f\xa5\xda\xfd' '\x54\x90\x6c\x90'
 
4077
        self.reply_bin_0 = b'\x01\x00\x8d\x4f' b'\x00\x00\x00\x04' \
 
4078
            b'\x00\x04\x00\x00' b'\x2b\xc9\x75\xe6' \
 
4079
            b'\x0f\xd9\x22\x87' b'\x02\xa9\xb4\x54' \
 
4080
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
4081
            b'\x1d\x52\xbe\x09' b'\x4d\x99\x83\xbe' \
 
4082
            b'\x5f\xa5\xda\xfd' b'\x54\x90\x6c\x90'
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
            'pixels': [61281082, 398475082, 1660604639, 1516738417, 1211104329, 105034864, 884930615, 902914796, 288637231, 2097165249, 1171127263, 1027274519, 806213035, 1485898709, 542709465, 169067149, 1230881159],
4119
4127
            'plane_mask': 1204733200,
4120
4128
            }
4121
 
        self.req_bin_0 = '\x58\x00\x00\x14' '\x2b\x55\x43\xd8' \
4122
 
            '\x47\xce\xc5\x10' '\x03\xa7\x13\x3a' \
4123
 
            '\x17\xc0\x3f\x4a' '\x62\xfa\xd0\xdf' \
4124
 
            '\x5a\x67\x97\x71' '\x48\x2f\xfc\x49' \
4125
 
            '\x06\x42\xb4\x70' '\x34\xbe\xf8\x37' \
4126
 
            '\x35\xd1\x62\xec' '\x11\x34\x41\x2f' \
4127
 
            '\x7d\x00\x33\xc1' '\x45\xcd\xfb\xdf' \
4128
 
            '\x3d\x3a\xf7\x17' '\x30\x0d\xd5\xab' \
4129
 
            '\x58\x91\x03\xd5' '\x20\x59\x16\xd9' \
4130
 
            '\x0a\x13\xc2\x8d' '\x49\x5d\xc1\x87'
 
4129
        self.req_bin_0 = b'\x58\x00\x00\x14' b'\x2b\x55\x43\xd8' \
 
4130
            b'\x47\xce\xc5\x10' b'\x03\xa7\x13\x3a' \
 
4131
            b'\x17\xc0\x3f\x4a' b'\x62\xfa\xd0\xdf' \
 
4132
            b'\x5a\x67\x97\x71' b'\x48\x2f\xfc\x49' \
 
4133
            b'\x06\x42\xb4\x70' b'\x34\xbe\xf8\x37' \
 
4134
            b'\x35\xd1\x62\xec' b'\x11\x34\x41\x2f' \
 
4135
            b'\x7d\x00\x33\xc1' b'\x45\xcd\xfb\xdf' \
 
4136
            b'\x3d\x3a\xf7\x17' b'\x30\x0d\xd5\xab' \
 
4137
            b'\x58\x91\x03\xd5' b'\x20\x59\x16\xd9' \
 
4138
            b'\x0a\x13\xc2\x8d' b'\x49\x5d\xc1\x87'
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
            'cmap': 501035281,
4156
4164
            'items': [{'red': 27925, 'pixel': 1094971765, 'green': 3673, 'flags': 189, 'blue': 31593}, {'red': 41633, 'pixel': 1330003189, 'green': 56186, 'flags': 178, 'blue': 30263}, {'red': 36007, 'pixel': 1813524037, 'green': 29697, 'flags': 224, 'blue': 14071}, {'red': 45716, 'pixel': 1987610486, 'green': 55405, 'flags': 200, 'blue': 35734}],
4157
4165
            }
4158
 
        self.req_bin_0 = '\x59\x00\x00\x0e' '\x1d\xdd\x31\x11' \
4159
 
            '\x41\x43\xf1\x75' '\x6d\x15\x0e\x59' \
4160
 
            '\x7b\x69\xbd\x00' '\x4f\x46\x3c\xf5' \
4161
 
            '\xa2\xa1\xdb\x7a' '\x76\x37\xb2\x00' \
4162
 
            '\x6c\x18\x2e\x45' '\x8c\xa7\x74\x01' \
4163
 
            '\x36\xf7\xe0\x00' '\x76\x78\x87\x76' \
4164
 
            '\xb2\x94\xd8\x6d' '\x8b\x96\xc8\x00'
 
4166
        self.req_bin_0 = b'\x59\x00\x00\x0e' b'\x1d\xdd\x31\x11' \
 
4167
            b'\x41\x43\xf1\x75' b'\x6d\x15\x0e\x59' \
 
4168
            b'\x7b\x69\xbd\x00' b'\x4f\x46\x3c\xf5' \
 
4169
            b'\xa2\xa1\xdb\x7a' b'\x76\x37\xb2\x00' \
 
4170
            b'\x6c\x18\x2e\x45' b'\x8c\xa7\x74\x01' \
 
4171
            b'\x36\xf7\xe0\x00' b'\x76\x78\x87\x76' \
 
4172
            b'\xb2\x94\xd8\x6d' b'\x8b\x96\xc8\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
            'cmap': 2061119590,
4192
4200
            'pixel': 1846011298,
4193
4201
            }
4194
 
        self.req_bin_0 = '\x5a\xba\x00\x05' '\x7a\xda\x30\x66' \
4195
 
            '\x6e\x07\xe5\xa2' '\x00\x04\x00\x00' \
4196
 
            '\x62\x6c\x75\x65'
 
4202
        self.req_bin_0 = b'\x5a\xba\x00\x05' b'\x7a\xda\x30\x66' \
 
4203
            b'\x6e\x07\xe5\xa2' b'\x00\x04\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': 596369797,
4222
4230
            'pixels': [1018587496, 1553480933, 952694607, 341816269, 306591348, 1178729919, 173027853, 875811363],
4223
4231
            }
4224
 
        self.req_bin_0 = '\x5b\x00\x00\x0a' '\x23\x8b\xe1\x85' \
4225
 
            '\x3c\xb6\x69\x68' '\x5c\x98\x3c\xe5' \
4226
 
            '\x38\xc8\xf7\x4f' '\x14\x5f\xb3\xcd' \
4227
 
            '\x12\x46\x36\x74' '\x46\x41\xfd\xbf' \
4228
 
            '\x0a\x50\x32\x0d' '\x34\x33\xd2\x23'
 
4232
        self.req_bin_0 = b'\x5b\x00\x00\x0a' b'\x23\x8b\xe1\x85' \
 
4233
            b'\x3c\xb6\x69\x68' b'\x5c\x98\x3c\xe5' \
 
4234
            b'\x38\xc8\xf7\x4f' b'\x14\x5f\xb3\xcd' \
 
4235
            b'\x12\x46\x36\x74' b'\x46\x41\xfd\xbf' \
 
4236
            b'\x0a\x50\x32\x0d' b'\x34\x33\xd2\x23'
4229
4237
 
4230
4238
        self.reply_args_0 = {
4231
4239
            'colors': [{'red': 6715, 'blue': 40144, 'green': 56664}, {'red': 5799, 'blue': 22078, 'green': 35523}, {'red': 60111, 'blue': 58654, 'green': 25206}, {'red': 7433, 'blue': 60908, 'green': 14468}, {'red': 31213, 'blue': 9298, 'green': 27481}],
4232
4240
            'sequence_number': 60323,
4233
4241
            }
4234
 
        self.reply_bin_0 = '\x01\x00\xeb\xa3' '\x00\x00\x00\x0a' \
4235
 
            '\x00\x05\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
 
            '\x1a\x3b\xdd\x58' '\x9c\xd0\x00\x00' \
4239
 
            '\x16\xa7\x8a\xc3' '\x56\x3e\x00\x00' \
4240
 
            '\xea\xcf\x62\x76' '\xe5\x1e\x00\x00' \
4241
 
            '\x1d\x09\x38\x84' '\xed\xec\x00\x00' \
4242
 
            '\x79\xed\x6b\x59' '\x24\x52\x00\x00'
 
4242
        self.reply_bin_0 = b'\x01\x00\xeb\xa3' b'\x00\x00\x00\x0a' \
 
4243
            b'\x00\x05\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'\x1a\x3b\xdd\x58' b'\x9c\xd0\x00\x00' \
 
4247
            b'\x16\xa7\x8a\xc3' b'\x56\x3e\x00\x00' \
 
4248
            b'\xea\xcf\x62\x76' b'\xe5\x1e\x00\x00' \
 
4249
            b'\x1d\x09\x38\x84' b'\xed\xec\x00\x00' \
 
4250
            b'\x79\xed\x6b\x59' b'\x24\x52\x00\x00'
4243
4251
 
4244
4252
        self.req_args_1 = {
4245
4253
            'cmap': 79317049,
4246
4254
            'pixels': [],
4247
4255
            }
4248
 
        self.req_bin_1 = '\x5b\x00\x00\x02' '\x04\xba\x48\x39'
 
4256
        self.req_bin_1 = b'\x5b\x00\x00\x02' b'\x04\xba\x48\x39'
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': 789574750,
4310
4318
            'name': 'octarin',
4311
4319
            }
4312
 
        self.req_bin_0 = '\x5c\x00\x00\x05' '\x2f\x0f\xf4\x5e' \
4313
 
            '\x00\x07\x00\x00' '\x6f\x63\x74\x61' \
4314
 
            '\x72\x69\x6e\x00'
 
4320
        self.req_bin_0 = b'\x5c\x00\x00\x05' b'\x2f\x0f\xf4\x5e' \
 
4321
            b'\x00\x07\x00\x00' b'\x6f\x63\x74\x61' \
 
4322
            b'\x72\x69\x6e\x00'
4315
4323
 
4316
4324
        self.reply_args_0 = {
4317
4325
            'sequence_number': 21040,
4322
4330
            'screen_blue': 29893,
4323
4331
            'exact_red': 41875,
4324
4332
            }
4325
 
        self.reply_bin_0 = '\x01\x00\x52\x30' '\x00\x00\x00\x00' \
4326
 
            '\xa3\x93\xe8\x9a' '\xf0\x48\xc7\x59' \
4327
 
            '\xff\x22\x74\xc5' '\x00\x00\x00\x00' \
4328
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
4333
        self.reply_bin_0 = b'\x01\x00\x52\x30' b'\x00\x00\x00\x00' \
 
4334
            b'\xa3\x93\xe8\x9a' b'\xf0\x48\xc7\x59' \
 
4335
            b'\xff\x22\x74\xc5' 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
            'back_red': 31899,
4381
4389
            'source': 794739749,
4382
4390
            }
4383
 
        self.req_bin_0 = '\x5d\x00\x00\x08' '\x78\x85\xb3\xb9' \
4384
 
            '\x2f\x5e\xc4\x25' '\x19\x0b\x92\xe4' \
4385
 
            '\xff\x2b\xa8\x14' '\xf8\x34\x7c\x9b' \
4386
 
            '\x13\xe2\xc2\xd7' '\x37\x77\x80\x0c'
 
4391
        self.req_bin_0 = b'\x5d\x00\x00\x08' b'\x78\x85\xb3\xb9' \
 
4392
            b'\x2f\x5e\xc4\x25' b'\x19\x0b\x92\xe4' \
 
4393
            b'\xff\x2b\xa8\x14' b'\xf8\x34\x7c\x9b' \
 
4394
            b'\x13\xe2\xc2\xd7' b'\x37\x77\x80\x0c'
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': 1412345132,
4421
4429
            'back_green': 52966,
4422
4430
            }
4423
 
        self.req_bin_0 = '\x5e\x00\x00\x08' '\x77\x2e\x8e\xfc' \
4424
 
            '\x54\x2e\xad\x2c' '\x78\x51\x63\x27' \
4425
 
            '\x1d\x90\xb4\x2c' '\xdb\xf2\x42\x5d' \
4426
 
            '\x78\x49\xfb\xe4' '\xce\xe6\x19\x64'
 
4431
        self.req_bin_0 = b'\x5e\x00\x00\x08' b'\x77\x2e\x8e\xfc' \
 
4432
            b'\x54\x2e\xad\x2c' b'\x78\x51\x63\x27' \
 
4433
            b'\x1d\x90\xb4\x2c' b'\xdb\xf2\x42\x5d' \
 
4434
            b'\x78\x49\xfb\xe4' b'\xce\xe6\x19\x64'
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': 553262138,
4452
4460
            }
4453
 
        self.req_bin_0 = '\x5f\x00\x00\x02' '\x20\xfa\x1c\x3a'
 
4461
        self.req_bin_0 = b'\x5f\x00\x00\x02' b'\x20\xfa\x1c\x3a'
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
            'back_red': 64013,
4484
4492
            'cursor': 295995276,
4485
4493
            }
4486
 
        self.req_bin_0 = '\x60\x00\x00\x05' '\x11\xa4\x87\x8c' \
4487
 
            '\xae\xae\x81\x50' '\x43\x5e\xfa\x0d' \
4488
 
            '\x2f\x83\xc1\x7d'
 
4494
        self.req_bin_0 = b'\x60\x00\x00\x05' b'\x11\xa4\x87\x8c' \
 
4495
            b'\xae\xae\x81\x50' b'\x43\x5e\xfa\x0d' \
 
4496
            b'\x2f\x83\xc1\x7d'
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
            'item_class': 1,
4516
4524
            'width': 27916,
4517
4525
            }
4518
 
        self.req_bin_0 = '\x61\x01\x00\x03' '\x1e\x02\xc1\x1e' \
4519
 
            '\x6d\x0c\x87\xb7'
 
4526
        self.req_bin_0 = b'\x61\x01\x00\x03' b'\x1e\x02\xc1\x1e' \
 
4527
            b'\x6d\x0c\x87\xb7'
4520
4528
 
4521
4529
        self.reply_args_0 = {
4522
4530
            'height': 60728,
4523
4531
            'sequence_number': 34070,
4524
4532
            'width': 35970,
4525
4533
            }
4526
 
        self.reply_bin_0 = '\x01\x00\x85\x16' '\x00\x00\x00\x00' \
4527
 
            '\x8c\x82\xed\x38' '\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\x85\x16' b'\x00\x00\x00\x00' \
 
4535
            b'\x8c\x82\xed\x38' 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\x00\x03' '\x00\x04\x00\x00' \
4575
 
            '\x58\x54\x52\x41'
 
4582
        self.req_bin_0 = b'\x62\x00\x00\x03' b'\x00\x04\x00\x00' \
 
4583
            b'\x58\x54\x52\x41'
4576
4584
 
4577
4585
        self.reply_args_0 = {
4578
4586
            'sequence_number': 39952,
4581
4589
            'present': 1,
4582
4590
            'first_event': 202,
4583
4591
            }
4584
 
        self.reply_bin_0 = '\x01\x00\x9c\x10' '\x00\x00\x00\x00' \
4585
 
            '\x01\xc3\xca\x96' '\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\x9c\x10' b'\x00\x00\x00\x00' \
 
4593
            b'\x01\xc3\xca\x96' 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\x00\x01'
 
4639
        self.req_bin_0 = b'\x63\x00\x00\x01'
4632
4640
 
4633
4641
        self.reply_args_0 = {
4634
4642
            'sequence_number': 20200,
4635
4643
            'names': ['XTRA', 'XTRA-II'],
4636
4644
            }
4637
 
        self.reply_bin_0 = '\x01\x02\x4e\xe8' '\x00\x00\x00\x04' \
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\x4e\xe8' b'\x00\x00\x00\x04' \
 
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
            'keysyms': [[707837223, 99294840, 1205405602], [67157514, 879853050, 2059131033], [1139736188, 578113249, 1525786315], [1335349176, 246731334, 277761436], [1386594542, 1676932187, 1862777168], [535892916, 342718655, 195574000], [5712156, 1820472637, 848853860], [1123197289, 1664064022, 94999154], [380150420, 402902535, 1061375041], [510686316, 502245882, 422893644], [1423643601, 194077695, 403885178], [1571826296, 529249772, 623556591], [720045879, 37553034, 955963792], [513407882, 861125615, 219940695], [184890179, 472466494, 1649347894], [1679171989, 1991748404, 1674460475], [1762342934, 276695222, 1941684480], [886658026, 1860690072, 577030090], [227169721, 1390318675, 321524615], [2144591365, 545119116, 404205206]],
4686
4694
            'first_keycode': 250,
4687
4695
            }
4688
 
        self.req_bin_0 = '\x64\x14\x00\x3e' '\xfa\x03\x00\x00' \
4689
 
            '\x2a\x30\xbd\x27' '\x05\xeb\x1e\x78' \
4690
 
            '\x47\xd9\x07\xa2' '\x04\x00\xbe\x0a' \
4691
 
            '\x34\x71\x7d\xfa' '\x7a\xbb\xd8\x99' \
4692
 
            '\x43\xee\xfe\x7c' '\x22\x75\x4e\xe1' \
4693
 
            '\x5a\xf1\xa6\xcb' '\x4f\x97\xcf\xb8' \
4694
 
            '\x0e\xb4\xd2\x46' '\x10\x8e\x4d\x9c' \
4695
 
            '\x52\xa5\xc0\xee' '\x63\xf3\xf4\x5b' \
4696
 
            '\x6f\x07\xb9\x50' '\x1f\xf1\x13\xb4' \
4697
 
            '\x14\x6d\x78\xbf' '\x0b\xa8\x38\xf0' \
4698
 
            '\x00\x57\x29\x1c' '\x6c\x82\x35\x3d' \
4699
 
            '\x32\x98\x7b\x64' '\x42\xf2\xa1\x69' \
4700
 
            '\x63\x2f\x9a\x16' '\x05\xa9\x92\x72' \
4701
 
            '\x16\xa8\xa2\x94' '\x18\x03\xce\x07' \
4702
 
            '\x3f\x43\x4c\x41' '\x1e\x70\x74\x6c' \
4703
 
            '\x1d\xef\xa9\xfa' '\x19\x34\xd8\x4c' \
4704
 
            '\x54\xdb\x13\xd1' '\x0b\x91\x63\xff' \
4705
 
            '\x18\x12\xcc\x7a' '\x5d\xb0\x2a\x78' \
4706
 
            '\x1f\x8b\xb5\xec' '\x25\x2a\xb7\xef' \
4707
 
            '\x2a\xeb\x07\x37' '\x02\x3d\x03\x8a' \
4708
 
            '\x38\xfa\xd9\x90' '\x1e\x99\xfb\x8a' \
4709
 
            '\x33\x53\xbb\xef' '\x0d\x1c\x07\x57' \
4710
 
            '\x0b\x05\x33\x43' '\x1c\x29\x44\x3e' \
4711
 
            '\x62\x4f\x0d\x36' '\x64\x16\x21\x95' \
4712
 
            '\x76\xb7\xab\x34' '\x63\xce\x3d\x3b' \
4713
 
            '\x69\x0b\x38\x16' '\x10\x7e\x08\xb6' \
4714
 
            '\x73\xbb\xc1\x00' '\x34\xd9\x53\xea' \
4715
 
            '\x6e\xe7\xe0\x98' '\x22\x64\xc7\xca' \
4716
 
            '\x0d\x8a\x55\xb9' '\x52\xde\x94\x53' \
4717
 
            '\x13\x2a\x13\x87' '\x7f\xd3\xde\x05' \
4718
 
            '\x20\x7d\xdb\x8c' '\x18\x17\xae\x96'
 
4696
        self.req_bin_0 = b'\x64\x14\x00\x3e' b'\xfa\x03\x00\x00' \
 
4697
            b'\x2a\x30\xbd\x27' b'\x05\xeb\x1e\x78' \
 
4698
            b'\x47\xd9\x07\xa2' b'\x04\x00\xbe\x0a' \
 
4699
            b'\x34\x71\x7d\xfa' b'\x7a\xbb\xd8\x99' \
 
4700
            b'\x43\xee\xfe\x7c' b'\x22\x75\x4e\xe1' \
 
4701
            b'\x5a\xf1\xa6\xcb' b'\x4f\x97\xcf\xb8' \
 
4702
            b'\x0e\xb4\xd2\x46' b'\x10\x8e\x4d\x9c' \
 
4703
            b'\x52\xa5\xc0\xee' b'\x63\xf3\xf4\x5b' \
 
4704
            b'\x6f\x07\xb9\x50' b'\x1f\xf1\x13\xb4' \
 
4705
            b'\x14\x6d\x78\xbf' b'\x0b\xa8\x38\xf0' \
 
4706
            b'\x00\x57\x29\x1c' b'\x6c\x82\x35\x3d' \
 
4707
            b'\x32\x98\x7b\x64' b'\x42\xf2\xa1\x69' \
 
4708
            b'\x63\x2f\x9a\x16' b'\x05\xa9\x92\x72' \
 
4709
            b'\x16\xa8\xa2\x94' b'\x18\x03\xce\x07' \
 
4710
            b'\x3f\x43\x4c\x41' b'\x1e\x70\x74\x6c' \
 
4711
            b'\x1d\xef\xa9\xfa' b'\x19\x34\xd8\x4c' \
 
4712
            b'\x54\xdb\x13\xd1' b'\x0b\x91\x63\xff' \
 
4713
            b'\x18\x12\xcc\x7a' b'\x5d\xb0\x2a\x78' \
 
4714
            b'\x1f\x8b\xb5\xec' b'\x25\x2a\xb7\xef' \
 
4715
            b'\x2a\xeb\x07\x37' b'\x02\x3d\x03\x8a' \
 
4716
            b'\x38\xfa\xd9\x90' b'\x1e\x99\xfb\x8a' \
 
4717
            b'\x33\x53\xbb\xef' b'\x0d\x1c\x07\x57' \
 
4718
            b'\x0b\x05\x33\x43' b'\x1c\x29\x44\x3e' \
 
4719
            b'\x62\x4f\x0d\x36' b'\x64\x16\x21\x95' \
 
4720
            b'\x76\xb7\xab\x34' b'\x63\xce\x3d\x3b' \
 
4721
            b'\x69\x0b\x38\x16' b'\x10\x7e\x08\xb6' \
 
4722
            b'\x73\xbb\xc1\x00' b'\x34\xd9\x53\xea' \
 
4723
            b'\x6e\xe7\xe0\x98' b'\x22\x64\xc7\xca' \
 
4724
            b'\x0d\x8a\x55\xb9' b'\x52\xde\x94\x53' \
 
4725
            b'\x13\x2a\x13\x87' b'\x7f\xd3\xde\x05' \
 
4726
            b'\x20\x7d\xdb\x8c' b'\x18\x17\xae\x96'
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
            'count': 131,
4744
4752
            'first_keycode': 206,
4745
4753
            }
4746
 
        self.req_bin_0 = '\x65\x00\x00\x02' '\xce\x83\x00\x00'
 
4754
        self.req_bin_0 = b'\x65\x00\x00\x02' b'\xce\x83\x00\x00'
4747
4755
 
4748
4756
        self.reply_args_0 = {
4749
4757
            'keysyms': [[1550369014, 1683205347, 1879538861], [452613596, 1132022246, 357271408], [528724632, 2118423140, 640580111], [1981239140, 195173082, 497130901], [2001675011, 809172000, 1577756130], [739794769, 1774524806, 787951551], [1784021539, 1998872082, 1747812414], [396316053, 1525431160, 1808906812], [1676662850, 1222579650, 1205117622], [396026453, 1956747483, 1762026309], [1222502216, 1488139702, 1799119214], [1504675136, 1414564657, 419659384], [1934768917, 2095924224, 590955729], [582168798, 383228141, 1552516537], [1482483262, 1041896520, 1047041873], [1932705867, 292473490, 226147737], [780322016, 1965031752, 1481062205], [89811542, 1313413666, 686267194], [237776128, 1310737228, 792176733], [849034415, 1592538831, 837355505]],
4750
4758
            'sequence_number': 61409,
4751
4759
            }
4752
 
        self.reply_bin_0 = '\x01\x03\xef\xe1' '\x00\x00\x00\x3c' \
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
 
            '\x5c\x68\xc0\xf6' '\x64\x53\xac\xe3' \
4757
 
            '\x70\x07\x7c\xad' '\x1a\xfa\x55\xdc' \
4758
 
            '\x43\x79\x49\xe6' '\x15\x4b\x87\x70' \
4759
 
            '\x1f\x83\xb2\x98' '\x7e\x44\x92\x64' \
4760
 
            '\x26\x2e\x7a\x0f' '\x76\x17\x4f\x64' \
4761
 
            '\x0b\xa2\x1a\xda' '\x1d\xa1\x9d\x95' \
4762
 
            '\x77\x4f\x23\x03' '\x30\x3a\xfc\x20' \
4763
 
            '\x5e\x0a\xa5\xe2' '\x2c\x18\x5f\x51' \
4764
 
            '\x69\xc5\x19\x86' '\x2e\xf7\x2f\xbf' \
4765
 
            '\x6a\x56\x02\x23' '\x77\x24\x5e\x12' \
4766
 
            '\x68\x2d\x80\x3e' '\x17\x9f\x4d\x95' \
4767
 
            '\x5a\xec\x3b\x78' '\x6b\xd1\xba\x3c' \
4768
 
            '\x63\xef\xd8\x42' '\x48\xdf\x15\xc2' \
4769
 
            '\x47\xd4\xa2\xb6' '\x17\x9a\xe2\x55' \
4770
 
            '\x74\xa1\x98\xdb' '\x69\x06\x63\x45' \
4771
 
            '\x48\xdd\xe7\x48' '\x58\xb3\x35\xb6' \
4772
 
            '\x6b\x3c\x61\x6e' '\x59\xaf\x85\x40' \
4773
 
            '\x54\x50\x8b\x31' '\x19\x03\x7e\x78' \
4774
 
            '\x73\x52\x3b\x15' '\x7c\xed\x44\x00' \
4775
 
            '\x23\x39\x44\xd1' '\x22\xb3\x30\xde' \
4776
 
            '\x16\xd7\x98\xed' '\x5c\x89\x85\xb9' \
4777
 
            '\x58\x5c\xe6\x3e' '\x3e\x1a\x14\x48' \
4778
 
            '\x3e\x68\x97\x51' '\x73\x32\xc0\x4b' \
4779
 
            '\x11\x6e\xca\x92' '\x0d\x7a\xbd\x99' \
4780
 
            '\x2e\x82\xc4\xe0' '\x75\x20\x01\x48' \
4781
 
            '\x58\x47\x37\x3d' '\x05\x5a\x6a\x56' \
4782
 
            '\x4e\x49\x1a\x22' '\x28\xe7\x9b\x3a' \
4783
 
            '\x0e\x2c\x2d\x00' '\x4e\x20\x43\x4c' \
4784
 
            '\x2f\x37\xa8\x5d' '\x32\x9b\x3c\xaf' \
4785
 
            '\x5e\xec\x36\xcf' '\x31\xe9\x07\xf1'
 
4760
        self.reply_bin_0 = b'\x01\x03\xef\xe1' b'\x00\x00\x00\x3c' \
 
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'\x5c\x68\xc0\xf6' b'\x64\x53\xac\xe3' \
 
4765
            b'\x70\x07\x7c\xad' b'\x1a\xfa\x55\xdc' \
 
4766
            b'\x43\x79\x49\xe6' b'\x15\x4b\x87\x70' \
 
4767
            b'\x1f\x83\xb2\x98' b'\x7e\x44\x92\x64' \
 
4768
            b'\x26\x2e\x7a\x0f' b'\x76\x17\x4f\x64' \
 
4769
            b'\x0b\xa2\x1a\xda' b'\x1d\xa1\x9d\x95' \
 
4770
            b'\x77\x4f\x23\x03' b'\x30\x3a\xfc\x20' \
 
4771
            b'\x5e\x0a\xa5\xe2' b'\x2c\x18\x5f\x51' \
 
4772
            b'\x69\xc5\x19\x86' b'\x2e\xf7\x2f\xbf' \
 
4773
            b'\x6a\x56\x02\x23' b'\x77\x24\x5e\x12' \
 
4774
            b'\x68\x2d\x80\x3e' b'\x17\x9f\x4d\x95' \
 
4775
            b'\x5a\xec\x3b\x78' b'\x6b\xd1\xba\x3c' \
 
4776
            b'\x63\xef\xd8\x42' b'\x48\xdf\x15\xc2' \
 
4777
            b'\x47\xd4\xa2\xb6' b'\x17\x9a\xe2\x55' \
 
4778
            b'\x74\xa1\x98\xdb' b'\x69\x06\x63\x45' \
 
4779
            b'\x48\xdd\xe7\x48' b'\x58\xb3\x35\xb6' \
 
4780
            b'\x6b\x3c\x61\x6e' b'\x59\xaf\x85\x40' \
 
4781
            b'\x54\x50\x8b\x31' b'\x19\x03\x7e\x78' \
 
4782
            b'\x73\x52\x3b\x15' b'\x7c\xed\x44\x00' \
 
4783
            b'\x23\x39\x44\xd1' b'\x22\xb3\x30\xde' \
 
4784
            b'\x16\xd7\x98\xed' b'\x5c\x89\x85\xb9' \
 
4785
            b'\x58\x5c\xe6\x3e' b'\x3e\x1a\x14\x48' \
 
4786
            b'\x3e\x68\x97\x51' b'\x73\x32\xc0\x4b' \
 
4787
            b'\x11\x6e\xca\x92' b'\x0d\x7a\xbd\x99' \
 
4788
            b'\x2e\x82\xc4\xe0' b'\x75\x20\x01\x48' \
 
4789
            b'\x58\x47\x37\x3d' b'\x05\x5a\x6a\x56' \
 
4790
            b'\x4e\x49\x1a\x22' b'\x28\xe7\x9b\x3a' \
 
4791
            b'\x0e\x2c\x2d\x00' b'\x4e\x20\x43\x4c' \
 
4792
            b'\x2f\x37\xa8\x5d' b'\x32\x9b\x3c\xaf' \
 
4793
            b'\x5e\xec\x36\xcf' b'\x31\xe9\x07\xf1'
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': {'key_click_percent': -35, 'bell_percent': -53, 'led_mode': 1, 'bell_pitch': -17390, 'auto_repeat_mode': 2, 'bell_duration': -30281, 'key': 235, 'led': 192},
4829
4837
            }
4830
 
        self.req_bin_0 = '\x66\x00\x00\x0a' '\x00\x00\x00\xff' \
4831
 
            '\xdd\x00\x00\x00' '\xcb\x00\x00\x00' \
4832
 
            '\xbc\x12\x00\x00' '\x89\xb7\x00\x00' \
4833
 
            '\xc0\x00\x00\x00' '\x01\x00\x00\x00' \
4834
 
            '\xeb\x00\x00\x00' '\x02\x00\x00\x00'
 
4838
        self.req_bin_0 = b'\x66\x00\x00\x0a' b'\x00\x00\x00\xff' \
 
4839
            b'\xdd\x00\x00\x00' b'\xcb\x00\x00\x00' \
 
4840
            b'\xbc\x12\x00\x00' b'\x89\xb7\x00\x00' \
 
4841
            b'\xc0\x00\x00\x00' b'\x01\x00\x00\x00' \
 
4842
            b'\xeb\x00\x00\x00' b'\x02\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\x00\x01'
 
4868
        self.req_bin_0 = b'\x67\x00\x00\x01'
4861
4869
 
4862
4870
        self.reply_args_0 = {
4863
4871
            'key_click_percent': 206,
4869
4877
            'led_mask': 438224369,
4870
4878
            'bell_duration': 20235,
4871
4879
            }
4872
 
        self.reply_bin_0 = '\x01\x00\x75\xc5' '\x00\x00\x00\x05' \
4873
 
            '\x1a\x1e\xc5\xf1' '\xce\xfb\x35\xd3' \
4874
 
            '\x4f\x0b\x00\x00' '\xd9\xab\xa7\xa7' \
4875
 
            '\xf3\xa3\x81\xef' '\xa8\x99\xe1\xc7' \
4876
 
            '\xbd\x9b\xe4\x95' '\x94\xed\x8b\x96' \
4877
 
            '\xd3\x85\x87\xfa' '\xbf\xa6\x92\xd4' \
4878
 
            '\xef\xb7\xd6\xfa'
 
4880
        self.reply_bin_0 = b'\x01\x00\x75\xc5' b'\x00\x00\x00\x05' \
 
4881
            b'\x1a\x1e\xc5\xf1' b'\xce\xfb\x35\xd3' \
 
4882
            b'\x4f\x0b\x00\x00' b'\xd9\xab\xa7\xa7' \
 
4883
            b'\xf3\xa3\x81\xef' b'\xa8\x99\xe1\xc7' \
 
4884
            b'\xbd\x9b\xe4\x95' b'\x94\xed\x8b\x96' \
 
4885
            b'\xd3\x85\x87\xfa' b'\xbf\xa6\x92\xd4' \
 
4886
            b'\xef\xb7\xd6\xfa'
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': -19,
4922
4930
            }
4923
 
        self.req_bin_0 = '\x68\xed\x00\x01'
 
4931
        self.req_bin_0 = b'\x68\xed\x00\x01'
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
            'do_thresh': 0,
4952
4960
            'threshold': -8309,
4953
4961
            }
4954
 
        self.req_bin_0 = '\x69\x00\x00\x03' '\xdb\x7e\x81\x1c' \
4955
 
            '\xdf\x8b\x00\x00'
 
4962
        self.req_bin_0 = b'\x69\x00\x00\x03' b'\xdb\x7e\x81\x1c' \
 
4963
            b'\xdf\x8b\x00\x00'
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\x00\x01'
 
4989
        self.req_bin_0 = b'\x6a\x00\x00\x01'
4982
4990
 
4983
4991
        self.reply_args_0 = {
4984
4992
            'accel_denom': 63793,
4986
4994
            'threshold': 46060,
4987
4995
            'accel_num': 53419,
4988
4996
            }
4989
 
        self.reply_bin_0 = '\x01\x00\xea\x2a' '\x00\x00\x00\x00' \
4990
 
            '\xd0\xab\xf9\x31' '\xb3\xec\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\xea\x2a' b'\x00\x00\x00\x00' \
 
4998
            b'\xd0\xab\xf9\x31' b'\xb3\xec\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
            'interval': -12318,
5038
5046
            'prefer_blank': 2,
5039
5047
            }
5040
 
        self.req_bin_0 = '\x6b\x00\x00\x03' '\xce\x7d\xcf\xe2' \
5041
 
            '\x02\x00\x00\x00'
 
5048
        self.req_bin_0 = b'\x6b\x00\x00\x03' b'\xce\x7d\xcf\xe2' \
 
5049
            b'\x02\x00\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\x00\x01'
 
5075
        self.req_bin_0 = b'\x6c\x00\x00\x01'
5068
5076
 
5069
5077
        self.reply_args_0 = {
5070
5078
            'allow_exposures': 1,
5073
5081
            'prefer_blanking': 1,
5074
5082
            'interval': 60559,
5075
5083
            }
5076
 
        self.reply_bin_0 = '\x01\x00\x39\x52' '\x00\x00\x00\x00' \
5077
 
            '\x07\x49\xec\x8f' '\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\x39\x52' b'\x00\x00\x00\x00' \
 
5085
            b'\x07\x49\xec\x8f' 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': 1,
5124
5132
            'host_family': 1,
5125
5133
            }
5126
 
        self.req_bin_0 = '\x6d\x01\x00\x03' '\x01\x00\x00\x04' \
5127
 
            '\xbc\xe2\x87\xc7'
 
5134
        self.req_bin_0 = b'\x6d\x01\x00\x03' b'\x01\x00\x00\x04' \
 
5135
            b'\xbc\xe2\x87\xc7'
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\x00\x01'
 
5161
        self.req_bin_0 = b'\x6e\x00\x00\x01'
5154
5162
 
5155
5163
        self.reply_args_0 = {
5156
5164
            'sequence_number': 31662,
5157
5165
            'mode': 1,
5158
5166
            'hosts': [{'family': 0, 'name': [34, 23, 178, 12]}, {'family': 0, 'name': [130, 236, 254, 15]}],
5159
5167
            }
5160
 
        self.reply_bin_0 = '\x01\x01\x7b\xae' '\x00\x00\x00\x04' \
5161
 
            '\x00\x02\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\x00\x04' '\x22\x17\xb2\x0c' \
5165
 
            '\x00\x00\x00\x04' '\x82\xec\xfe\x0f'
 
5168
        self.reply_bin_0 = b'\x01\x01\x7b\xae' b'\x00\x00\x00\x04' \
 
5169
            b'\x00\x02\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\x00\x04' b'\x22\x17\xb2\x0c' \
 
5173
            b'\x00\x00\x00\x04' 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': 0,
5209
5217
            }
5210
 
        self.req_bin_0 = '\x6f\x00\x00\x01'
 
5218
        self.req_bin_0 = b'\x6f\x00\x00\x01'
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': 0,
5236
5244
            }
5237
 
        self.req_bin_0 = '\x70\x00\x00\x01'
 
5245
        self.req_bin_0 = b'\x70\x00\x00\x01'
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': 1679944210,
5263
5271
            }
5264
 
        self.req_bin_0 = '\x71\x00\x00\x02' '\x64\x21\xea\x12'
 
5272
        self.req_bin_0 = b'\x71\x00\x00\x02' b'\x64\x21\xea\x12'
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
            'window': 109899869,
5291
5299
            'properties': [1758270592, 1474783027, 1362037883, 19212066, 1095428186, 1435857629, 337040311, 1202859364, 1426187239, 725785004, 1722986690, 435243112],
5292
5300
            }
5293
 
        self.req_bin_0 = '\x72\x00\x00\x0f' '\x06\x8c\xf0\x5d' \
5294
 
            '\x00\x0c\x96\x29' '\x68\xcd\x14\x80' \
5295
 
            '\x57\xe7\x67\x33' '\x51\x2f\x0c\x7b' \
5296
 
            '\x01\x25\x27\x22' '\x41\x4a\xe8\x5a' \
5297
 
            '\x55\x95\x72\xdd' '\x14\x16\xd3\xb7' \
5298
 
            '\x47\xb2\x2d\x64' '\x55\x01\xe3\xe7' \
5299
 
            '\x2b\x42\x99\xac' '\x66\xb2\xb0\xc2' \
5300
 
            '\x19\xf1\x48\x68'
 
5301
        self.req_bin_0 = b'\x72\x00\x00\x0f' b'\x06\x8c\xf0\x5d' \
 
5302
            b'\x00\x0c\x96\x29' b'\x68\xcd\x14\x80' \
 
5303
            b'\x57\xe7\x67\x33' b'\x51\x2f\x0c\x7b' \
 
5304
            b'\x01\x25\x27\x22' b'\x41\x4a\xe8\x5a' \
 
5305
            b'\x55\x95\x72\xdd' b'\x14\x16\xd3\xb7' \
 
5306
            b'\x47\xb2\x2d\x64' b'\x55\x01\xe3\xe7' \
 
5307
            b'\x2b\x42\x99\xac' b'\x66\xb2\xb0\xc2' \
 
5308
            b'\x19\xf1\x48\x68'
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\x00\x01'
 
5335
        self.req_bin_0 = b'\x73\x01\x00\x01'
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': [218, 142, 195, 250, 194],
5353
5361
            }
5354
 
        self.req_bin_0 = '\x74\x05\x00\x03' '\xda\x8e\xc3\xfa' \
5355
 
            '\xc2\x00\x00\x00'
 
5362
        self.req_bin_0 = b'\x74\x05\x00\x03' b'\xda\x8e\xc3\xfa' \
 
5363
            b'\xc2\x00\x00\x00'
5356
5364
 
5357
5365
        self.reply_args_0 = {
5358
5366
            'sequence_number': 11995,
5359
5367
            'status': 187,
5360
5368
            }
5361
 
        self.reply_bin_0 = '\x01\xbb\x2e\xdb' '\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\xbb\x2e\xdb' 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\x00\x01'
 
5416
        self.req_bin_0 = b'\x75\x00\x00\x01'
5409
5417
 
5410
5418
        self.reply_args_0 = {
5411
5419
            'sequence_number': 35825,
5412
5420
            'map': [165, 233, 136, 197, 230],
5413
5421
            }
5414
 
        self.reply_bin_0 = '\x01\x05\x8b\xf1' '\x00\x00\x00\x02' \
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
 
            '\xa5\xe9\x88\xc5' '\xe6\x00\x00\x00'
 
5422
        self.reply_bin_0 = b'\x01\x05\x8b\xf1' b'\x00\x00\x00\x02' \
 
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'\xa5\xe9\x88\xc5' b'\xe6\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': [[72, 169], [161, 154], [26, 10], [108, 187], [110, 198], [225, 88], [33, 66], [189, 147]],
5462
5470
            }
5463
 
        self.req_bin_0 = '\x76\x02\x00\x05' '\x48\xa9\xa1\x9a' \
5464
 
            '\x1a\x0a\x6c\xbb' '\x6e\xc6\xe1\x58' \
5465
 
            '\x21\x42\xbd\x93'
 
5471
        self.req_bin_0 = b'\x76\x02\x00\x05' b'\x48\xa9\xa1\x9a' \
 
5472
            b'\x1a\x0a\x6c\xbb' b'\x6e\xc6\xe1\x58' \
 
5473
            b'\x21\x42\xbd\x93'
5466
5474
 
5467
5475
        self.reply_args_0 = {
5468
5476
            'sequence_number': 44526,
5469
5477
            'status': 188,
5470
5478
            }
5471
 
        self.reply_bin_0 = '\x01\xbc\xad\xee' '\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\xbc\xad\xee' 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\x00\x01'
 
5526
        self.req_bin_0 = b'\x77\x00\x00\x01'
5519
5527
 
5520
5528
        self.reply_args_0 = {
5521
5529
            'sequence_number': 58377,
5522
5530
            'keycodes': [[3, 183], [213, 173], [9, 97], [35, 60], [249, 78], [175, 62], [237, 11], [26, 119]],
5523
5531
            }
5524
 
        self.reply_bin_0 = '\x01\x02\xe4\x09' '\x00\x00\x00\x04' \
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
 
            '\x03\xb7\xd5\xad' '\x09\x61\x23\x3c' \
5529
 
            '\xf9\x4e\xaf\x3e' '\xed\x0b\x1a\x77'
 
5532
        self.reply_bin_0 = b'\x01\x02\xe4\x09' b'\x00\x00\x00\x04' \
 
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'\x03\xb7\xd5\xad' b'\x09\x61\x23\x3c' \
 
5537
            b'\xf9\x4e\xaf\x3e' b'\xed\x0b\x1a\x77'
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\x00\x01'
 
5581
        self.req_bin_0 = b'\x7f\x00\x00\x01'
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: