File: condition_test.py

package info (click to toggle)
python-dlt 2.18.10.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 452 kB
  • sloc: python: 3,449; makefile: 55
file content (18 lines) | stat: -rw-r--r-- 429 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Copyright (C) 2016. BMW Car IT GmbH. All rights reserved.

from dlt.helpers import LimitCondition


class TestsLimitCondition(object):
    __test__ = True

    def test_none(self):
        cond = LimitCondition(None)
        assert cond()

    def test_limit_decreasing(self):
        cond = LimitCondition(2)
        cond()
        assert cond.limit == 1
        assert cond()  # limit=0
        assert not cond()  # limit=-1