Total Complexity | 1 |
Total Lines | 22 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | # pylint: disable=redefined-outer-name,expression-not-assigned,attribute-defined-outside-init,no-member |
||
2 | |||
3 | from expecter import expect |
||
|
|||
4 | |||
5 | import yorm |
||
6 | from yorm.types import List, Float |
||
7 | |||
8 | from . import strip |
||
9 | |||
10 | |||
11 | @yorm.attr(things=List.of_type(Float)) |
||
12 | @yorm.sync("tmp/example.yml") |
||
13 | class Example: |
||
14 | """An example class mapping a list using the shortened syntax.""" |
||
15 | |||
16 | |||
17 | def test_list_mapping_using_shortened_syntax(): |
||
18 | obj = Example() |
||
19 | obj.things = [1, 2.0, "3"] |
||
20 | |||
21 | expect(obj.__mapper__.text) == strip(""" |
||
22 | things: |
||
27 |