Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
alanhdu committed May 8, 2016
1 parent 18638ea commit acdaf00
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/test_info.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from __future__ import print_function, absolute_import, division
import json

from conda import config
from conda.cli import main_info

from tests.helpers import run_conda_command, assert_in, assert_equals

Expand Down Expand Up @@ -32,3 +34,21 @@ def test_info():
assert_in(conda_info_out, conda_info_all_out)
assert_in(conda_info_e_out, conda_info_all_out)
assert_in(conda_info_s_out, conda_info_all_out)


def test_info_package_json():
out, err = run_conda_command("info", "--json", "numpy=1.11.0=py35_0")
assert err == ""

out = json.loads(out)
assert set(out.keys()) == {"numpy=1.11.0=py35_0"}
assert len(out["numpy=1.11.0=py35_0"]) == 1
assert isinstance(out["numpy=1.11.0=py35_0"], list)

out, err = run_conda_command("info", "--json", "numpy")
assert err == ""

out = json.loads(out)
assert set(out.keys()) == {"numpy"}
assert len(out["numpy"]) > 1
assert isinstance(out["numpy"], list)

0 comments on commit acdaf00

Please sign in to comment.