<s> from __future__ import absolute_import <EOL> import httpretty <EOL> import pygerduty <EOL> import textwrap <EOL> @ httpretty . activate <EOL> def test_get_user ( ) : <EOL> httpretty . register_uri ( <EOL> httpretty . GET , "<STR_LIT>" , <EOL> body = textwrap . dedent ( """<STR_LIT>""" ) , status = <NUM_LIT:200> ) <EOL> p = pygerduty . PagerDuty ( "<STR_LIT>" , "<STR_LIT:password>" ) <EOL> user = p . users . show ( "<STR_LIT>" ) <EOL> assert user . id == "<STR_LIT>" <EOL> assert user . name == "<STR_LIT>" <EOL> assert user . role == "<STR_LIT>" <EOL> @ httpretty . activate <EOL> def test_get_user_contact_methods ( ) : <EOL> httpretty . register_uri ( <EOL> httpretty . GET , "<STR_LIT>" , <EOL> body = textwrap . dedent ( """<STR_LIT>""" ) , status = <NUM_LIT:200> ) , <EOL> httpretty . register_uri ( <EOL> httpretty . GET , "<STR_LIT>" , <EOL> body = textwrap . dedent ( """<STR_LIT>""" ) , status = <NUM_LIT:200> ) <EOL> p = pygerduty . PagerDuty ( "<STR_LIT>" , "<STR_LIT:password>" ) <EOL> user = p . users . show ( "<STR_LIT>" ) <EOL> contact_methods = [ c for c in user . contact_methods . list ( ) ] <EOL> assert len ( contact_methods ) == <NUM_LIT:3> <EOL> assert len ( [ c for c in contact_methods if c . type == "<STR_LIT:email>" ] ) == <NUM_LIT:1> <EOL> assert len ( [ c for c in contact_methods if c . type == "<STR_LIT>" ] ) == <NUM_LIT:1> <EOL> assert len ( [ c for c in contact_methods if c . type == "<STR_LIT>" ] ) == <NUM_LIT:1> </s>
