comparison 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
comparison
equal deleted inserted replaced
24:88f3d83eb858 25:a54543838686
7 >>> from buttercup import source 7 >>> from buttercup import source
8 >>> cwd = os.getcwd() 8 >>> cwd = os.getcwd()
9 9
10 Test source resolution:: 10 Test source resolution::
11 11
12 >>> hgsource = source.HgSource('http://k0s.org/hg/pyloader') 12 >>> pyloader = 'http://k0s.org/hg/pyloader'
13 >>> hgsource = source.HgSource(pyloader)
13 >>> hgsource.directory() == os.path.join(cwd, 'pyloader') 14 >>> hgsource.directory() == os.path.join(cwd, 'pyloader')
14 True 15 True
15 >>> gitsource = source.GitSource('git://github.com/mozilla/toolbox.git') 16 >>> toolbox = 'git://github.com/mozilla/toolbox.git'
17 >>> gitsource = source.GitSource(toolbox)
16 >>> gitsource.directory() == os.path.join(cwd, 'toolbox') 18 >>> gitsource.directory() == os.path.join(cwd, 'toolbox')
17 True 19 True
20
21 Test source resolution with a dictionary::
22
23 >>> source_dict = {'hg': [pyloader], 'git': [toolbox]}
24 >>> sources = source.sources(source_dict, srcdir='/tmp')
25 >>> sorted([i.directory() for i in sources])
26 ['/tmp/pyloader', '/tmp/toolbox']