[py-svn] r33709 - in py/dist/py/apigen: rest/testing tracer/testing
fijal at codespeak.net
fijal at codespeak.net
Wed Oct 25 10:39:30 CEST 2006
Author: fijal
Date: Wed Oct 25 10:39:27 2006
New Revision: 33709
Modified:
py/dist/py/apigen/rest/testing/test_rest.py
py/dist/py/apigen/tracer/testing/test_model.py
Log:
Fixed skipped test.
Modified: py/dist/py/apigen/rest/testing/test_rest.py
==============================================================================
--- py/dist/py/apigen/rest/testing/test_rest.py (original)
+++ py/dist/py/apigen/rest/testing/test_rest.py Wed Oct 25 10:39:27 2006
@@ -138,8 +138,8 @@
import somemodule
import someothermodule
descs = {
- 'somemodule.SomeClass': somemodule,
- 'someothermodule.SomeOtherClass': someothermodule,
+ 'somemodule.SomeClass': somemodule.SomeClass,
+ 'someothermodule.SomeSubClass': someothermodule.SomeSubClass,
'someothermodule.fun': someothermodule.fun,
}
ds = DocStorage().from_dict(descs)
@@ -179,26 +179,27 @@
self.check_rest(tempdir)
def test_generation_modules(self):
- py.test.skip('borken - fijal, somehow the methods for classes in '
- 'modules don\'t get picked up... any idea?')
+ #py.test.skip('borken - fijal, somehow the methods for classes in '
+ # 'modules don\'t get picked up... any idea?')
ds = self.get_filled_docstorage_modules()
lg = DirectPaste()
tempdir = temppath.ensure('module_api', dir=True)
r = RestGen(ds, lg, DirWriter(tempdir))
r.write()
basenames = [p.basename for p in tempdir.listdir('*.txt')]
- assert sorted(basenames) == [
+ expected = [
'class_somemodule.SomeClass.txt',
- 'class_someothermodule.SomeOtherClass.txt',
+ 'class_someothermodule.SomeSubClass.txt',
'function_someothermodule.fun.txt',
'index.txt',
'method_somemodule.SomeClass.__init__.txt',
'method_somemodule.SomeClass.method.txt',
- 'method_somemodule.SomeSubClass.__init__.txt',
- 'method_somemodule.SomeSubClass.method.txt',
+ 'method_someothermodule.SomeSubClass.__init__.txt',
+ 'method_someothermodule.SomeSubClass.method.txt',
'module_somemodule.txt',
'module_someothermodule.txt',
]
+ assert sorted(basenames) == expected
def test_check_internal_links(self):
ds = self.get_filled_docstorage()
Modified: py/dist/py/apigen/tracer/testing/test_model.py
==============================================================================
--- py/dist/py/apigen/tracer/testing/test_model.py (original)
+++ py/dist/py/apigen/tracer/testing/test_model.py Wed Oct 25 10:39:27 2006
@@ -85,14 +85,14 @@
f = guess_type(A).unionof(guess_type(A))
assert isinstance(f, SomeClass)
assert f.cls is A
- f = guess_type(A).unionof(guess_type(B))
+ f = guess_type(A).unionof(guess_type(B)).unionof(guess_type(A))
assert isinstance(f, SomeUnion)
assert len(f.possibilities) == 2
f = guess_type(A()).unionof(guess_type(A()))
assert isinstance(f, SomeInstance)
assert isinstance(f.classdef, SomeClass)
assert f.classdef.cls is A
- f = guess_type(B()).unionof(guess_type(A()))
+ f = guess_type(B()).unionof(guess_type(A())).unionof(guess_type(B()))
assert isinstance(f, SomeInstance)
assert isinstance(f.classdef, SomeUnion)
assert len(f.classdef.possibilities) == 2
More information about the pytest-commit
mailing list