<s> import libqtile <EOL> import libqtile . sh <EOL> import libqtile . confreader <EOL> import libqtile . layout <EOL> import libqtile . manager <EOL> import libqtile . config <EOL> from . utils import Xephyr <EOL> class ShConfig ( object ) : <EOL> keys = [ ] <EOL> mouse = [ ] <EOL> groups = [ <EOL> libqtile . config . Group ( "<STR_LIT:a>" ) , <EOL> libqtile . config . Group ( "<STR_LIT:b>" ) , <EOL> ] <EOL> layouts = [ <EOL> libqtile . layout . Max ( ) , <EOL> ] <EOL> floating_layout = libqtile . layout . floating . Floating ( ) <EOL> screens = [ <EOL> libqtile . config . Screen ( ) <EOL> ] <EOL> main = None <EOL> @ Xephyr ( True , ShConfig ( ) ) <EOL> def test_columnize ( self ) : <EOL> self . sh = libqtile . sh . QSh ( self . c ) <EOL> assert self . sh . columnize ( [ "<STR_LIT>" , "<STR_LIT>" ] ) == "<STR_LIT>" <EOL> self . sh . termwidth = <NUM_LIT:1> <EOL> assert self . sh . columnize ( [ "<STR_LIT>" , "<STR_LIT>" ] , update_termwidth = False ) == "<STR_LIT>" <EOL> self . sh . termwidth = <NUM_LIT:15> <EOL> v = self . sh . columnize ( [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ] , update_termwidth = False ) <EOL> assert v == '<STR_LIT>' <EOL> @ Xephyr ( True , ShConfig ( ) ) <EOL> def test_ls ( self ) : <EOL> self . sh = libqtile . sh . QSh ( self . c ) <EOL> self . sh . do_cd ( "<STR_LIT>" ) <EOL> self . sh . do_ls ( "<STR_LIT>" ) <EOL> @ Xephyr ( True , ShConfig ( ) ) <EOL> def test_findNode ( self ) : <EOL> self . sh = libqtile . sh . QSh ( self . c ) <EOL> n = self . sh . _findNode ( self . sh . current , "<STR_LIT>" ) <EOL> assert n . path == "<STR_LIT>" <EOL> assert n . parent <EOL> n = self . sh . _findNode ( n , "<STR_LIT:0>" ) <EOL> assert n . path == "<STR_LIT>" <EOL> n = self . sh . _findNode ( n , "<STR_LIT:..>" ) <EOL> assert n . path == "<STR_LIT>" <EOL> n = self . sh . _findNode ( n , "<STR_LIT:0>" , "<STR_LIT:..>" ) <EOL> assert n . path == "<STR_LIT>" <EOL> n = self . sh . _findNode ( n , "<STR_LIT:..>" , "<STR_LIT>" , <NUM_LIT:0> ) <EOL> assert n . path == "<STR_LIT>" <EOL> assert not self . sh . _findNode ( n , "<STR_LIT>" ) <EOL> assert not self . sh . _findNode ( n , "<STR_LIT:..>" , "<STR_LIT:0>" , "<STR_LIT>" ) <EOL> @ Xephyr ( True , ShConfig ( ) ) <EOL> def test_do_cd ( self ) : <EOL> self . sh = libqtile . sh . QSh ( self . c ) <EOL> assert self . sh . do_cd ( "<STR_LIT>" ) == '<STR_LIT>' <EOL> assert self . sh . do_cd ( "<STR_LIT>" ) == '<STR_LIT>' <EOL> assert self . sh . do_cd ( "<STR_LIT>" ) == '<STR_LIT>' <EOL> @ Xephyr ( True , ShConfig ( ) ) <EOL> def test_call ( self ) : <EOL> self . sh = libqtile . sh . QSh ( self . c ) <EOL> assert self . sh . _call ( "<STR_LIT:status>" , [ ] ) == "<STR_LIT:OK>" <EOL> v = self . sh . _call ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> assert "<STR_LIT>" in v <EOL> v = self . sh . _call ( "<STR_LIT:status>" , "<STR_LIT>" ) <EOL> assert "<STR_LIT>" in v <EOL> v = self . sh . _call ( "<STR_LIT:status>" , "<STR_LIT>" ) <EOL> assert "<STR_LIT>" in v <EOL> @ Xephyr ( True , ShConfig ( ) ) <EOL> def test_complete ( self ) : <EOL> self . sh = libqtile . sh . QSh ( self . c ) <EOL> assert self . sh . _complete ( "<STR_LIT:c>" , "<STR_LIT:c>" ) == [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> ] <EOL> assert self . sh . _complete ( "<STR_LIT>" , "<STR_LIT:l>" ) == [ "<STR_LIT>" ] <EOL> print ( self . sh . _complete ( "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> assert self . sh . _complete ( "<STR_LIT>" , "<STR_LIT>" ) == [ <EOL> "<STR_LIT>" + x for x in [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT:0>" ] <EOL> ] <EOL> assert self . sh . _complete ( "<STR_LIT>" , "<STR_LIT>" ) == [ "<STR_LIT>" ] <EOL> @ Xephyr ( True , ShConfig ( ) ) <EOL> def test_help ( self ) : <EOL> self . sh = libqtile . sh . QSh ( self . c ) <EOL> assert self . sh . do_help ( "<STR_LIT>" ) . startswith ( "<STR_LIT>" ) <EOL> assert self . sh . do_help ( "<STR_LIT>" ) </s>
