~bennabiy/+junk/python-xlib

« back to all changes in this revision

Viewing changes to test/test_events_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)
24
23
    def __getattr__(self, attr):
25
24
        return getattr(self.array, attr)
26
25
 
27
 
    def __cmp__(self, other):
28
 
        return cmp(self.array.tolist(), other)
 
26
    def __eq__(self, other):
 
27
        return self.array.tolist() == other
 
28
 
 
29
    def __ne__(self, other):
 
30
        return self.array.tolist() != other
29
31
 
30
32
rq.array = CmpArray
31
33
 
32
34
def tohex(bin):
33
 
    bin = string.join(map(lambda c: '\\x%02x' % ord(c), bin), '')
 
35
    bin = ''.join(map(lambda c: '\\x%02x' % c, bin))
34
36
 
35
37
    bins = []
36
38
    for i in range(0, len(bin), 16):
43
45
        except IndexError:
44
46
            bins2.append("'%s'" % bins[i])
45
47
 
46
 
    return string.join(bins2, ' \\\n            ')
 
48
    return ' \\\n            '.join(bins2)
47
49
 
48
50
class DummyDisplay:
49
51
    def get_resource_class(self, x):
66
68
            'type': 154,
67
69
            'data': [160, 192, 133, 223, 245, 128, 133, 188, 208, 142, 202, 142, 218, 238, 145, 150, 211, 150, 165, 230, 149, 162, 139, 159, 135, 255, 246, 202, 232, 185, 164],
68
70
            }
69
 
        self.evt_bin_0 = '\x9a\xa0\xc0\x85' '\xdf\xf5\x80\x85' \
70
 
            '\xbc\xd0\x8e\xca' '\x8e\xda\xee\x91' \
71
 
            '\x96\xd3\x96\xa5' '\xe6\x95\xa2\x8b' \
72
 
            '\x9f\x87\xff\xf6' '\xca\xe8\xb9\xa4'
 
71
        self.evt_bin_0 = b'\x9a\xa0\xc0\x85' b'\xdf\xf5\x80\x85' \
 
72
            b'\xbc\xd0\x8e\xca' b'\x8e\xda\xee\x91' \
 
73
            b'\x96\xd3\x96\xa5' b'\xe6\x95\xa2\x8b' \
 
74
            b'\x9f\x87\xff\xf6' b'\xca\xe8\xb9\xa4'
73
75
 
74
76
 
75
77
    def testPack0(self):
76
 
        bin = apply(event.KeymapNotify._fields.to_binary, (), self.evt_args_0)
 
78
        bin = event.KeymapNotify._fields.to_binary(*(), **self.evt_args_0)
77
79
        try:
78
80
            assert bin == self.evt_bin_0
79
81
        except AssertionError:
103
105
            'width': 26369,
104
106
            'count': 60118,
105
107
            }
106
 
        self.evt_bin_0 = '\xfe\x00\xdb\xcc' '\x52\x5b\x35\x64' \
107
 
            '\x42\x4e\x4d\x28' '\x67\x01\x56\xc6' \
108
 
            '\xea\xd6\x00\x00' '\x00\x00\x00\x00' \
109
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
108
        self.evt_bin_0 = b'\xfe\x00\xdb\xcc' b'\x52\x5b\x35\x64' \
 
109
            b'\x42\x4e\x4d\x28' b'\x67\x01\x56\xc6' \
 
110
            b'\xea\xd6\x00\x00' b'\x00\x00\x00\x00' \
 
111
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
110
112
 
111
113
 
112
114
    def testPack0(self):
113
 
        bin = apply(event.Expose._fields.to_binary, (), self.evt_args_0)
 
115
        bin = event.Expose._fields.to_binary(*(), **self.evt_args_0)
114
116
        try:
115
117
            assert bin == self.evt_bin_0
116
118
        except AssertionError:
142
144
            'width': 58556,
143
145
            'minor_event': 22632,
144
146
            }
