work around relative imports

This commit is contained in:
Fedor Lyanguzov
2024-12-28 18:50:30 +03:00
parent 8907ed33f8
commit 02a4f590f2
4 changed files with 53 additions and 56 deletions
+2 -1
View File
@@ -1,4 +1,4 @@
from vpn_manager import *
from vpn_manager.peers import *
def test_format_static_peer():
sp = Peer('PUB', "PRV", '10.0.0.1/32', '12345', '127.0.0.1')
@@ -15,3 +15,4 @@ def test_true():
== '[Interface]\nPrivateKey = PRV\nAddress = 10.0.0.1/32\nListenPort = PORT\nDNS = 1.1.1.1\nPostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE\nPostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE'
assert format_interface(Peer('PUB', 'PRV', '10.0.0.1/32', None), '1.1.1.1', forward=True) \
== '[Interface]\nPrivateKey = PRV\nAddress = 10.0.0.1/32\nDNS = 1.1.1.1\nPostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE\nPostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE'