annotate profilemanager/tests/test_profilemanager.txt @ 26:d260de170cca

no need to pass self here
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 06 May 2010 15:48:20 -0700
parents a8601c2273b5
children 5988a15da3b4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12
a07e53273b70 adding stubs for tests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
1 Test ProfileManager
a07e53273b70 adding stubs for tests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
2 ===================
a07e53273b70 adding stubs for tests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
3
a07e53273b70 adding stubs for tests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
4 The obligatory imports:
a07e53273b70 adding stubs for tests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
5
a07e53273b70 adding stubs for tests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
6 >>> import os
a07e53273b70 adding stubs for tests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
7 >>> from profilemanager import ProfileManager
a07e53273b70 adding stubs for tests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
8
a07e53273b70 adding stubs for tests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
9 Get the path to the test profiles.ini file:
a07e53273b70 adding stubs for tests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
10
a07e53273b70 adding stubs for tests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
11 >>> from pkg_resources import resource_filename
a07e53273b70 adding stubs for tests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
12 >>> path = os.path.join('tests', 'profiles', 'profiles.ini')
a07e53273b70 adding stubs for tests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
13 >>> profiles = resource_filename('profilemanager', path)
13
5f81f9d321ba instantiate a profile manager in the tests with a stub profiles.ini file
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
14
5f81f9d321ba instantiate a profile manager in the tests with a stub profiles.ini file
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
15 Instatiate a ProfileManager:
5f81f9d321ba instantiate a profile manager in the tests with a stub profiles.ini file
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
16
5f81f9d321ba instantiate a profile manager in the tests with a stub profiles.ini file
Jeff Hammel <jhammel@mozilla.com>
parents: 12
diff changeset
17 >>> manager = ProfileManager(profiles)
14
e846544b4d92 stub for a test to create a new profile
Jeff Hammel <jhammel@mozilla.com>
parents: 13
diff changeset
18
23
a8601c2273b5 * hopefully fix tests
Jeff Hammel <jhammel@mozilla.com>
parents: 19
diff changeset
19 (I should delete any existing profiles at this point, but instead I'll
a8601c2273b5 * hopefully fix tests
Jeff Hammel <jhammel@mozilla.com>
parents: 19
diff changeset
20 defer this to later.)
a8601c2273b5 * hopefully fix tests
Jeff Hammel <jhammel@mozilla.com>
parents: 19
diff changeset
21
14
e846544b4d92 stub for a test to create a new profile
Jeff Hammel <jhammel@mozilla.com>
parents: 13
diff changeset
22 Create a new profile:
e846544b4d92 stub for a test to create a new profile
Jeff Hammel <jhammel@mozilla.com>
parents: 13
diff changeset
23
19
4a1815f8d146 * stub adding new profile to configuration
Jeff Hammel <jhammel@mozilla.com>
parents: 14
diff changeset
24 >>> profiledir = manager.new('testprofile')
23
a8601c2273b5 * hopefully fix tests
Jeff Hammel <jhammel@mozilla.com>
parents: 19
diff changeset
25 >>> profiledir
a8601c2273b5 * hopefully fix tests
Jeff Hammel <jhammel@mozilla.com>
parents: 19
diff changeset
26 '...profilemanager/tests/profiles/...testprofile'
19
4a1815f8d146 * stub adding new profile to configuration
Jeff Hammel <jhammel@mozilla.com>
parents: 14
diff changeset
27
4a1815f8d146 * stub adding new profile to configuration
Jeff Hammel <jhammel@mozilla.com>
parents: 14
diff changeset
28 Cleanup:
4a1815f8d146 * stub adding new profile to configuration
Jeff Hammel <jhammel@mozilla.com>
parents: 14
diff changeset
29
4a1815f8d146 * stub adding new profile to configuration
Jeff Hammel <jhammel@mozilla.com>
parents: 14
diff changeset
30 >>> manager.remove('testprofile')