145
 
        self.evt_bin_0 = '\xf2\x00\x18\xec' '\x30\xe6\x7b\x80' \
146
 
            '\xe0\xf9\xa3\x22' '\xe4\xbc\x01\x60' \
147
 
            '\x58\x68\xf7\x59' '\xd8\x00\x00\x00' \
148
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
147
        self.evt_bin_0 = b'\xf2\x00\x18\xec' b'\x30\xe6\x7b\x80' \
 
148
            b'\xe0\xf9\xa3\x22' b'\xe4\xbc\x01\x60' \
 
149
            b'\x58\x68\xf7\x59' b'\xd8\x00\x00\x00' \
 
150
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
149
151
 
150
152
 
151
153
    def testPack0(self):
152
 
        bin = apply(event.GraphicsExpose._fields.to_binary, (), self.evt_args_0)
 
154
        bin = event.GraphicsExpose._fields.to_binary(*(), **self.evt_args_0)
153
155
        try:
154
156
            assert bin == self.evt_bin_0
155
157
        except AssertionError:
176
178
            'window': 1319843810,
177
179
            'minor_event': 45687,
178
180
            }
179
 
        self.evt_bin_0 = '\xbb\x00\xb4\x5b' '\x4e\xab\x37\xe2' \
180
 
            '\xb2\x77\xf2\x00' '\x00\x00\x00\x00' \
181
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
182
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
181
        self.evt_bin_0 = b'\xbb\x00\xb4\x5b' b'\x4e\xab\x37\xe2' \
 
182
            b'\xb2\x77\xf2\x00' b'\x00\x00\x00\x00' \
 
183
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
184
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
183
185
 
184
186
 
185
187
    def testPack0(self):
186
 
        bin = apply(event.NoExpose._fields.to_binary, (), self.evt_args_0)
 
188
        bin = event.NoExpose._fields.to_binary(*(), **self.evt_args_0)
187
189
        try:
188
190
            assert bin == self.evt_bin_0
189
191
        except AssertionError:
209
211
            'type': 242,
210
212
            'window': 1543431298,
211
213
            }
212
 
        self.evt_bin_0 = '\xf2\x00\xce\x45' '\x5b\xfe\xe4\x82' \
213
 
            '\xee\x00\x00\x00' '\x00\x00\x00\x00' \
214
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
215
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
214
        self.evt_bin_0 = b'\xf2\x00\xce\x45' b'\x5b\xfe\xe4\x82' \
 
215
            b'\xee\x00\x00\x00' b'\x00\x00\x00\x00' \
 
216
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
217
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
216
218
 
217
219
 
218
220
    def testPack0(self):
219
 
        bin = apply(event.VisibilityNotify._fields.to_binary, (), self.evt_args_0)
 
221
        bin = event.VisibilityNotify._fields.to_binary(*(), **self.evt_args_0)
220
222
        try:
221
223
            assert bin == self.evt_bin_0
222
224
        except AssertionError:
248
250
            'window': 8505372,
249
251
            'width': 8871,
250
252
            }
251
 
        self.evt_bin_0 = '\xff\x00\x20\x3d' '\x27\x00\x3a\x54' \
252
 
            '\x00\x81\xc8\x1c' '\x86\x1c\xa2\x9c' \
253
 
            '\x22\xa7\x3c\x92' '\xd0\xa6\x01\x00' \
254
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
253
        self.evt_bin_0 = b'\xff\x00\x20\x3d' b'\x27\x00\x3a\x54' \
 
254
            b'\x00\x81\xc8\x1c' b'\x86\x1c\xa2\x9c' \
 
255
            b'\x22\xa7\x3c\x92' b'\xd0\xa6\x01\x00' \
 
256
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
255
257
 
256
258
 
257
259
    def testPack0(self):
258
 
        bin = apply(event.CreateNotify._fields.to_binary, (), self.evt_args_0)
 
260
        bin = event.CreateNotify._fields.to_binary(*(), **self.evt_args_0)
259
261
        try:
