annotate tests/test_source.txt @ 31:f6b768417d27

now listing kinda works
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 31 May 2011 07:39:07 -0700
parents 51b62e96ab51
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
28
51b62e96ab51 name doctest files more sensibly
Jeff Hammel <jhammel@mozilla.com>
parents: 27
diff changeset
1 Test Sources
51b62e96ab51 name doctest files more sensibly
Jeff Hammel <jhammel@mozilla.com>
parents: 27
diff changeset
2 ============
18
151862a0a711 begin restructuring to something more modular and extensible
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
3
151862a0a711 begin restructuring to something more modular and extensible
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
4 The obligatory imports::
151862a0a711 begin restructuring to something more modular and extensible
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
5
151862a0a711 begin restructuring to something more modular and extensible
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
6 >>> import os
151862a0a711 begin restructuring to something more modular and extensible
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
7 >>> from buttercup import source
151862a0a711 begin restructuring to something more modular and extensible
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
8 >>> cwd = os.getcwd()
151862a0a711 begin restructuring to something more modular and extensible
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
9
151862a0a711 begin restructuring to something more modular and extensible
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
10 Test source resolution::
151862a0a711 begin restructuring to something more modular and extensible
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
11
25
a54543838686 add test for source demunging
Jeff Hammel <jhammel@mozilla.com>
parents: 18
diff changeset
12 >>> pyloader = 'http://k0s.org/hg/pyloader'
a54543838686 add test for source demunging
Jeff Hammel <jhammel@mozilla.com>
parents: 18
diff changeset
13 >>> hgsource = source.HgSource(pyloader)
18
151862a0a711 begin restructuring to something more modular and extensible
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
14 >>> hgsource.directory() == os.path.join(cwd, 'pyloader')
151862a0a711 begin restructuring to something more modular and extensible
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
15 True
25
a54543838686 add test for source demunging
Jeff Hammel <jhammel@mozilla.com>
parents: 18
diff changeset
16 >>> toolbox = 'git://github.com/mozilla/toolbox.git'
a54543838686 add test for source demunging
Jeff Hammel <jhammel@mozilla.com>
parents: 18
diff changeset
17 >>> gitsource = source.GitSource(toolbox)
18
151862a0a711 begin restructuring to something more modular and extensible
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
18 >>> gitsource.directory() == os.path.join(cwd, 'toolbox')
151862a0a711 begin restructuring to something more modular and extensible
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
19 True
25
a54543838686 add test for source demunging
Jeff Hammel <jhammel@mozilla.com>
parents: 18
diff changeset
20
a54543838686 add test for source demunging
Jeff Hammel <jhammel@mozilla.com>
parents: 18
diff changeset
21 Test source resolution with a dictionary::
a54543838686 add test for source demunging
Jeff Hammel <jhammel@mozilla.com>
parents: 18
diff changeset
22
a54543838686 add test for source demunging
Jeff Hammel <jhammel@mozilla.com>
parents: 18
diff changeset
23 >>> source_dict = {'hg': [pyloader], 'git': [toolbox]}
a54543838686 add test for source demunging
Jeff Hammel <jhammel@mozilla.com>
parents: 18
diff changeset
24 >>> sources = source.sources(source_dict, srcdir='/tmp')
a54543838686 add test for source demunging
Jeff Hammel <jhammel@mozilla.com>
parents: 18
diff changeset
25 >>> sorted([i.directory() for i in sources])
a54543838686 add test for source demunging
Jeff Hammel <jhammel@mozilla.com>
parents: 18
diff changeset
26 ['/tmp/pyloader', '/tmp/toolbox']
27
901755a65249 start stubbing checkout
Jeff Hammel <jhammel@mozilla.com>
parents: 25
diff changeset
27