def test_get_revision(self): |
-> py.test.skip('XXX changed implementation (temporarily?)') |
if py.std.sys.platform.startswith('win'): |
py.test.skip('broken on win32 for some reason (svn caching?), ' |
'skipping') |
|
|
|
|
repo = make_test_repo('test_get_revision_api_repo') |
wc = py.path.svnwc(py.test.ensuretemp('test_get_revision_api_wc')) |
wc.checkout(repo.url) |
assert wc.status().rev == '0' |
|
|
fs_root, pkg_name = setup_fs_project(wc) |
ds, dsa = get_dsa(self.fs_root, self.pkg_name) |
wc.commit('test get revision commit') |
wc.update() |
|
|
py.__.apigen.htmlgen._get_obj_cache = {} |
|
|
old_path = py.std.sys.path |
try: |
py.std.sys.path.insert(0, fs_root.strpath) |
pkgkeys = [k for k in py.std.sys.modules.keys() if |
k == 'pkg' or k.startswith('pkg.')] |
|
for key in pkgkeys: |
del py.std.sys.modules[key] |
|
|
apb = ApiPageBuilder(self.base, self.linker, dsa, |
fs_root.join(pkg_name), |
self.namespace_tree, self.project) |
apb._revcache = {} |
|
pkg = wc.join('pkg') |
assert pkg.check(versioned=True) |
assert pkg.info().created_rev == 1 |
|
funcpath = pkg.join('func.py') |
classpath = pkg.join('someclass.py') |
assert funcpath.check(versioned=True) |
assert classpath.check(versioned=True) |
assert apb.get_revision('main.sub.func') == 1 |
assert apb.get_revision('main.SomeClass') == 1 |
assert apb.get_revision('') == 1 |
assert apb.get_revision('main.sub') == 1 |
funcpath.write(funcpath.read() + '\n') |
funcpath.commit('updated func') |
wc.update() |
apb._revcache = {} |
assert apb.get_revision('main.sub.func') == 2 |
assert apb.get_revision('') == 1 |
assert apb.get_revision('main.SomeClass') == 1 |
finally: |
py.std.sys.path = old_path |
|
py.__.apigen.htmlgen._get_obj_cache = {} |
apb._revcache = {} |