~jamesodhunt/click/add-utf8-test

« back to all changes in this revision

Viewing changes to click/tests/integration/test_info.py

  • Committer: CI bot
  • Author(s): Daniel Holbach, Michael Vogt, Colin Watson
  • Date: 2014-09-09 10:00:56 UTC
  • mfrom: (425.1.91 devel)
  • Revision ID: ps-jenkins@lists.canonical.com-20140909100056-zsdxby5edojqfr9a
Click 0.4.32: test improvements/cleanup, re-enable signature checking, optionally call click-review after build. Fixes: 1324853, 1330770
Approved by: PS Jenkins bot, Colin Watson

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
"""Integration tests for the click CLI info command."""
17
17
 
18
18
import json
 
19
import os
19
20
import subprocess
20
21
 
21
22
from .helpers import ClickTestCase
22
23
 
23
24
 
24
25
class TestInfo(ClickTestCase):
25
 
    def test_info(self):
26
 
        name = "com.ubuntu.foo"
 
26
    def test_info_from_path(self):
 
27
        name = "com.example.foo"
27
28
        path_to_click = self._make_click(name)
28
29
        output = subprocess.check_output([
29
30
            self.click_binary, "info", path_to_click], universal_newlines=True)
30
31
        self.assertEqual(name, json.loads(output)["name"])
31
32
 
 
33
 
 
34
    def test_info_installed_click(self):
 
35
        name = "com.example.foo"
 
36
        user = os.environ.get("USER", "root")
 
37
        path_to_click = self._make_click(name, framework="")
 
38
        self.click_install(path_to_click, name, user)
 
39
        output = subprocess.check_output([
 
40
            self.click_binary, "info", name], universal_newlines=True)
 
41
        self.assertEqual(json.loads(output)["name"], name)
 
42
 
32
43
    def test_info_file_in_package(self):
33
44
        name = "org.example.info"
34
45
        version = "1.0"