Beispiel #1
0
 def test__NET_DESKTOP_VIEWPORT(self):
     viewport_origins_per_desktop = [1, 3, 1, 2, 1000, -1]
     atom, format, value = props.prepare_prop_for_write(
         self.dpy, '_NET_DESKTOP_VIEWPORT', viewport_origins_per_desktop)
     self.assertEqual(atom, self.dpy.get_atom('CARDINAL'))
     self.assertEqual(format, 32)
     self.assertEqual(value, viewport_origins_per_desktop)
Beispiel #2
0
 def test__NET_CLIENT_LIST(self):
     atom, format, value = props.prepare_prop_for_write(
         self.dpy, '_NET_CLIENT_LIST',
         [X.NONE, self.dpy.screen().root.id])
     self.assertEqual(atom, self.dpy.get_atom('WINDOW'))
     self.assertEqual(format, 32)
     self.assertEqual(value, [X.NONE, self.dpy.screen().root.id])
Beispiel #3
0
 def test__NET_WORKAREA(self):
     workarea_bounds_per_desktop = [
         1, 3, 4, 6, 0, 1, 2, 900, 3000000, 1000, -1, -800
     ]
     atom, format, value = props.prepare_prop_for_write(
         self.dpy, '_NET_WORKAREA', workarea_bounds_per_desktop)
     self.assertEqual(atom, self.dpy.get_atom('CARDINAL'))
     self.assertEqual(format, 32)
     self.assertEqual(value, workarea_bounds_per_desktop)
Beispiel #4
0
    def test__NET_WM_STRUT_PARTIAL(self):
        atom, format, value = props.prepare_prop_for_write(self.dpy, '_NET_WM_STRUT_PARTIAL', [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12])
        self.assertEqual(atom, self.dpy.get_atom('CARDINAL'))
        self.assertEqual(format, 32)
        self.assertEqual(value, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12])

        #testing multiples of 12 or not
        self.assertRaises(Exception, props.prepare_prop_for_write, self.dpy, '_NET_WM_STRUT_PARTIAL', [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11])
        self.assertRaises(Exception, props.prepare_prop_for_write, self.dpy, '_NET_WM_STRUT_PARTIAL', [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13])
Beispiel #5
0
 def test__NET_WORKAREA(self):
     workarea_bounds_per_desktop = [
         1, 3, 4, 6,
         0, 1, 2, 900,
         3000000, 1000, -1, -800
     ]
     atom, format, value = props.prepare_prop_for_write(self.dpy, '_NET_WORKAREA', workarea_bounds_per_desktop)
     self.assertEqual(atom, self.dpy.get_atom('CARDINAL'))
     self.assertEqual(format, 32)
     self.assertEqual(value, workarea_bounds_per_desktop)
Beispiel #6
0
 def test__NET_DESKTOP_VIEWPORT(self):
     viewport_origins_per_desktop = [
         1, 3,
         1, 2,
         1000, -1
     ]
     atom, format, value = props.prepare_prop_for_write(self.dpy, '_NET_DESKTOP_VIEWPORT', viewport_origins_per_desktop)
     self.assertEqual(atom, self.dpy.get_atom('CARDINAL'))
     self.assertEqual(format, 32)
     self.assertEqual(value, viewport_origins_per_desktop)
Beispiel #7
0
 def test__NET_SUPPORTED(self):
     atom, format, value = props.prepare_prop_for_write(self.dpy, '_NET_SUPPORTED', [
         self.dpy.get_atom('_NET_WM_ACTION_MAXIMIZE_HORZ'),
         self.dpy.get_atom('_NET_WM_ACTION_MAXIMIZE_VERT'),
         self.dpy.get_atom('_NET_WM_ACTION_FULLSCREEN')
     ])
     self.assertEqual(atom, self.dpy.get_atom('ATOM'))
     self.assertEqual(format, 32)
     self.assertEqual(value, [
         self.dpy.get_atom('_NET_WM_ACTION_MAXIMIZE_HORZ'),
         self.dpy.get_atom('_NET_WM_ACTION_MAXIMIZE_VERT'),
         self.dpy.get_atom('_NET_WM_ACTION_FULLSCREEN')
     ])
Beispiel #8
0
 def test__NET_SUPPORTED(self):
     atom, format, value = props.prepare_prop_for_write(
         self.dpy, '_NET_SUPPORTED', [
             self.dpy.get_atom('_NET_WM_ACTION_MAXIMIZE_HORZ'),
             self.dpy.get_atom('_NET_WM_ACTION_MAXIMIZE_VERT'),
             self.dpy.get_atom('_NET_WM_ACTION_FULLSCREEN')
         ])
     self.assertEqual(atom, self.dpy.get_atom('ATOM'))
     self.assertEqual(format, 32)
     self.assertEqual(value, [
         self.dpy.get_atom('_NET_WM_ACTION_MAXIMIZE_HORZ'),
         self.dpy.get_atom('_NET_WM_ACTION_MAXIMIZE_VERT'),
         self.dpy.get_atom('_NET_WM_ACTION_FULLSCREEN')
     ])
