File: test_common_selection.py

package info (click to toggle)
tryton-client 7.0.31-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,472 kB
  • sloc: python: 27,196; sh: 37; makefile: 18
file content (17 lines) | stat: -rw-r--r-- 649 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# This file is part of Tryton.  The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from unittest import TestCase

from tryton.common.selection import freeze_value


class SelectionTestCase(TestCase):
    "Test common selection"

    def test_freeze_value(self):
        "Test freeze_value"
        self.assertEqual(freeze_value({'foo': 'bar'}), (('foo', 'bar'),))
        self.assertEqual(freeze_value([1, 42, 2, 3]), (1, 42, 2, 3))
        self.assertEqual(freeze_value('foo'), 'foo')
        self.assertEqual(
            freeze_value({'foo': {'bar': 42}}), (('foo', (('bar', 42),)),))