Completed
Branch develop (641d1e)
by Fabian
01:02
created

test_circuitbreaker__str__()   A

Complexity

Conditions 2

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
c 1
b 0
f 0
dl 0
loc 3
rs 10
1
from circuitbreaker import CircuitBreaker, CircuitBreakerError
2
3
4
def test_circuitbreaker__str__():
5
    cb = CircuitBreaker(name='Foobar')
6
    assert str(cb) == 'Foobar'
7
8
9
def test_circuitbreaker_error__str__():
10
    cb = CircuitBreaker(name='Foobar')
11
    error = CircuitBreakerError(cb)
12
13
    assert str(error).startswith('Circuit "Foobar" OPEN until ')
14
    assert str(error).endswith('(0 failures, 30 sec remaining)')
15