mirror of https://github.com/kivy/kivy.git
kvlang: implement root widget, add doc and rename some methods/class for consistency.
This commit is contained in:
parent
50e87d45a5
commit
cbda001537
699
kivy/lang.py
699
kivy/lang.py
File diff suppressed because it is too large
Load Diff
|
@ -5,7 +5,7 @@ import unittest
|
|||
class InvalidLangTestCase(unittest.TestCase):
|
||||
|
||||
def test_invalid_childname(self):
|
||||
from kivy.lang import Builder, ParserError
|
||||
from kivy.lang import Builder, ParserException
|
||||
from kivy.factory import FactoryException
|
||||
try:
|
||||
Builder.load_string('''
|
||||
|
@ -19,13 +19,13 @@ Widget:
|
|||
thecursor.Cursor:
|
||||
''')
|
||||
self.fail('Invalid children name')
|
||||
except ParserError:
|
||||
except ParserException:
|
||||
pass
|
||||
except FactoryException:
|
||||
pass
|
||||
|
||||
def test_invalid_childname_before(self):
|
||||
from kivy.lang import Builder, ParserError
|
||||
from kivy.lang import Builder, ParserException
|
||||
try:
|
||||
Builder.load_string('''
|
||||
Widget:
|
||||
|
@ -38,5 +38,5 @@ Widget:
|
|||
pos_hint:{'x':0.45, 'y':0.45}
|
||||
''')
|
||||
self.fail('Invalid children name')
|
||||
except ParserError:
|
||||
except ParserException:
|
||||
pass
|
||||
|
|
|
@ -54,13 +54,13 @@ class LangTestCase(unittest.TestCase):
|
|||
def test_loading_failed_1(self):
|
||||
# invalid indent
|
||||
Builder = self.import_builder()
|
||||
from kivy.lang import ParserError
|
||||
from kivy.lang import ParserException
|
||||
try:
|
||||
Builder.load_string('''#:kivy 1.0
|
||||
<TestClass>:
|
||||
''')
|
||||
self.fail('Invalid indentation.')
|
||||
except ParserError:
|
||||
except ParserException:
|
||||
pass
|
||||
|
||||
def test_parser_numeric_1(self):
|
||||
|
|
Loading…
Reference in New Issue