260
262
            assert bin == self.evt_bin_0
261
263
        except AssertionError:
281
283
            'type': 223,
282
284
            'window': 1716558237,
283
285
            }
284
 
        self.evt_bin_0 = '\xdf\x00\xbf\xf1' '\x18\x56\x02\x91' \
285
 
            '\x66\x50\x99\x9d' '\x00\x00\x00\x00' \
286
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
287
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
286
        self.evt_bin_0 = b'\xdf\x00\xbf\xf1' b'\x18\x56\x02\x91' \
 
287
            b'\x66\x50\x99\x9d' b'\x00\x00\x00\x00' \
 
288
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
289
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
288
290
 
289
291
 
290
292
    def testPack0(self):
291
 
        bin = apply(event.DestroyNotify._fields.to_binary, (), self.evt_args_0)
 
293
        bin = event.DestroyNotify._fields.to_binary(*(), **self.evt_args_0)
292
294
        try:
293
295
            assert bin == self.evt_bin_0
294
296
        except AssertionError:
315
317
            'type': 217,
316
318
            'window': 1455493798,
317
319
            }
318
 
        self.evt_bin_0 = '\xd9\x00\x11\x3c' '\x42\xe1\xef\x20' \
319
 
            '\x56\xc1\x12\xa6' '\x00\x00\x00\x00' \
320
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
321
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
320
        self.evt_bin_0 = b'\xd9\x00\x11\x3c' b'\x42\xe1\xef\x20' \
 
321
            b'\x56\xc1\x12\xa6' b'\x00\x00\x00\x00' \
 
322
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
323
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
322
324
 
323
325
 
324
326
    def testPack0(self):
325
 
        bin = apply(event.UnmapNotify._fields.to_binary, (), self.evt_args_0)
 
327
        bin = event.UnmapNotify._fields.to_binary(*(), **self.evt_args_0)
326
328
        try:
327
329
            assert bin == self.evt_bin_0
328
330
        except AssertionError:
349
351
            'window': 1882369959,
350
352
            'override': 0,
351
353
            }
352
 
        self.evt_bin_0 = '\xe4\x00\xfe\x48' '\x13\x96\x31\xdc' \
353
 
            '\x70\x32\xaf\xa7' '\x00\x00\x00\x00' \
354
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
355
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
354
        self.evt_bin_0 = b'\xe4\x00\xfe\x48' b'\x13\x96\x31\xdc' \
 
355
            b'\x70\x32\xaf\xa7' b'\x00\x00\x00\x00' \
 
356
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
357
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
356
358
 
357
359
 
358
360
    def testPack0(self):
359
 
        bin = apply(event.MapNotify._fields.to_binary, (), self.evt_args_0)
 
361
        bin = event.MapNotify._fields.to_binary(*(), **self.evt_args_0)
360
362
        try:
361
363
            assert bin == self.evt_bin_0
362
364
        except AssertionError:
382
384
            'type': 171,
383
385
            'window': 488763730,
384
386
            }
385
 
        self.evt_bin_0 = '\xab\x00\xc9\x60' '\x63\x32\x36\x90' \
386
 
            '\x1d\x21\xf1\x52' '\x00\x00\x00\x00' \
387
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
388
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
387
        self.evt_bin_0 = b'\xab\x00\xc9\x60' b'\x63\x32\x36\x90' \
 
388
            b'\x1d\x21\xf1\x52' b'\x00\x00\x00\x00' \
 
389
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
390
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
389
391
 
390
392
 
391
393
    def testPack0(self):
392
 
        bin = apply(event.MapRequest._fields.to_binary, (), self.evt_args_0)
 
394
        bin = event.MapRequest._fields.to_binary(*(), **self.evt_args_0)
393
395
        try:
394
396
            assert bin == self.evt_bin_0
395
397
        except AssertionError:
419
421
            'parent': 912114770,
420
422
            'window': 1142506827,
421
423
            }
422
 
        self.evt_bin_0 = '\xe5\x00\x24\x28' '\x77\x39\xbd\xd5' \
