diff options
author | Juergen Bocklage-Ryannel <jbocklage-ryannel@luxoft.com> | 2018-03-07 13:20:17 +0100 |
---|---|---|
committer | Juergen Bocklage-Ryannel <jbocklage-ryannel@luxoft.com> | 2018-03-07 13:20:56 +0100 |
commit | 80372d8729bb36c4bce42b90ad0590536ac695a5 (patch) | |
tree | eff6a81efb5d593f8957634c0c91d9d358fd03fe /tests | |
parent | aef0548e6963b163e7e0e2a35db8efa87f13ee14 (diff) | |
download | qtivi-qface-80372d8729bb36c4bce42b90ad0590536ac695a5.tar.gz |
adding default values to interface properties and struct members
Diffstat (limited to 'tests')
-rw-r--r-- | tests/in/values.qface | 17 | ||||
-rw-r--r-- | tests/test_values.py | 26 |
2 files changed, 43 insertions, 0 deletions
diff --git a/tests/in/values.qface b/tests/in/values.qface new file mode 100644 index 0000000..9992de0 --- /dev/null +++ b/tests/in/values.qface @@ -0,0 +1,17 @@ +module values 1.0 + +interface Namespace { + @value: 99 + int intValue + @value: 0.99 + real realValue + @value: "foo" + string message + @value: { name: "Hello", age: 101 }; + Person person +} + +struct Person { + string name; + int age; +}
\ No newline at end of file diff --git a/tests/test_values.py b/tests/test_values.py new file mode 100644 index 0000000..a2f8c19 --- /dev/null +++ b/tests/test_values.py @@ -0,0 +1,26 @@ +from qface.generator import FileSystem +import logging +import logging.config +from path import Path + + +# logging.config.fileConfig('logging.ini') +logging.basicConfig() + +log = logging.getLogger(__name__) + +inputPath = Path('tests/in') +log.debug('input path folder: {0}'.format(inputPath.abspath())) + + +def loadValues(): + path = inputPath / 'values.qface' + return FileSystem.parse_document(path) + + +def test_values(): + system = loadValues() + # lookup module + interface = system.lookup('values.Namespace') + assert interface + |