mirror of
https://github.com/gryf/fs-uae-wrapper.git
synced 2026-02-02 06:05:45 +01:00
Added dummy message class for systems with python without tk
This commit is contained in:
@@ -2,6 +2,7 @@ import os
|
||||
from unittest import TestCase, mock
|
||||
|
||||
from fs_uae_wrapper import message
|
||||
from fs_uae_wrapper import nogui_message
|
||||
|
||||
if os.environ.get('DISPLAY'):
|
||||
import tkinter as tk
|
||||
@@ -38,6 +39,19 @@ class TestMessage(TestCase):
|
||||
msg._process.join.assert_called_once()
|
||||
|
||||
|
||||
class TestNOPMessage(TestCase):
|
||||
|
||||
@mock.patch('sys.stdout.write')
|
||||
def test_show(self, stdout_write):
|
||||
msg = nogui_message.Message('display that')
|
||||
msg.show()
|
||||
stdout_write.assert_called_once()
|
||||
|
||||
def test_close(self):
|
||||
msg = nogui_message.Message('display that')
|
||||
self.assertIsNone(msg.close())
|
||||
|
||||
|
||||
if os.environ.get('DISPLAY'):
|
||||
# Tkinter needs graphic environment for the widgets
|
||||
class TestSpawn(TestCase):
|
||||
|
||||
Reference in New Issue
Block a user