Exemplo n.º 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)
Exemplo n.º 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])
Exemplo n.º 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)
Exemplo n.º 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])
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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')
     ])
Exemplo n.º 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')
     ])
Exemplo n.º 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])
Exemplo n.º 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"])
Exemplo n.º 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])
Exemplo n.º 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])
Exemplo n.º 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])
Exemplo n.º 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])
Exemplo n.º 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])
Exemplo n.º 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"])
Exemplo n.º 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])
Exemplo n.º 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])
Exemplo n.º 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')
Exemplo n.º 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')