Ajout du GUI

This commit is contained in:
thatscringebro
2022-08-08 16:31:52 -04:00
parent db362ccdca
commit abd15f28b6
851 changed files with 99957 additions and 1 deletions

35
kivy/tests/test_config.py Normal file
View File

@@ -0,0 +1,35 @@
"""This module houses test for the kivy config module."""
from kivy.config import ConfigParser
from os.path import join, dirname
SAMPLE_CONFIG = join(dirname(__file__), 'data', 'test.ini')
def test_configparser_callbacks():
"""Test that the ConfigParser handles callbacks."""
def callback():
pass
config = ConfigParser()
assert len(config._callbacks) == 0
config.add_callback(callback, 'section', 'key')
assert len(config._callbacks) == 1
config.remove_callback(callback, 'section', 'key')
assert len(config._callbacks) == 0
def test_configparser_read():
"""Test that the ConfigParser can read a config file."""
config = ConfigParser()
config.read(SAMPLE_CONFIG)
assert config.get('section', 'key') == 'value'
def test_configparser_setdefaults():
"""Test the setdefaults method works as expected."""
config = ConfigParser()
config.setdefaults('section', {'test': '1'})
assert config.get('section', 'test') == '1'