[go: up one dir, main page]

File: test_persist.py

package info (click to toggle)
luma.core 2.4.2-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,040 kB
  • sloc: python: 6,186; makefile: 204
file content (22 lines) | stat: -rw-r--r-- 507 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2018 Richard Hull and contributors
# See LICENSE.rst for details.


from unittest.mock import patch

from luma.core.device import dummy


def test_persist():
    dev = dummy()
    assert dev.persist is False
    with patch.object(dev, 'hide') as mock:
        dev.cleanup()
    mock.assert_called_once_with()
    dev = dummy()
    dev.persist = True
    with patch.object(dev, 'hide') as mock:
        dev.cleanup()
    mock.assert_not_called()