Test cases need to work without twisted

Bug #395610 reported by rick_dean on 2009-07-04
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pyOpenSSL
Fix Released
Undecided
Unassigned

Bug Description

The test cases use assertIdentical() and assertNotIdentical()
which are not supported by python 2.5.2 of fedora 10
with twisted uninstalled. The attached patch corrects
that.

server_random of client_conn and server_conn must have
the same value. Maybe they aren't identical if
they are buffers (not str), and thus have different
addresses id(), but they need to contain the same
value. This patch corrects it to assertEqual()

The assertRaises() of non-twisted apparently does
not return the exception, so we have to catch it
explicitly. This patch corrects it.

The test cases leave some temporary files "tmp*"
when they run. The attached patch cleans them up.

The patch is against the tip (revno: 107) of trunk
of pyopenssl. Likewise the branch posted to
lp:~rick-fdd/pyopenssl/assert_identical

rick_dean (rick-fdd) wrote :
Jean-Paul Calderone (exarkun) wrote :

I should probably abandon the idea that the test suite will work either with Twisted's TestCase or the stdlib TestCase (unless I'm willing to actually start testing it against both continuously, which I'm not). So that probably means just using stdlib TestCase everywhere (I'd rather use Twisted's everywhere, but probably more people will be happy the other way :).

The way I'd prefer to do this is to have a base TestCase in OpenSSL which adds whatever features the OpenSSL test suite wants to use (like _Python23TestCaseHelper, but not a mixin).

For features that are too hard to implement for this to be worthwhile (eg temp file cleanup, probably), modifying the test_ methods themselves is probably sensible.

Changed in pyopenssl:
status: New → Confirmed
Changed in pyopenssl:
status: Confirmed → Fix Committed
rick_dean (rick-fdd) wrote :

The commit is working for me. Thanks.

Changed in pyopenssl:
milestone: none → 0.10
Changed in pyopenssl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers