<s> """<STR_LIT>""" <EOL> from . . helpers import TestCase <EOL> import jedi <EOL> from jedi . _compatibility import is_py33 <EOL> class TestInterpreterAPI ( TestCase ) : <EOL> def check_interpreter_complete ( self , source , namespace , completions , <EOL> ** kwds ) : <EOL> script = jedi . Interpreter ( source , [ namespace ] , ** kwds ) <EOL> cs = script . completions ( ) <EOL> actual = [ c . name for c in cs ] <EOL> self . assertEqual ( sorted ( actual ) , sorted ( completions ) ) <EOL> def test_complete_raw_function ( self ) : <EOL> from os . path import join <EOL> self . check_interpreter_complete ( '<STR_LIT>' , <EOL> locals ( ) , <EOL> [ '<STR_LIT>' ] ) <EOL> def test_complete_raw_function_different_name ( self ) : <EOL> from os . path import join as pjoin <EOL> self . check_interpreter_complete ( '<STR_LIT>' , <EOL> locals ( ) , <EOL> [ '<STR_LIT>' ] ) <EOL> def test_complete_raw_module ( self ) : <EOL> import os <EOL> self . check_interpreter_complete ( '<STR_LIT>' , <EOL> locals ( ) , <EOL> [ '<STR_LIT>' ] ) <EOL> def test_complete_raw_instance ( self ) : <EOL> import datetime <EOL> dt = datetime . datetime ( <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT:1> ) <EOL> completions = [ '<STR_LIT:time>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> if is_py33 : <EOL> completions += [ '<STR_LIT>' ] <EOL> self . check_interpreter_complete ( '<STR_LIT>' , <EOL> locals ( ) , <EOL> completions ) <EOL> def test_list ( self ) : <EOL> array = [ '<STR_LIT>' , <NUM_LIT:1> ] <EOL> self . check_interpreter_complete ( '<STR_LIT>' , <EOL> locals ( ) , <EOL> [ '<STR_LIT>' ] ) <EOL> self . check_interpreter_complete ( '<STR_LIT>' , <EOL> locals ( ) , <EOL> [ ] ) <EOL> self . check_interpreter_complete ( '<STR_LIT>' , <EOL> locals ( ) , <EOL> [ '<STR_LIT>' ] ) <EOL> self . check_interpreter_complete ( '<STR_LIT>' , <EOL> locals ( ) , <EOL> [ '<STR_LIT>' ] ) <EOL> self . check_interpreter_complete ( '<STR_LIT>' , <EOL> locals ( ) , <EOL> [ '<STR_LIT>' ] ) <EOL> def test_slice ( self ) : <EOL> class Foo ( ) : <EOL> bar = [ ] <EOL> baz = '<STR_LIT>' <EOL> self . check_interpreter_complete ( '<STR_LIT>' , <EOL> locals ( ) , <EOL> [ '<STR_LIT>' ] ) <EOL> def test_getitem_side_effects ( self ) : <EOL> class Foo ( ) : <EOL> def __getitem__ ( self , index ) : <EOL> return index <EOL> foo = Foo ( ) <EOL> self . check_interpreter_complete ( '<STR_LIT>' , locals ( ) , [ ] ) </s>
