File: test_countdown.py

package info (click to toggle)
qtile 0.34.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,004 kB
  • sloc: python: 49,959; ansic: 4,371; xml: 324; sh: 260; makefile: 218
file content (14 lines) | stat: -rw-r--r-- 425 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from datetime import datetime, timedelta

from libqtile import widget

td = timedelta(days=10, hours=10, minutes=10, seconds=10)


def test_countdown_formatting():
    # Create widget but hide seconds from formatting to allow for
    # timing differences in test environment
    countdown = widget.Countdown(date=datetime.now() + td, format="{D}d {H}h {M}m")

    output = countdown.poll()
    assert output == "10d 10h 10m"