Python: Add redimentary tests for new Value API.

This commit is contained in:
Mark Shannon
2019-07-26 10:51:24 +01:00
parent f0bb07fc24
commit f69ea7f65e
4 changed files with 36 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
| file://:0:0:0:0 | builtin-class bool | bool |
| file://:0:0:0:0 | builtin-class classmethod | classmethod |
| file://:0:0:0:0 | builtin-class float | float |
| file://:0:0:0:0 | builtin-class int | int |
| file://:0:0:0:0 | builtin-class object | object |

View File

@@ -0,0 +1,15 @@
import python
from ClassValue cls, string description
where
cls = ClassValue::bool() and description = "bool"
or
cls = ClassValue::int_() and description = "int"
or
cls = ClassValue::float_() and description = "float"
or
cls = ClassValue::classmethod() and description = "classmethod"
or
cls = ClassValue::bool().getMro().getItem(2) and description = "object"
select cls, description

View File

@@ -0,0 +1,4 @@
| file://:0:0:0:0 | builtin-class ValueError | ValueError |
| file://:0:0:0:0 | builtin-class bool | bool |
| file://:0:0:0:0 | builtin-class slice | slice |
| file://:0:0:0:0 | list object | sys.argv |

View File

@@ -0,0 +1,12 @@
import python
from Value val, string name
where
val = Value::named(name)
and
(
name = "bool" or name = "sys" or name = "sys.argv" or
name = "ValueError" or name = "slice"
)
select val, name