mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
tests for -D & -i/added .coverage in .gitignore
This commit is contained in:
parent
ac371166f1
commit
8f2e6d32e8
2 changed files with 12 additions and 1 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -38,3 +38,5 @@ include/
|
|||
|
||||
# Editor project files
|
||||
*.komodo*
|
||||
|
||||
.coverage
|
||||
|
|
|
@ -6,7 +6,7 @@ import builtins
|
|||
from unittest.mock import patch
|
||||
|
||||
import nose
|
||||
from nose.tools import assert_true, assert_false
|
||||
from nose.tools import assert_true, assert_false, assert_equal
|
||||
|
||||
import xonsh.main
|
||||
|
||||
|
@ -23,6 +23,10 @@ def test_premain():
|
|||
xonsh.main.premain([])
|
||||
assert_true(builtins.__xonsh_env__.get('XONSH_LOGIN'))
|
||||
|
||||
with patch('xonsh.main.Shell', Shell), mock_xonsh_env({}):
|
||||
xonsh.main.premain(['-i'])
|
||||
assert_true(builtins.__xonsh_env__.get('XONSH_INTERACTIVE'))
|
||||
|
||||
with patch('xonsh.main.Shell', Shell), mock_xonsh_env({}):
|
||||
xonsh.main.premain(['-l', '-c', 'echo "hi"'])
|
||||
assert_true(builtins.__xonsh_env__.get('XONSH_LOGIN'))
|
||||
|
@ -35,6 +39,11 @@ def test_premain():
|
|||
xonsh.main.premain(['-l'])
|
||||
assert_true(builtins.__xonsh_env__.get('XONSH_LOGIN'))
|
||||
|
||||
with patch('xonsh.main.Shell', Shell), mock_xonsh_env({}):
|
||||
xonsh.main.premain(['-DTEST1=1616', '-DTEST2=LOL'])
|
||||
assert_equal(builtins.__xonsh_env__.get('TEST1'), '1616')
|
||||
assert_equal(builtins.__xonsh_env__.get('TEST2'), 'LOL')
|
||||
|
||||
|
||||
def test_premain_with_file_argument():
|
||||
with patch('xonsh.main.Shell', Shell), mock_xonsh_env({}):
|
||||
|
|
Loading…
Add table
Reference in a new issue