~ubuntu-branches/ubuntu/saucy/click/saucy-proposed

« back to all changes in this revision

Viewing changes to click/tests/test_build.py

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2013-09-09 13:37:39 UTC
  • Revision ID: package-import@ubuntu.com-20130909133739-gnnjvo0bm3rxzfdi
Tags: 0.4.4
* Amend "click help install" to recommend using "pkcon install-local".
* Run hooks when removing a per-user package registration.
* Adjust usage lines for "click help verify" and "click help pkgdir" to
  indicate that options are allowed.
* Add a click(1) manual page.
* Use json.dump and json.load in most places rather than json.dumps and
  json.loads (which unnecessarily construct strings).
* Add "click unregister", which unregisters a package for a user and
  removes it from disk if it is not being used.
* Add RemovePackage support to the PackageKit plugin, mapped to "click
  unregister".
* Attempt to remove the old version of a package after installing or
  registering a new one.
* Remove code supporting PackageKit 0.7 API, and instead arrange to
  disable the PackageKit plugin if the new API is not available, since we
  don't need to build it on Ubuntu 12.04 LTS.
* Report errors from click subprocesses in PackageKit plugin
  (LP: #1218483).
* Implement PackageKit search by name and by details.
* Reserve manifest keys starting with an underscore for use as dynamic
  properties of installed packages.
* Add the dynamic key "_directory" to "click list --manifest" output,
  showing the directory where each package is unpacked (LP: #1221760).
* Add the dynamic key "_removable" to "click list --manifest" output,
  which is 1 if a package is unpacked in a location from which it can be
  removed, otherwise 0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
115
115
        with mkfile(os.path.join(scratch, "toplevel")) as f:
116
116
            f.write("test /toplevel\n")
117
117
        with mkfile(os.path.join(scratch, "manifest.json")) as f:
118
 
            f.write(json.dumps({
 
118
            json.dump({
119
119
                "name": "com.ubuntu.test",
120
120
                "version": "1.0",
121
121
                "maintainer": "Foo Bar <foo@example.org>",
122
122
                "title": "test title",
123
123
                "architecture": "all",
124
124
                "framework": "ubuntu-sdk-13.10",
125
 
            }))
 
125
            }, f)
126
126
            # build() overrides this back to 0o644
127
127
            os.fchmod(f.fileno(), 0o600)
128
128
        self.builder.add_file(scratch, "/")
190
190
        scratch = os.path.join(self.temp_dir, "scratch")
191
191
        touch(os.path.join(scratch, ".click", "evil-file"))
192
192
        with mkfile(os.path.join(scratch, "manifest.json")) as f:
193
 
            f.write(json.dumps({
 
193
            json.dump({
194
194
                "name": "com.ubuntu.test",
195
195
                "version": "1.0",
196
196
                "maintainer": "Foo Bar <foo@example.org>",
197
197
                "title": "test title",
198
198
                "architecture": "all",
199
199
                "framework": "ubuntu-sdk-13.10",
200
 
            }))
 
200
            }, f)
201
201
        self.builder.add_file(scratch, "/")
202
202
        path = self.builder.build(self.temp_dir)
203
203
        extract_path = os.path.join(self.temp_dir, "extract")
217
217
        touch(os.path.join(scratch, "bin", "foo"))
218
218
        touch(os.path.join(scratch, ".git", "config"))
219
219
        with mkfile(os.path.join(scratch, "manifest.json")) as f:
220
 
            f.write(json.dumps({
 
220
            json.dump({
221
221
                "name": "com.ubuntu.test",
222
222
                "version": "1.0",
223
223
                "maintainer": "Foo Bar <foo@example.org>",
224
224
                "title": "test title",
225
225
                "architecture": "all",
226
226
                "framework": "ubuntu-sdk-13.10",
227
 
            }))
 
227
            }, f)
228
228
            # build() overrides this back to 0o644
229
229
            os.fchmod(f.fileno(), 0o600)
230
230
        self.builder.add_file(scratch, "./")