예제 #1
0
    def test_select_window(self):
        win = self.testWindow("test")
        wid = self.c.window.info()["id"]

        assert self.c.window.group.info()["name"] == "a"
        libpry.raises("no object", self.c.window.group["a"].info)

        assert len(self.c.window.layout.info()["stacks"]) == 1
        assert len(self.c.window.layout[1].info()["stacks"]) == 2

        assert self.c.window.screen.info()["index"] == 0
        libpry.raises("no object", self.c.window.screen[0].info)

    def test_items_widget(self):
        assert self.c.widget["one"].items("bar") == (True, None)

    def test_select_widget(self):
        w = self.c.widget["one"]
        assert w.bar.info()["position"] == "bottom"
        libpry.raises("no object", w.bar["bottom"].info)

    
tests = [
    uCommandObject(),
    utils.xfactory(xinerama=True), [
        uCall(),
        u_Server(),
    ],
    u_CommandTree(),
]
예제 #2
0
파일: test_manager.py 프로젝트: kanru/qtile
        t2 = libqtile.manager.Theme.parse(t.dump())
        assert t == t2

    def test_parserrors(self):
        s = libqtile.manager.Theme.parse
        libpry.raises("syntax error", s, "default {")
        libpry.raises("syntax error", s, "default ")
        libpry.raises("syntax error", s, "default { opacity =")
        libpry.raises("syntax error", s, "default { opacity = 0.1")
        libpry.raises("not a valid theme element", s, "default { invalid = 0.1 }")
        libpry.raises("must be of type integer", s, "default { border_width = 0.1 }")
        libpry.raises("must be of type float", s, "default { opacity = foo }")

    def test_fromFile(self):
        t = libqtile.manager.Theme.fromFile("themes/a")
        assert t


tests = [
    utils.xfactory(xinerama=True),
    [uQtile(), uMultiScreen()],
    utils.xfactory(xinerama=False),
    [uSingle(), uQtile()],
    utils.xfactory(xinerama=False),
    [uRandr()],
    uKey(),
    uLog(),
    uScreenDimensions(),
    uTheme(),
]
예제 #3
0
        self.conf.screens = [
            libqtile.manager.Screen(
                bottom=libqtile.bar.Bar([TestWidget(), libqtile.widget.Spacer(libqtile.bar.STRETCH), TestWidget()], 10)
            )
        ]
        self.startQtile(self.conf)
        i = self.c.bar["bottom"].info()
        assert i["widgets"][0]["offset"] == 0
        assert i["widgets"][1]["offset"] == 10
        assert i["widgets"][1]["width"] == 780
        assert i["widgets"][2]["offset"] == 790

    def test_singlespacer(self):
        self.conf.screens = [
            libqtile.manager.Screen(bottom=libqtile.bar.Bar([libqtile.widget.Spacer(libqtile.bar.STRETCH)], 10))
        ]
        self.startQtile(self.conf)
        i = self.c.bar["bottom"].info()
        assert i["widgets"][0]["offset"] == 0
        assert i["widgets"][0]["width"] == 800

    def test_nospacer(self):
        self.conf.screens = [libqtile.manager.Screen(bottom=libqtile.bar.Bar([TestWidget(), TestWidget()], 10))]
        self.startQtile(self.conf)
        i = self.c.bar["bottom"].info()
        assert i["widgets"][0]["offset"] == 0
        assert i["widgets"][1]["offset"] == 10


tests = [utils.xfactory(xinerama=True), [uBarGeometry(), uWidgets(), uBarErr(), uOffsetCalculation()]]
예제 #4
0

class SelectorConfig:
    groups = [
        libqtile.manager.Group("a"),
        libqtile.manager.Group("b"),
        libqtile.manager.Group("c"),
        libqtile.manager.Group("d")
    ]
    layouts = [
        layout.Max(),
        layout.Stack()
    ]
    keys = []
    screens = []


class uSelectors(utils.QtileTests):
    config = StackConfig()
    def test_simple(self):
        pass


tests = [
    utils.xfactory(xinerama=False), [
        uMax(),
        uStack(),
        uSelectors(),
    ],
]