Beispiel #9
0
    def test__NET_WM_STRUT_PARTIAL(self):
        atom, format, value = props.prepare_prop_for_write(
            self.dpy, '_NET_WM_STRUT_PARTIAL',
            [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12])
        self.assertEqual(atom, self.dpy.get_atom('CARDINAL'))
        self.assertEqual(format, 32)
        self.assertEqual(value, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12])

        #testing multiples of 12 or not
        self.assertRaises(Exception, props.prepare_prop_for_write, self.dpy,
                          '_NET_WM_STRUT_PARTIAL',
                          [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11])
        self.assertRaises(Exception, props.prepare_prop_for_write, self.dpy,
                          '_NET_WM_STRUT_PARTIAL',
                          [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13])
Beispiel #10
0
 def test__NET_DESKTOP_NAMES(self):
     atom, format, value = props.prepare_prop_for_write(
         self.dpy, '_NET_DESKTOP_NAMES', ["hey", "there", u"guy"])
     self.assertEqual(atom, self.dpy.get_atom('UTF8_STRING'))
     self.assertEqual(format, 8)
     self.assertEqual(value, ["hey", "there", u"guy"])
Beispiel #11
0
 def test__NET_ACTIVE_WINDOW(self):
     atom, format, value = props.prepare_prop_for_write(
         self.dpy, '_NET_ACTIVE_WINDOW', X.NONE)
     self.assertEqual(atom, self.dpy.get_atom('WINDOW'))
     self.assertEqual(format, 32)
     self.assertEqual(value, [X.NONE])
Beispiel #12
0
 def test__NET_WM_STRUT(self):
     atom, format, value = props.prepare_prop_for_write(
         self.dpy, '_NET_WM_STRUT', [1, 2, 3, 4])
     self.assertEqual(atom, self.dpy.get_atom('CARDINAL'))
     self.assertEqual(format, 32)
     self.assertEqual(value, [1, 2, 3, 4])
Beispiel #13
0
 def test__NET_WM_PID(self):
     atom, format, value = props.prepare_prop_for_write(
         self.dpy, '_NET_WM_PID', 5)
     self.assertEqual(atom, self.dpy.get_atom('CARDINAL'))
     self.assertEqual(format, 32)
     self.assertEqual(value, [5])
Beispiel #14
0
 def test__NET_WM_PID(self):
     atom, format, value = props.prepare_prop_for_write(self.dpy, '_NET_WM_PID', 5)
     self.assertEqual(atom, self.dpy.get_atom('CARDINAL'))
     self.assertEqual(format, 32)
     self.assertEqual(value, [5])
Beispiel #15
0
 def test__NET_CLIENT_LIST(self):
     atom, format, value = props.prepare_prop_for_write(self.dpy, '_NET_CLIENT_LIST', [X.NONE, self.dpy.screen().root.id])
     self.assertEqual(atom, self.dpy.get_atom('WINDOW'))
     self.assertEqual(format, 32)
     self.assertEqual(value, [X.NONE, self.dpy.screen().root.id])
Beispiel #16
0
 def test__NET_DESKTOP_NAMES(self):
     atom, format, value = props.prepare_prop_for_write(self.dpy, '_NET_DESKTOP_NAMES', ["hey", "there", u"guy"])
     self.assertEqual(atom, self.dpy.get_atom('UTF8_STRING'))
     self.assertEqual(format, 8)
     self.assertEqual(value, ["hey", "there", u"guy"])
Beispiel #17
0
 def test__NET_ACTIVE_WINDOW(self):
     atom, format, value = props.prepare_prop_for_write(self.dpy, '_NET_ACTIVE_WINDOW', X.NONE)
     self.assertEqual(atom, self.dpy.get_atom('WINDOW'))
     self.assertEqual(format, 32)
     self.assertEqual(value, [X.NONE])
Beispiel #18
0
 def test__NET_WM_STRUT(self):
     atom, format, value = props.prepare_prop_for_write(self.dpy, '_NET_WM_STRUT', [1, 2, 3, 4])
     self.assertEqual(atom, self.dpy.get_atom('CARDINAL'))
     self.assertEqual(format, 32)
     self.assertEqual(value, [1, 2, 3, 4])
Beispiel #19
0
 def test__NET_WM_NAME(self):
     atom, format, value = props.prepare_prop_for_write(
         self.dpy, '_NET_WM_NAME', 'this is the value')
     self.assertEqual(atom, self.dpy.get_atom('UTF8_STRING'))
     self.assertEqual(format, 8)
     self.assertEqual(value, u'this is the value')
Beispiel #20
0
 def test__NET_WM_NAME(self):
     atom, format, value = props.prepare_prop_for_write(self.dpy, '_NET_WM_NAME', 'this is the value')
     self.assertEqual(atom, self.dpy.get_atom('UTF8_STRING'))
     self.assertEqual(format, 8)
     self.assertEqual(value, u'this is the value')