diff --git a/TODO b/TODO index a76d763..8548126 100644 --- a/TODO +++ b/TODO @@ -2,7 +2,6 @@ Someday * have Window pass-through to Renderer Maybe - * better enum solution? * pixel formats * SDL_SysWM * Joystick diff --git a/csdl/tests/test_basics.py b/csdl/tests/test_basics.py index 20c20eb..9bc5fd2 100644 --- a/csdl/tests/test_basics.py +++ b/csdl/tests/test_basics.py @@ -1,52 +1,55 @@ -import csdl +from .. import (get_error, set_error, clear_error, + InitFlags, init, quit, was_init, + init_sub_system, quit_sub_system, + get_version, get_revision) from nose.tools import with_setup def test_error_handling(): # blank by default - assert csdl.get_error() == "" + assert get_error() == "" # check set - csdl.set_error("test!") - assert csdl.get_error() == "test!" + set_error("test!") + assert get_error() == "test!" # check again, shouldn't clear - assert csdl.get_error() == "test!" + assert get_error() == "test!" # clear again - csdl.clear_error() - assert csdl.get_error() == "" + clear_error() + assert get_error() == "" -@with_setup(csdl.quit) +@with_setup(quit) def test_init(): - csdl.init(csdl.InitFlags.EVERYTHING) + init(InitFlags.EVERYTHING) # everything should include these - assert csdl.was_init(csdl.InitFlags.TIMER|csdl.InitFlags.AUDIO| - csdl.InitFlags.VIDEO|csdl.InitFlags.JOYSTICK| - csdl.InitFlags.HAPTIC) + assert was_init(InitFlags.TIMER|InitFlags.AUDIO| + InitFlags.VIDEO|InitFlags.JOYSTICK| + InitFlags.HAPTIC) -@with_setup(csdl.quit) +@with_setup(quit) def test_quit(): - csdl.init(csdl.InitFlags.EVERYTHING) - csdl.quit() - assert csdl.was_init(0) == 0 + init(InitFlags.EVERYTHING) + quit() + assert was_init(0) == 0 -@with_setup(csdl.quit) +@with_setup(quit) def test_init_sub_system(): - csdl.init_sub_system(csdl.InitFlags.TIMER) - assert csdl.was_init(csdl.InitFlags.TIMER) + init_sub_system(InitFlags.TIMER) + assert was_init(InitFlags.TIMER) -@with_setup(csdl.quit) +@with_setup(quit) def test_quit_sub_system(): - csdl.init_sub_system(csdl.InitFlags.TIMER) - assert csdl.was_init(csdl.InitFlags.TIMER) - csdl.quit_sub_system(csdl.InitFlags.TIMER) - assert not csdl.was_init(csdl.InitFlags.TIMER) + init_sub_system(InitFlags.TIMER) + assert was_init(InitFlags.TIMER) + quit_sub_system(InitFlags.TIMER) + assert not was_init(InitFlags.TIMER) def test_version(): - v = csdl.get_version() + v = get_version() assert repr(v).startswith('Version') assert str(v).startswith('1.3') assert v.major == 1 and v.minor == 3 def test_revision(): - assert csdl.get_revision().startswith('hg') + assert get_revision().startswith('hg') diff --git a/csdl/tests/test_enum.py b/csdl/tests/test_enum.py index aeaf323..c8b1d4c 100644 --- a/csdl/tests/test_enum.py +++ b/csdl/tests/test_enum.py @@ -1,4 +1,4 @@ -from csdl.enum import CEnum, CEnumSymbol +from ..enum import CEnum, CEnumSymbol import nose.tools class TestEnum(CEnum): diff --git a/csdl/tests/test_events.py b/csdl/tests/test_events.py index 3da5801..58fcbcc 100644 --- a/csdl/tests/test_events.py +++ b/csdl/tests/test_events.py @@ -1,7 +1,7 @@ from nose.tools import with_setup, raises -from csdl import init, InitFlags -from csdl.internal import SDLError -from csdl.events import * +from .. import init, InitFlags +from ..internal import SDLError +from ..events import * def get_mm_event(): mm_event = MouseMotionEvent(type=EventType.MOUSEMOTION, diff --git a/csdl/tests/test_sysinfo.py b/csdl/tests/test_sysinfo.py index c431455..03f5389 100644 --- a/csdl/tests/test_sysinfo.py +++ b/csdl/tests/test_sysinfo.py @@ -1,4 +1,4 @@ -from csdl import sysinfo +from .. import sysinfo def test_get_platform(): assert isinstance(sysinfo.get_platform(), str) diff --git a/csdl/tests/test_video.py b/csdl/tests/test_video.py index 714f10c..75b138c 100644 --- a/csdl/tests/test_video.py +++ b/csdl/tests/test_video.py @@ -1,5 +1,4 @@ -from csdl import init, InitFlags -from csdl import video +from .. import init, InitFlags, video from nose.tools import with_setup import time