1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
From 0a4a68215243aaa38d279bf1b835f974e0f3e489 Mon Sep 17 00:00:00 2001
From: Florian Sesser <florian@leastauthority.com>
Date: Thu, 16 Jan 2025 22:58:08 +0000
Subject: [PATCH] Fix #7: SyntaxWarnings due to invalid escape sequences
---
txi2p/test/test_plugins.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/txi2p/test/test_plugins.py b/txi2p/test/test_plugins.py
index 2e298ef..bf3c26a 100644
--- a/txi2p/test/test_plugins.py
+++ b/txi2p/test/test_plugins.py
@@ -66,7 +66,7 @@ def test_badAPI(self):
def test_apiEndpointWithNoAPI(self):
from twisted.internet.endpoints import clientFromString
self.failUnlessRaises(ValueError, clientFromString,
- MemoryReactor(), "i2p:stats.i2p:apiEndpoint=tcp\:127.0.0.1\:2827")
+ MemoryReactor(), r"i2p:stats.i2p:apiEndpoint=tcp\:127.0.0.1\:2827")
def test_stringDescription_default(self):
from twisted.internet.endpoints import clientFromString
@@ -78,7 +78,7 @@ def test_stringDescription_default(self):
def test_stringDescription_BOB(self):
from twisted.internet.endpoints import clientFromString
ep = clientFromString(
- MemoryReactor(), "i2p:stats.i2p:api=BOB:tunnelNick=spam:inport=12345:options=inbound.length\:5,outbound.length\:5")
+ MemoryReactor(), r"i2p:stats.i2p:api=BOB:tunnelNick=spam:inport=12345:options=inbound.length\:5,outbound.length\:5")
self.assertIsInstance(ep, BOBI2PClientEndpoint)
self.assertIsInstance(ep._reactor, MemoryReactor)
self.assertEqual(ep._dest,"stats.i2p")
@@ -90,7 +90,7 @@ def test_stringDescription_SAM(self):
from twisted.internet.endpoints import clientFromString
with mock.patch('txi2p.sam.endpoints.getSession', fakeSession):
ep = clientFromString(
- MemoryReactor(), "i2p:stats.i2p:81:api=SAM:localPort=34444:options=inbound.length\:5,outbound.length\:5:sigType=foobar")
+ MemoryReactor(), r"i2p:stats.i2p:81:api=SAM:localPort=34444:options=inbound.length\:5,outbound.length\:5:sigType=foobar")
self.assertIsInstance(ep, SAMI2PStreamClientEndpoint)
self.assertEqual(ep._host, "stats.i2p")
self.assertEqual(ep._port, 81)
@@ -122,7 +122,7 @@ def test_badAPI(self):
def test_apiEndpointWithNoAPI(self):
from twisted.internet.endpoints import serverFromString
self.failUnlessRaises(ValueError, serverFromString,
- MemoryReactor(), "i2p:/tmp/testkeys.foo:apiEndpoint=tcp\:127.0.0.1\:2827")
+ MemoryReactor(), r"i2p:/tmp/testkeys.foo:apiEndpoint=tcp\:127.0.0.1\:2827")
def test_stringDescription_default(self):
from twisted.internet.endpoints import serverFromString
@@ -134,7 +134,7 @@ def test_stringDescription_default(self):
def test_stringDescription_BOB(self):
from twisted.internet.endpoints import serverFromString
ep = serverFromString(
- MemoryReactor(), "i2p:/tmp/testkeys.foo:api=BOB:tunnelNick=spam:outport=23456:options=inbound.length\:5,outbound.length\:5")
+ MemoryReactor(), r"i2p:/tmp/testkeys.foo:api=BOB:tunnelNick=spam:outport=23456:options=inbound.length\:5,outbound.length\:5")
self.assertIsInstance(ep, BOBI2PServerEndpoint)
self.assertIsInstance(ep._reactor, MemoryReactor)
self.assertEqual(ep._keyfile, "/tmp/testkeys.foo")
@@ -146,7 +146,7 @@ def test_stringDescription_SAM(self):
from twisted.internet.endpoints import serverFromString
with mock.patch('txi2p.sam.endpoints.getSession', fakeSession):
ep = serverFromString(
- MemoryReactor(), "i2p:/tmp/testkeys.foo:81:api=SAM:options=inbound.length\:5,outbound.length\:5:sigType=foobar")
+ MemoryReactor(), r"i2p:/tmp/testkeys.foo:81:api=SAM:options=inbound.length\:5,outbound.length\:5:sigType=foobar")
self.assertIsInstance(ep, SAMI2PStreamServerEndpoint)
s = ep._sessionDeferred
self.assertEqual(s.kwargs['options'], {'inbound.length': '5', 'outbound.length': '5'})
|