panda3d/tests/display/test_window.py
Mitchell Stokes aabf009ff0 tests: Add test_window_basic
This test just makes sure that created windows match the default
WindowProperties (with a few exceptions).

This also adds the following fixtures:

  * graphics_engine - scope='session', GraphicsEngine
  * graphics_pipe - scope='session', default GraphicsPipe
  * window - scope='test', GraphicsWindow with default framebuffer and window properties
2017-11-03 19:25:13 +01:00

16 lines
526 B
Python

def test_window_basic(window):
from panda3d.core import WindowProperties
assert window is not None
current_props = window.get_properties()
default_props = WindowProperties.get_default()
# Opening the window changes these from the defaults
default_props.set_size(current_props.get_size())
default_props.set_origin(current_props.get_origin())
default_props.set_minimized(False)
default_props.set_foreground(True)
# The rest should be the same
assert current_props == default_props