File: platform_test.py

package info (click to toggle)
pysdl2 0.9.9%2Bdfsg1-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,276 kB
  • sloc: python: 18,592; makefile: 148; sh: 40
file content (20 lines) | stat: -rw-r--r-- 640 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import sys
import pytest
from sdl2 import platform


class TestSDLPlatform(object):
    __tags__ = ["sdl"]

    def test_SDL_GetPlatform(self):
        retval = platform.SDL_GetPlatform()
        if sys.platform in ("win32", "cygwin"):
            assert retval == b"Windows"
        elif sys.platform.startswith("linux"):
            assert retval == b"Linux"
        elif sys.platform.startswith("freebsd"):
            assert retval == b"FreeBSD"
        elif sys.platform.startswith("darwin"):
            assert retval == b"Mac OS X"
        # Do not check others atm, since we are unsure about what Python will
        # return here.