|
19 | 19 |
|
20 | 20 |
|
21 | 21 | __all__ = ( |
22 | | - 'fixture_path', 'fixture', 'absolute_project_path', 'StringProcessAdapter', |
| 22 | + 'StringProcessAdapter', 'GlobalsItemDeletorMetaCls', |
23 | 23 | 'with_rw_repo', 'with_rw_and_rw_remote_repo', 'TestBase', 'TestCase', |
24 | | - 'GlobalsItemDeletorMetaCls' |
25 | | - ) |
| 24 | + ) |
26 | 25 |
|
27 | | -#{ Routines |
28 | 26 |
|
29 | | -def fixture_path(name): |
30 | | - test_dir = os.path.dirname(os.path.dirname(__file__)) |
31 | | - return os.path.join(test_dir, "fixtures", name) |
32 | | - |
33 | | -def fixture(name): |
34 | | - return open(fixture_path(name), 'rb').read() |
35 | | - |
36 | | -def absolute_project_path(): |
37 | | - return os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")) |
38 | | - |
39 | | -#} END routines |
40 | 27 |
|
41 | 28 | #{ Adapters |
42 | 29 |
|
@@ -227,37 +214,10 @@ def __new__(metacls, name, bases, clsdict): |
227 | 214 | class TestBase(TestCase): |
228 | 215 | """ |
229 | 216 | Base Class providing default functionality to all tests such as: |
230 | | - |
231 | 217 | - Utility functions provided by the TestCase base of the unittest method such as:: |
232 | 218 | self.fail("todo") |
233 | 219 | self.failUnlessRaises(...) |
234 | | - |
235 | | - - Class level repository which is considered read-only as it is shared among |
236 | | - all test cases in your type. |
237 | | - Access it using:: |
238 | | - self.rorepo # 'ro' stands for read-only |
239 | | - |
240 | | - The rorepo is in fact your current project's git repo. If you refer to specific |
241 | | - shas for your objects, be sure you choose some that are part of the immutable portion |
242 | | - of the project history ( to assure tests don't fail for others ). |
243 | | - |
244 | | - Derived types can override the default repository type to create a differnt |
245 | | - read-only repo, allowing to test their specific type |
246 | 220 | """ |
247 | | - #{ Configuration |
248 | | - # The repository type to instantiate. It takes at least a path to operate upon |
249 | | - # during instantiation. |
250 | | - RepoCls = None |
251 | | - #} END configuration |
252 | | - |
253 | | - @classmethod |
254 | | - def setUpAll(cls): |
255 | | - """ |
256 | | - Dynamically add a read-only repository to our actual type. This way |
257 | | - each test type has its own repository |
258 | | - """ |
259 | | - assert cls.RepoCls is not None, "RepoCls class member must be set" |
260 | | - cls.rorepo = cls.RepoCls(rorepo_dir()) |
261 | 221 |
|
262 | 222 | def _make_file(self, rela_path, data, repo=None): |
263 | 223 | """ |
|
0 commit comments