changeset 11:c41a946d34af

stub out info method
author Jeff Hammel <jhammel@mozilla.com>
date Fri, 24 Feb 2012 15:05:08 -0800
parents d63ae03cc300
children ceb8c69a16f3
files paint/package.py tests/doctest.txt
diffstat 2 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/paint/package.py	Fri Feb 24 14:52:53 2012 -0800
+++ b/paint/package.py	Fri Feb 24 15:05:08 2012 -0800
@@ -44,8 +44,8 @@
 
     def fetch(self):
         """fetch from remote source to a temporary file"""
-        fd, filename = tmpfile.mkstemp()
-        resource = urllib.urlopen(self.src)
+        fd, filename = tempfile.mkstemp()
+        resource = urllib2.urlopen(self.src)
         os.write(fd, resource.read())
         os.close(fd)
         return filename
@@ -71,3 +71,10 @@
         self._tmppath = None
 
     __del__ = cleanup
+
+    def info(self):
+        path = self.path()
+        assert os.path.exists(os.path.join(path, 'setup.py'))
+
+    def dependencies(self):
+        path = self.path()
--- a/tests/doctest.txt	Fri Feb 24 14:52:53 2012 -0800
+++ b/tests/doctest.txt	Fri Feb 24 15:05:08 2012 -0800
@@ -1,11 +1,12 @@
 Test PaInt
 ================
 
-The obligatory imports:
+The obligatory imports::
 
     >>> import paint
 
-Run some tests.  This test will fail, please fix it:
+Get the dependencies of a package::
 
     >>> jetperf = paint.Package('http://k0s.org/mozilla/hg/jetperf/archive/tip.tar.gz')
-
+    >>> dependencies = jetperf.dependencies()
+    >>> jetperf.cleanup()