diff tests/doctest.txt @ 25:a54543838686

add test for source demunging
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 30 May 2011 21:11:19 -0700
parents 151862a0a711
children 901755a65249
line wrap: on
line diff
--- a/tests/doctest.txt	Mon May 30 21:03:45 2011 -0700
+++ b/tests/doctest.txt	Mon May 30 21:11:19 2011 -0700
@@ -9,9 +9,18 @@
 
 Test source resolution::
 
-    >>> hgsource = source.HgSource('http://k0s.org/hg/pyloader')
+    >>> pyloader = 'http://k0s.org/hg/pyloader'
+    >>> hgsource = source.HgSource(pyloader)
     >>> hgsource.directory() == os.path.join(cwd, 'pyloader')
     True
-    >>> gitsource = source.GitSource('git://github.com/mozilla/toolbox.git')
+    >>> toolbox = 'git://github.com/mozilla/toolbox.git'
+    >>> gitsource = source.GitSource(toolbox)
     >>> gitsource.directory() == os.path.join(cwd, 'toolbox')
     True
+
+Test source resolution with a dictionary::
+
+    >>> source_dict = {'hg': [pyloader], 'git': [toolbox]}
+    >>> sources = source.sources(source_dict, srcdir='/tmp')
+    >>> sorted([i.directory() for i in sources])
+    ['/tmp/pyloader', '/tmp/toolbox']