File: test_xls.py

package info (click to toggle)
python-canmatrix 1.2~github-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 11,012 kB
  • sloc: xml: 30,201; python: 14,631; makefile: 31; sh: 7
file content (21 lines) | stat: -rw-r--r-- 641 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
import canmatrix.formats.xls
import decimal


def test_parse_value_name_collumn():
    value_column = "1..5"
    (mini, maxi, offset, value_table) = canmatrix.formats.xls.parse_value_name_column(value_column, "5", 4, decimal.Decimal)
    assert maxi == 5
    assert mini == 1
    assert offset == 1
    assert value_table == dict()

    value_column = "LabelX"
    (mini, maxi, offset, value_table) = canmatrix.formats.xls.parse_value_name_column(value_column, "5", 4, decimal.Decimal)
    assert maxi == 15
    assert mini == 0
    assert offset == 0
    assert value_table == {5: "LabelX"}