comparison tests/test_source.txt @ 28:51b62e96ab51

name doctest files more sensibly
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 30 May 2011 21:23:20 -0700
parents tests/doctest.txt@901755a65249
children
comparison
equal deleted inserted replaced
27:901755a65249 28:51b62e96ab51
1 Test Sources
2 ============
3
4 The obligatory imports::
5
6 >>> import os
7 >>> from buttercup import source
8 >>> cwd = os.getcwd()
9
10 Test source resolution::
11
12 >>> pyloader = 'http://k0s.org/hg/pyloader'
13 >>> hgsource = source.HgSource(pyloader)
14 >>> hgsource.directory() == os.path.join(cwd, 'pyloader')
15 True
16 >>> toolbox = 'git://github.com/mozilla/toolbox.git'
17 >>> gitsource = source.GitSource(toolbox)
18 >>> gitsource.directory() == os.path.join(cwd, 'toolbox')
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']
27