Add ipython shell tests
This commit is contained in:
parent
42a9a5a5fc
commit
c403eef434
|
@ -12,7 +12,7 @@ if python -c 'import sys; sys.exit(1 * (sys.version_info[0] != 2))' ; then
|
|||
pip install unittest2 argparse
|
||||
fi
|
||||
fi
|
||||
sudo apt-get install -qq screen zsh tcsh mksh busybox
|
||||
sudo apt-get install -qq screen zsh tcsh mksh busybox ipython
|
||||
# Travis has too outdated fish. It cannot be used for tests.
|
||||
# sudo apt-get install fish
|
||||
true
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
print ('cd ' + 'tests/shell/3rd') # Start of the test marker
|
||||
bool 42
|
||||
bool 44
|
||||
class Test(object):
|
||||
pass
|
||||
|
||||
exit
|
|
@ -0,0 +1,14 @@
|
|||
|
||||
[0;38;5;250;48;5;240m In [[0;38;5;231;48;5;240m2[0;38;5;250;48;5;240m] [0;38;5;240;49;22m [0mbool 42
|
||||
[0;38;5;250;48;5;240m [0;38;5;231;48;5;240m2[0;38;5;250;48;5;240m> [0;38;5;240;49;22m [0mbool(42)
|
||||
[0;38;5;250;48;5;240m Out[[0;38;5;231;48;5;240m2[0;38;5;250;48;5;240m] [0;38;5;240;49;22m [0mTrue
|
||||
|
||||
[0;38;5;250;48;5;240m In [[0;38;5;231;48;5;240m3[0;38;5;250;48;5;240m] [0;38;5;240;49;22m [0mbool 44
|
||||
[0;38;5;250;48;5;240m [0;38;5;231;48;5;240m3[0;38;5;250;48;5;240m> [0;38;5;240;49;22m [0mbool(44)
|
||||
[0;38;5;250;48;5;240m Out[[0;38;5;231;48;5;240m3[0;38;5;250;48;5;240m] [0;38;5;240;49;22m [0mTrue
|
||||
|
||||
[0;38;5;250;48;5;240m In [[0;38;5;231;48;5;240m4[0;38;5;250;48;5;240m] [0;38;5;240;49;22m [0mclass Test(object):
|
||||
[0;38;5;250;48;5;240m [0;38;5;240;49;22m [0m pass
|
||||
[0;38;5;250;48;5;240m [0;38;5;240;49;22m [0m
|
||||
|
||||
[0;38;5;250;48;5;240m In [[0;38;5;231;48;5;240m5[0;38;5;250;48;5;240m] [0;38;5;240;49;22m [0mexit
|
|
@ -0,0 +1,3 @@
|
|||
c = get_config()
|
||||
c.InteractiveShellApp.extensions = ['powerline.bindings.ipython.post_0_11']
|
||||
c.TerminalInteractiveShell.autocall = 1
|
|
@ -15,8 +15,11 @@ new_fname = os.path.join('tests', 'shell', shell + '.' + test_type + '.log')
|
|||
pid_fname = os.path.join('tests', 'shell', '3rd', 'pid')
|
||||
|
||||
|
||||
try:
|
||||
with open(pid_fname, 'r') as P:
|
||||
pid = P.read().strip()
|
||||
except IOError:
|
||||
pid = None
|
||||
hostname = socket.gethostname()
|
||||
user = os.environ['USER']
|
||||
|
||||
|
@ -34,6 +37,7 @@ with codecs.open(fname, 'r', encoding='utf-8') as R:
|
|||
})
|
||||
line = line.replace(hostname, 'HOSTNAME')
|
||||
line = line.replace(user, 'USER')
|
||||
if pid is not None:
|
||||
line = line.replace(pid, 'PID')
|
||||
if shell == 'fish':
|
||||
try:
|
||||
|
|
|
@ -120,10 +120,13 @@ mkdir tests/shell/3rd/'$(echo)'
|
|||
mkdir tests/shell/3rd/'`echo`'
|
||||
|
||||
mkdir tests/shell/fish_home
|
||||
cp -r tests/test_shells/ipython_home tests/shell
|
||||
export XDG_CONFIG_HOME="$PWD/tests/shell/fish_home"
|
||||
export IPYTHONDIR="$PWD/tests/shell/ipython_home"
|
||||
|
||||
unset ENV
|
||||
|
||||
if test "x${ONLY_SHELL%sh}" != "x${ONLY_SHELL}" || test "x${ONLY_SHELL}" = xbb ; then
|
||||
powerline-daemon -k || true
|
||||
sleep 1s
|
||||
|
||||
|
@ -174,6 +177,11 @@ for TEST_TYPE in "daemon" "nodaemon" ; do
|
|||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if ! run_test ipython ipython ; then
|
||||
FAILED=1
|
||||
fi
|
||||
|
||||
test "x$ONLY_SHELL" = "x" && rm -r tests/shell
|
||||
exit $FAILED
|
||||
|
|
Loading…
Reference in New Issue