Skip to content

Commit 3c25158

Browse files
committed
Added functional tests
1 parent 56496f6 commit 3c25158

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

tests/functional/test_freeze.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,3 +368,24 @@ def test_freeze_with_requirement_option(script):
368368
INITools==0.2
369369
""" + ignores + "## The following requirements were added by pip freeze:..."
370370
_check_output(result, expected)
371+
372+
373+
def test_freeze_user(script, virtualenv):
374+
"""
375+
Testing freeze with --user, first we have to install some stuff.
376+
"""
377+
virtualenv.system_site_packages = True
378+
script.scratch_path.join("initools-req.txt").write(textwrap.dedent("""\
379+
simple==2.0
380+
# and something else to test out:
381+
simple2<=3.0
382+
"""))
383+
script.pip_install_local('simple==2.0')
384+
script.pip_install_local('--user', 'simple2<=3.0')
385+
result = script.pip('freeze', expect_stderr=True)
386+
expected = textwrap.dedent("""\
387+
Script result: pip freeze
388+
-- stdout: --------------------
389+
...simple2==3.0...
390+
<BLANKLINE>""")
391+
_check_output(result, expected)

tests/functional/test_list.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,20 @@ def test_local_flag(script, data):
2525
assert 'simple (1.0)' in result.stdout
2626

2727

28+
def test_user_flag(script, data, virtualenv):
29+
"""
30+
Test the behavior of --user flag in the list command
31+
32+
"""
33+
virtualenv.system_site_packages = True
34+
script.pip('install', '-f', data.find_links, '--no-index', 'simple==1.0')
35+
script.pip('install', '-f', data.find_links, '--no-index',
36+
'--user', 'simple2==2.0')
37+
result = script.pip('list', '--user')
38+
assert 'simple (1.0)' not in result.stdout
39+
assert 'simple2 (2.0)' in result.stdout
40+
41+
2842
def test_uptodate_flag(script, data):
2943
"""
3044
Test the behavior of --uptodate flag in the list command

0 commit comments

Comments
 (0)