Skip to content

Commit b005ee0

Browse files
author
Roman
committed
uncomment
1 parent 5ff1967 commit b005ee0

File tree

1 file changed

+44
-44
lines changed

1 file changed

+44
-44
lines changed

tests/unit_tests/test_axon.py

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -31,50 +31,50 @@
3131
)
3232

3333

34-
# def test_attach_initial(mock_get_external_ip):
35-
# # Create a mock AxonServer instance
36-
# server = Axon()
37-
#
38-
# # Define the Synapse type
39-
# class TestSynapse(Synapse):
40-
# pass
41-
#
42-
# # Define the functions with the correct signatures
43-
# def forward_fn(synapse: TestSynapse) -> Any:
44-
# pass
45-
#
46-
# def blacklist_fn(synapse: TestSynapse) -> Tuple[bool, str]:
47-
# return True, ""
48-
#
49-
# def priority_fn(synapse: TestSynapse) -> float:
50-
# return 1.0
51-
#
52-
# def verify_fn(synapse: TestSynapse) -> None:
53-
# pass
54-
#
55-
# # Test attaching with correct signatures
56-
# server.attach(forward_fn, blacklist_fn, priority_fn, verify_fn)
57-
#
58-
# # Define functions with incorrect signatures
59-
# def wrong_blacklist_fn(synapse: TestSynapse) -> int:
60-
# return 1
61-
#
62-
# def wrong_priority_fn(synapse: TestSynapse) -> int:
63-
# return 1
64-
#
65-
# def wrong_verify_fn(synapse: TestSynapse) -> bool:
66-
# return True
67-
#
68-
# # Test attaching with incorrect signatures
69-
# with pytest.raises(AssertionError):
70-
# server.attach(forward_fn, wrong_blacklist_fn, priority_fn, verify_fn)
71-
#
72-
# with pytest.raises(AssertionError):
73-
# server.attach(forward_fn, blacklist_fn, wrong_priority_fn, verify_fn)
74-
#
75-
# with pytest.raises(AssertionError):
76-
# server.attach(forward_fn, blacklist_fn, priority_fn, wrong_verify_fn)
77-
#
34+
def test_attach_initial(mock_get_external_ip):
35+
# Create a mock AxonServer instance
36+
server = Axon()
37+
38+
# Define the Synapse type
39+
class TestSynapse(Synapse):
40+
pass
41+
42+
# Define the functions with the correct signatures
43+
def forward_fn(synapse: TestSynapse) -> Any:
44+
pass
45+
46+
def blacklist_fn(synapse: TestSynapse) -> Tuple[bool, str]:
47+
return True, ""
48+
49+
def priority_fn(synapse: TestSynapse) -> float:
50+
return 1.0
51+
52+
def verify_fn(synapse: TestSynapse) -> None:
53+
pass
54+
55+
# Test attaching with correct signatures
56+
server.attach(forward_fn, blacklist_fn, priority_fn, verify_fn)
57+
58+
# Define functions with incorrect signatures
59+
def wrong_blacklist_fn(synapse: TestSynapse) -> int:
60+
return 1
61+
62+
def wrong_priority_fn(synapse: TestSynapse) -> int:
63+
return 1
64+
65+
def wrong_verify_fn(synapse: TestSynapse) -> bool:
66+
return True
67+
68+
# Test attaching with incorrect signatures
69+
with pytest.raises(AssertionError):
70+
server.attach(forward_fn, wrong_blacklist_fn, priority_fn, verify_fn)
71+
72+
with pytest.raises(AssertionError):
73+
server.attach(forward_fn, blacklist_fn, wrong_priority_fn, verify_fn)
74+
75+
with pytest.raises(AssertionError):
76+
server.attach(forward_fn, blacklist_fn, priority_fn, wrong_verify_fn)
77+
7878

7979
def test_attach(mock_get_external_ip):
8080
# Create a mock AxonServer instance

0 commit comments

Comments
 (0)