<s> import mock <EOL> from elastic_recheck . cmd import graph <EOL> from elastic_recheck . tests import unit <EOL> class FakeResponse ( object ) : <EOL> def __init__ ( self , response_text ) : <EOL> super ( FakeResponse , self ) . __init__ ( ) <EOL> self . text = "<STR_LIT>" + response_text <EOL> class TestGraphCmd ( unit . UnitTestCase ) : <EOL> def test_get_open_reviews_empty ( self ) : <EOL> with mock . patch ( '<STR_LIT>' ) as mock_get : <EOL> mock_get . return_value = FakeResponse ( "<STR_LIT>" ) <EOL> self . assertEqual ( graph . get_open_reviews ( '<STR_LIT>' ) , [ ] ) <EOL> def test_get_open_reviews ( self ) : <EOL> with mock . patch ( '<STR_LIT>' ) as mock_get : <EOL> with open ( '<STR_LIT>' <EOL> '<STR_LIT>' ) as f : <EOL> mock_get . return_value = FakeResponse ( f . read ( ) ) <EOL> self . assertEqual ( graph . get_open_reviews ( '<STR_LIT>' ) , [ <NUM_LIT> ] ) </s>
