add static peer formatting for client config

This commit is contained in:
Fedor Lyanguzov
2024-12-27 23:53:58 +03:00
parent 965fa0cb4e
commit 35071d2b6f
3 changed files with 26 additions and 3 deletions
+6 -3
View File
@@ -1,3 +1,6 @@
def test_true():
assert True
from vpn_manager import *
def test_format_static_peer():
sp = StaticPeer('sample-public-key', '127.0.0.1', '12345')
peer_section = format_static_peer(sp, '0.0.0.0/0')
assert peer_section == '[Peer]\nPublicKey = sample-public-key\nAllowedIPs = 0.0.0.0/0\nEndpoint = 127.0.0.1:12345\nPersistentKeepAlive = 30'