423
 
            '\x44\x19\x45\x4b' '\x36\x5d\xc4\x52' \
424
 
            '\x90\x55\xd2\xb3' '\x01\x00\x00\x00' \
425
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
424
        self.evt_bin_0 = b'\xe5\x00\x24\x28' b'\x77\x39\xbd\xd5' \
 
425
            b'\x44\x19\x45\x4b' b'\x36\x5d\xc4\x52' \
 
426
            b'\x90\x55\xd2\xb3' b'\x01\x00\x00\x00' \
 
427
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
426
428
 
427
429
 
428
430
    def testPack0(self):
429
 
        bin = apply(event.ReparentNotify._fields.to_binary, (), self.evt_args_0)
 
431
        bin = event.ReparentNotify._fields.to_binary(*(), **self.evt_args_0)
430
432
        try:
431
433
            assert bin == self.evt_bin_0
432
434
        except AssertionError:
459
461
            'window': 2046157981,
460
462
            'width': 8604,
461
463
            }
462
 
        self.evt_bin_0 = '\xbf\x00\xf3\x9c' '\x51\xdd\x44\x66' \
463
 
            '\x79\xf5\xe4\x9d' '\x41\x8b\x95\xa2' \
464
 
            '\xce\x1d\xc4\x84' '\x21\x9c\x3f\x73' \
465
 
            '\x1c\x4c\x01\x00' '\x00\x00\x00\x00'
 
464
        self.evt_bin_0 = b'\xbf\x00\xf3\x9c' b'\x51\xdd\x44\x66' \
 
465
            b'\x79\xf5\xe4\x9d' b'\x41\x8b\x95\xa2' \
 
466
            b'\xce\x1d\xc4\x84' b'\x21\x9c\x3f\x73' \
 
467
            b'\x1c\x4c\x01\x00' b'\x00\x00\x00\x00'
466
468
 
467
469
 
468
470
    def testPack0(self):
469
 
        bin = apply(event.ConfigureNotify._fields.to_binary, (), self.evt_args_0)
 
471
        bin = event.ConfigureNotify._fields.to_binary(*(), **self.evt_args_0)
470
472
        try:
471
473
            assert bin == self.evt_bin_0
472
474
        except AssertionError:
500
502
            'stack_mode': 199,
501
503
            'parent': 176713389,
502
504
            }
503
 
        self.evt_bin_0 = '\x9c\xc7\x7a\x91' '\x0a\x88\x6e\xad' \
504
 
            '\x49\x60\x48\x53' '\x44\xd3\x8b\x96' \
505
 
            '\xb8\xf1\xbb\x01' '\xc9\xa4\xb7\xf6' \
506
 
            '\xd5\xfb\x4b\x91' '\x00\x00\x00\x00'
 
505
        self.evt_bin_0 = b'\x9c\xc7\x7a\x91' b'\x0a\x88\x6e\xad' \
 
506
            b'\x49\x60\x48\x53' b'\x44\xd3\x8b\x96' \
 
507
            b'\xb8\xf1\xbb\x01' b'\xc9\xa4\xb7\xf6' \
 
508
            b'\xd5\xfb\x4b\x91' b'\x00\x00\x00\x00'
507
509
 
508
510
 
509
511
    def testPack0(self):
510
 
        bin = apply(event.ConfigureRequest._fields.to_binary, (), self.evt_args_0)
 
512
        bin = event.ConfigureRequest._fields.to_binary(*(), **self.evt_args_0)
511
513
        try:
512
514
            assert bin == self.evt_bin_0
513
515
        except AssertionError:
535
537
            'x': -21924,
536
538
            'y': -4866,
537
539
            }
538
 
        self.evt_bin_0 = '\xc0\x00\xa9\x70' '\x26\x3d\x12\xa5' \
539
 
            '\x03\x14\xd8\x1a' '\xaa\x5c\xec\xfe' \
540
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
541
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
540
        self.evt_bin_0 = b'\xc0\x00\xa9\x70' b'\x26\x3d\x12\xa5' \
 
541
            b'\x03\x14\xd8\x1a' b'\xaa\x5c\xec\xfe' \
 
542
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
543
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
542
544
 
543
545
 
544
546
    def testPack0(self):
545
 
        bin = apply(event.GravityNotify._fields.to_binary, (), self.evt_args_0)
 
547
        bin = event.GravityNotify._fields.to_binary(*(), **self.evt_args_0)
546
548
        try:
547
549
            assert bin == self.evt_bin_0
548
550
        except AssertionError:
569
571
            'window': 1698104652,
570
572
            'width': 41494,
571
573
            }
572
 
        self.evt_bin_0 = '\x95\x00\x53\x64' '\x65\x37\x05\x4c' \
573
 
            '\xa2\x16\xe9\x68' '\x00\x00\x00\x00' \
574
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
575
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
574
        self.evt_bin_0 = b'\x95\x00\x53\x64' b'\x65\x37\x05\x4c' \
 
575
            b'\xa2\x16\xe9\x68' b'\x00\x00\x00\x00' \
 
576
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
577
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
576
578
 
577
579
 
578
580
    def testPack0(self):
579
 
        bin = apply(event.ResizeRequest._fields.to_binary, (), self.evt_args_0)
 
581
        bin = event.ResizeRequest._fields.to_binary(*(), **self.evt_args_0)
580
582
        try:
581
583
            assert bin == self.evt_bin_0
582
584
        except AssertionError:
604
606
            'state': 181,
605
607
            'window': 334365400,
606
608
            }
607
 
        self.evt_bin_0 = '\xbc\x00\x73\xe6' '\x13\xee\x02\xd8' \
608
 
            '\x2d\x74\x24\x38' '\x6a\xc2\x4b\x25' \
609
 
            '\xb5\x00\x00\x00' '\x00\x00\x00\x00' \
610
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
609
        self.evt_bin_0 = b'\xbc\x00\x73\xe6' b'\x13\xee\x02\xd8' \
 
610
            b'\x2d\x74\x24\x38' b'\x6a\xc2\x4b\x25' \
 
611
            b'\xb5\x00\x00\x00' b'\x00\x00\x00\x00' \
 
612
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
611
613
 
612
614
 
613
615
    def testPack0(self):
614
 
        bin = apply(event.PropertyNotify._fields.to_binary, (), self.evt_args_0)
 
616
        bin = event.PropertyNotify._fields.to_binary(*(), **self.evt_args_0)
615
617
        try:
616
618
            assert bin == self.evt_bin_0
617
619
        except AssertionError:
638
640
            'type': 170,
639
641
            'window': 355039782,
640
642
            }
641
 
        self.evt_bin_0 = '\xaa\x00\x35\x7b' '\x22\x74\xca\x43' \
642
 
            '\x15\x29\x7a\x26' '\x52\x94\x54\x73' \
643
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
644
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
643
        self.evt_bin_0 = b'\xaa\x00\x35\x7b' b'\x22\x74\xca\x43' \
 
644
            b'\x15\x29\x7a\x26' b'\x52\x94\x54\x73' \
 
645
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
646
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
645
647
 
646
648
 
647
649
    def testPack0(self):
648
 
        bin = apply(event.SelectionClear._fields.to_binary, (), self.evt_args_0)
 
650
        bin = event.SelectionClear._fields.to_binary(*(), **self.evt_args_0)
649
651
        try:
650
652
            assert bin == self.evt_bin_0
651
653
        except AssertionError:
675
677
            'selection': 1972323175,
676
678
            'requestor': 178195168,
677
679
            }
678
 
        self.evt_bin_0 = '\xa2\x00\x33\xc6' '\x44\xd2\x57\x9a' \
679
 
            '\x7b\xba\xc5\x57' '\x0a\x9f\x0a\xe0' \
