@@ -17,18 +17,32 @@ def testTime(self):
17
17
18
18
time_after = math .ceil (time .time ())
19
19
20
- if len (msg .params ) == 3 :
20
+ if len (msg .params ) == 5 :
21
+ # ircu2, snircd
21
22
self .assertMessageMatch (
22
- msg , command = RPL_TIME , params = ["user" , "My.Little.Server" , ANYSTR ]
23
+ msg ,
24
+ command = RPL_TIME ,
25
+ params = ["user" , "My.Little.Server" , StrRe ("[0-9]+" ), "0" , ANYSTR ],
23
26
)
24
- else :
27
+ self .assertIn (
28
+ int (msg .params [2 ]),
29
+ range (time_before , time_after + 1 ),
30
+ "Timestamp not in expected range" ,
31
+ )
32
+ elif len (msg .params ) == 4 :
33
+ # bahamut
25
34
self .assertMessageMatch (
26
35
msg ,
27
36
command = RPL_TIME ,
28
- params = ["user" , "My.Little.Server" , StrRe ("[0-9]+" ), "0" , ANYSTR ],
37
+ params = ["user" , "My.Little.Server" , StrRe ("[0-9]+" ), ANYSTR ],
29
38
)
30
39
self .assertIn (
31
40
int (msg .params [2 ]),
32
41
range (time_before , time_after + 1 ),
33
42
"Timestamp not in expected range" ,
34
43
)
44
+ else :
45
+ # Common case
46
+ self .assertMessageMatch (
47
+ msg , command = RPL_TIME , params = ["user" , "My.Little.Server" , ANYSTR ]
48
+ )
0 commit comments