<s> from __future__ import unicode_literals , absolute_import <EOL> from datetime import datetime <EOL> from ipaddress import IPv4Address <EOL> from pytest import mark <EOL> from six import text_type <EOL> from openvpn_status . utils import ( <EOL> parse_time , parse_peer , parse_filesize , PeerAddress , FileSize ) <EOL> @ mark . parametrize ( '<STR_LIT>' , [ <EOL> ( '<STR_LIT>' , datetime ( <NUM_LIT> , <NUM_LIT:6> , <NUM_LIT> , <NUM_LIT:4> , <NUM_LIT> , <NUM_LIT:3> ) ) , <EOL> ( '<STR_LIT>' , datetime ( <NUM_LIT> , <NUM_LIT:6> , <NUM_LIT> , <NUM_LIT:4> , <NUM_LIT:8> , <NUM_LIT> ) ) , <EOL> ( '<STR_LIT>' , datetime ( <NUM_LIT> , <NUM_LIT:6> , <NUM_LIT> , <NUM_LIT:7> , <NUM_LIT> , <NUM_LIT> ) ) , <EOL> ( datetime ( <NUM_LIT> , <NUM_LIT:6> , <NUM_LIT> , <NUM_LIT:7> , <NUM_LIT> , <NUM_LIT> ) , datetime ( <NUM_LIT> , <NUM_LIT:6> , <NUM_LIT> , <NUM_LIT:7> , <NUM_LIT> , <NUM_LIT> ) ) , <EOL> ] ) <EOL> def test_parse_time ( text , time ) : <EOL> assert parse_time ( text ) == time <EOL> @ mark . parametrize ( '<STR_LIT>' , [ <EOL> ( '<STR_LIT>' , PeerAddress ( IPv4Address ( '<STR_LIT>' ) , <NUM_LIT> ) ) , <EOL> ( '<STR_LIT>' , PeerAddress ( IPv4Address ( '<STR_LIT>' ) , <NUM_LIT> ) ) , <EOL> ( '<STR_LIT>' , PeerAddress ( IPv4Address ( '<STR_LIT>' ) , <NUM_LIT> ) ) , <EOL> ( PeerAddress ( '<STR_LIT>' , <NUM_LIT> ) , PeerAddress ( '<STR_LIT>' , <NUM_LIT> ) ) , <EOL> ] ) <EOL> def test_parse_peer ( text , peer ) : <EOL> assert parse_peer ( text ) == peer <EOL> assert text_type ( text ) == text_type ( peer ) <EOL> @ mark . parametrize ( '<STR_LIT>' , [ <EOL> ( <NUM_LIT> , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( FileSize ( <NUM_LIT> ) , '<STR_LIT>' ) , <EOL> ] ) <EOL> def test_parse_filesize ( text , humanized ) : <EOL> assert text_type ( parse_filesize ( text ) ) == humanized </s>