680
 
            '\x75\x8f\x43\x67' '\x4e\x3b\xb0\x83' \
681
 
            '\x17\xac\x30\xe9' '\x00\x00\x00\x00'
 
680
        self.evt_bin_0 = b'\xa2\x00\x33\xc6' b'\x44\xd2\x57\x9a' \
 
681
            b'\x7b\xba\xc5\x57' b'\x0a\x9f\x0a\xe0' \
 
682
            b'\x75\x8f\x43\x67' b'\x4e\x3b\xb0\x83' \
 
683
            b'\x17\xac\x30\xe9' b'\x00\x00\x00\x00'
682
684
 
683
685
 
684
686
    def testPack0(self):
685
 
        bin = apply(event.SelectionRequest._fields.to_binary, (), self.evt_args_0)
 
687
        bin = event.SelectionRequest._fields.to_binary(*(), **self.evt_args_0)
686
688
        try:
687
689
            assert bin == self.evt_bin_0
688
690
        except AssertionError:
711
713
            'selection': 781895626,
712
714
            'requestor': 1242076588,
713
715
            }
714
 
        self.evt_bin_0 = '\xc7\x00\x9b\x38' '\x34\x95\x2f\x5e' \
715
 
            '\x4a\x08\x95\xac' '\x2e\x9a\xc7\xca' \
716
 
            '\x7f\x0b\x8a\x2d' '\x12\x05\xd7\x93' \
717
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
716
        self.evt_bin_0 = b'\xc7\x00\x9b\x38' b'\x34\x95\x2f\x5e' \
 
717
            b'\x4a\x08\x95\xac' b'\x2e\x9a\xc7\xca' \
 
718
            b'\x7f\x0b\x8a\x2d' b'\x12\x05\xd7\x93' \
 
719
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
718
720
 
719
721
 
720
722
    def testPack0(self):
721
 
        bin = apply(event.SelectionNotify._fields.to_binary, (), self.evt_args_0)
 
723
        bin = event.SelectionNotify._fields.to_binary(*(), **self.evt_args_0)
722
724
        try:
723
725
            assert bin == self.evt_bin_0
724
726
        except AssertionError:
746
748
            'window': 1591667531,
747
749
            'new': 1,
748
750
            }
749
 
        self.evt_bin_0 = '\xe9\x00\xf5\xb6' '\x5e\xde\xeb\x4b' \
750
 
            '\x11\xed\xd7\x06' '\x01\xd1\x00\x00' \
751
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
752
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
751
        self.evt_bin_0 = b'\xe9\x00\xf5\xb6' b'\x5e\xde\xeb\x4b' \
 
752
            b'\x11\xed\xd7\x06' b'\x01\xd1\x00\x00' \
 
753
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
754
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
753
755
 
754
756
 
755
757
    def testPack0(self):
756
 
        bin = apply(event.ColormapNotify._fields.to_binary, (), self.evt_args_0)
 
758
        bin = event.ColormapNotify._fields.to_binary(*(), **self.evt_args_0)
757
759
        try:
758
760
            assert bin == self.evt_bin_0
759
761
        except AssertionError:
780
782
            'client_type': 1340394836,
781
783
            'window': 1256861040,
782
784
            }
783
 
        self.evt_bin_0 = '\xf5\x08\xbe\x48' '\x4a\xea\x2d\x70' \
784
 
            '\x4f\xe4\xcd\x54' '\x30\x31\x32\x33' \
785
 
            '\x34\x35\x36\x37' '\x38\x39\x30\x31' \
786
 
            '\x32\x33\x34\x35' '\x36\x37\x38\x39'
 
785
        self.evt_bin_0 = b'\xf5\x08\xbe\x48' b'\x4a\xea\x2d\x70' \
 
786
            b'\x4f\xe4\xcd\x54' b'\x30\x31\x32\x33' \
 
787
            b'\x34\x35\x36\x37' b'\x38\x39\x30\x31' \
 
788
            b'\x32\x33\x34\x35' b'\x36\x37\x38\x39'
