Mercurial > mozilla > hg > ProfileManager
annotate profilemanager/tests/test_profilemanager.txt @ 22:956f5a4c589a
* restructure utility functions to do less more efficiently
* finish remove function [untested]
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Thu, 06 May 2010 15:36:00 -0700 |
parents | 4a1815f8d146 |
children | a8601c2273b5 |
rev | line source |
---|---|
12 | 1 Test ProfileManager |
2 =================== | |
3 | |
4 The obligatory imports: | |
5 | |
6 >>> import os | |
7 >>> from profilemanager import ProfileManager | |
8 | |
9 Get the path to the test profiles.ini file: | |
10 | |
11 >>> from pkg_resources import resource_filename | |
12 >>> path = os.path.join('tests', 'profiles', 'profiles.ini') | |
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 |
e846544b4d92
stub for a test to create a new profile
Jeff Hammel <jhammel@mozilla.com>
parents:
13
diff
changeset
|
19 Create a new profile: |
e846544b4d92
stub for a test to create a new profile
Jeff Hammel <jhammel@mozilla.com>
parents:
13
diff
changeset
|
20 |
19
4a1815f8d146
* stub adding new profile to configuration
Jeff Hammel <jhammel@mozilla.com>
parents:
14
diff
changeset
|
21 >>> profiledir = manager.new('testprofile') |
4a1815f8d146
* stub adding new profile to configuration
Jeff Hammel <jhammel@mozilla.com>
parents:
14
diff
changeset
|
22 >>> print profiledir |
4a1815f8d146
* stub adding new profile to configuration
Jeff Hammel <jhammel@mozilla.com>
parents:
14
diff
changeset
|
23 ...profilemanager/tests/profiles/...testprofile |
4a1815f8d146
* stub adding new profile to configuration
Jeff Hammel <jhammel@mozilla.com>
parents:
14
diff
changeset
|
24 |
4a1815f8d146
* stub adding new profile to configuration
Jeff Hammel <jhammel@mozilla.com>
parents:
14
diff
changeset
|
25 Cleanup: |
4a1815f8d146
* stub adding new profile to configuration
Jeff Hammel <jhammel@mozilla.com>
parents:
14
diff
changeset
|
26 |
4a1815f8d146
* stub adding new profile to configuration
Jeff Hammel <jhammel@mozilla.com>
parents:
14
diff
changeset
|
27 >>> manager.remove('testprofile') |