tests.clean_input_test   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 11
dl 0
loc 17
rs 10
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A test_clean_input() 0 9 1
1
# -*- coding: utf-8 -*-
2
from io import StringIO
3
from dvnv.utils import clean_input
4
5
PROMPT = "Input: "
6
7
8
def test_clean_input(monkeypatch):
9
    monkeypatch.setattr("sys.stdin", StringIO("     left SPACE\n"))
10
    assert clean_input(PROMPT) == "left space"
11
12
    monkeypatch.setattr("sys.stdin", StringIO("RIGHT space      \n"))
13
    assert clean_input(PROMPT) == "right space"
14
15
    monkeypatch.setattr("sys.stdin", StringIO("    SURROUNDING SPACE    \n"))
16
    assert clean_input(PROMPT) == "surrounding space"
17