Skip to content

Commit

Permalink
Merge pull request #382 from meejah/381.python312
Browse files Browse the repository at this point in the history
make tests more-specific
  • Loading branch information
meejah committed Jun 1, 2023
2 parents 8aa5e02 + c6371c1 commit e50efcb
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/releases.rst
Expand Up @@ -17,6 +17,7 @@ See also :ref:`api_stability`.

`git main <https://github.com/meejah/txtorcon>`_ *will likely become v23.6.0*

* Fix test-failures on Python 3.12


v23.5.0
Expand Down
27 changes: 24 additions & 3 deletions test/test_torstate.py
Expand Up @@ -1293,7 +1293,14 @@ def __init__(self, i):
self.assertEqual(self.transport.value(), b'EXTENDCIRCUIT 0 0000000000000000000000000000000000000000,0000000000000000000000000000000000000001,0000000000000000000000000000000000000002\r\n')
# should have gotten a warning about this not being an entry
# guard
self.assertEqual(len(self.flushWarnings()), 1)
self.assertEqual(
1,
len([
warn
for warn in self.flushWarnings()
if "Circuit doesn't start with a guard" in warn["message"]
])
)

def test_build_circuit_no_routers(self):
self.state.build_circuit()
Expand Down Expand Up @@ -1329,7 +1336,14 @@ def __init__(self, i):
self.send(b"250 EXTENDED 1234")
# should have gotten a warning about this not being an entry
# guard
self.assertEqual(len(self.flushWarnings()), 1)
self.assertEqual(
1,
len([
warn
for warn in self.flushWarnings()
if "Circuit doesn't start with a guard" in warn["message"]
])
)
return d

def test_build_circuit_error(self):
Expand Down Expand Up @@ -1477,7 +1491,14 @@ def __init__(self, i):
self.state.circuits[1234].update(['1234', 'BUILT'])
# should have gotten a warning about this not being an entry
# guard
self.assertEqual(len(self.flushWarnings()), 1)
self.assertEqual(
1,
len([
warn
for warn in self.flushWarnings()
if "Circuit doesn't start with a guard" in warn["message"]
])
)
return d

def test_build_circuit_failure(self):
Expand Down

0 comments on commit e50efcb

Please sign in to comment.