| 1 |
import sys |
| 2 |
import pyglet |
| 3 |
|
| 4 |
|
| 5 |
window_captions = [u'テスト.py', u'\u00bfHabla espa\u00f1ol?', 'test'] |
| 6 |
|
| 7 |
|
| 8 |
def test_window_caption(): |
| 9 |
"""Test that the Window caption is correctly set on instantiation. """ |
| 10 |
for test_caption in window_captions: |
| 11 |
window = pyglet.window.Window(caption=test_caption) |
| 12 |
assert window.caption == test_caption |
| 13 |
window.close() |
| 14 |
|
| 15 |
|
| 16 |
def test_window_caption_from_argv(): |
| 17 |
"""Test that the window caption is set from sys.argv[0], if none is explicitly set. """ |
| 18 |
for test_caption in window_captions: |
| 19 |
|
| 20 |
|
| 21 |
sys.argv[0] = test_caption |
| 22 |
|
| 23 |
|
| 24 |
window = pyglet.window.Window() |
| 25 |
assert window.caption == test_caption |
| 26 |
window.close() |