Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_is_started():
# d = Display()
# assert not d._is_started
# d.start()
# assert d._is_started
# d.stop()
# assert d._is_started
# with Display() as d:
# assert d._is_started
# assert d._is_started
with XvfbDisplay() as d:
assert d._is_started
assert d._is_started
with Display():
with XephyrDisplay() as d:
assert d._is_started
assert d._is_started
def test_repr_xvfb():
display = Display()
print(repr(display))
display = Display(visible=False)
print(repr(display))
display = Display(backend="xvfb")
print(repr(display))
display = XvfbDisplay()
print(repr(display))
def test_display():
d = Display()
assert d.display is None
d.start()
assert d.display >= 0
d = XvfbDisplay()
assert d.display is None
d.start()
assert d.display >= 0
def test_pid():
with Display() as d:
assert d.pid > 0
with XvfbDisplay() as d:
assert d.pid > 0