787
789
 
788
790
        self.evt_args_1 = {
789
791
            'sequence_number': 62804,
792
794
            'client_type': 214585025,
793
795
            'window': 151327338,
794
796
            }
795
 
        self.evt_bin_1 = '\xfa\x10\xf5\x54' '\x09\x05\x12\x6a' \
796
 
            '\x0c\xca\x4e\xc1' '\x00\x01\x00\x02' \
797
 
            '\x00\x03\x00\x04' '\x00\x05\x00\x06' \
798
 
            '\x00\x07\x00\x08' '\x00\x09\x00\x0a'
 
797
        self.evt_bin_1 = b'\xfa\x10\xf5\x54' b'\x09\x05\x12\x6a' \
 
798
            b'\x0c\xca\x4e\xc1' b'\x00\x01\x00\x02' \
 
799
            b'\x00\x03\x00\x04' b'\x00\x05\x00\x06' \
 
800
            b'\x00\x07\x00\x08' b'\x00\x09\x00\x0a'
799
801
 
800
802
        self.evt_args_2 = {
801
803
            'sequence_number': 3122,
804
806
            'client_type': 698151018,
805
807
            'window': 725159371,
806
808
            }
807
 
        self.evt_bin_2 = '\xf3\x20\x0c\x32' '\x2b\x39\x0d\xcb' \
808
 
            '\x29\x9c\xf0\x6a' '\x00\x00\x00\x01' \
809
 
            '\x00\x00\x00\x02' '\x00\x00\x00\x03' \
810
 
            '\x00\x00\x00\x04' '\x00\x00\x00\x05'
 
809
        self.evt_bin_2 = b'\xf3\x20\x0c\x32' b'\x2b\x39\x0d\xcb' \
 
810
            b'\x29\x9c\xf0\x6a' b'\x00\x00\x00\x01' \
 
811
            b'\x00\x00\x00\x02' b'\x00\x00\x00\x03' \
 
812
            b'\x00\x00\x00\x04' b'\x00\x00\x00\x05'
811
813
 
812
814
 
813
815
    def testPack0(self):
814
 
        bin = apply(event.ClientMessage._fields.to_binary, (), self.evt_args_0)
 
816
        bin = event.ClientMessage._fields.to_binary(*(), **self.evt_args_0)
815
817
        try:
816
818
            assert bin == self.evt_bin_0
817
819
        except AssertionError:
829
831
            raise AssertionError(args)
830
832
 
831
833
    def testPack1(self):
832
 
        bin = apply(event.ClientMessage._fields.to_binary, (), self.evt_args_1)
 
834
        bin = event.ClientMessage._fields.to_binary(*(), **self.evt_args_1)
833
835
        try:
834
836
            assert bin == self.evt_bin_1
835
837
        except AssertionError:
847
849
            raise AssertionError(args)
848
850
 
849
851
    def testPack2(self):
850
 
        bin = apply(event.ClientMessage._fields.to_binary, (), self.evt_args_2)
 
852
        bin = event.ClientMessage._fields.to_binary(*(), **self.evt_args_2)
851
853
        try:
852
854
            assert bin == self.evt_bin_2
853
855
        except AssertionError:
874
876
            'type': 252,
875
877
            'first_keycode': 218,
876
878
            }
877
 
        self.evt_bin_0 = '\xfc\x00\xd1\x25' '\x8d\xda\x97\x00' \
878
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
879
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
880
 
            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
 
879
        self.evt_bin_0 = b'\xfc\x00\xd1\x25' b'\x8d\xda\x97\x00' \
 
880
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
881
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
 
882
            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
881
883
 
882
884
 
883
885
    def testPack0(self):
884
 
        bin = apply(event.MappingNotify._fields.to_binary, (), self.evt_args_0)
 
886
        bin = event.MappingNotify._fields.to_binary(*(), **self.evt_args_0)
885
887
        try:
886
888
            assert bin == self.evt_bin_0
887
889
        except AssertionError: