|
| 1 | +(* ::**************************************************************************************************************:: *) |
| 2 | +(* ::Section::Closed:: *) |
| 3 | +(*Initialization*) |
| 4 | +VerificationTest[ |
| 5 | + Needs[ "Wolfram`AgentToolsTests`", FileNameJoin @ { DirectoryName @ $TestFileName, "Common.wl" } ], |
| 6 | + Null, |
| 7 | + SameTest -> MatchQ, |
| 8 | + TestID -> "GetDefinitions@@Tests/SupportedClients.wlt:4,1-9,2" |
| 9 | +] |
| 10 | + |
| 11 | +VerificationTest[ |
| 12 | + Needs[ "Wolfram`AgentTools`" ], |
| 13 | + Null, |
| 14 | + SameTest -> MatchQ, |
| 15 | + TestID -> "LoadContext@@Tests/SupportedClients.wlt:11,1-16,2" |
| 16 | +] |
| 17 | + |
| 18 | +(* ::**************************************************************************************************************:: *) |
| 19 | +(* ::Section::Closed:: *) |
| 20 | +(*DetectedMCPClients*) |
| 21 | + |
| 22 | +(* ::**************************************************************************************************************:: *) |
| 23 | +(* ::Subsection::Closed:: *) |
| 24 | +(*Returns an association of supported client metadata keyed by canonical name*) |
| 25 | +VerificationTest[ |
| 26 | + DetectedMCPClients[ ], |
| 27 | + KeyValuePattern[ { } ]?AssociationQ, |
| 28 | + SameTest -> MatchQ, |
| 29 | + TestID -> "DetectedMCPClients-ReturnShape@@Tests/SupportedClients.wlt:25,1-30,2" |
| 30 | +] |
| 31 | + |
| 32 | +(* ::**************************************************************************************************************:: *) |
| 33 | +(* ::Subsection::Closed:: *) |
| 34 | +(*All detected names are valid supported clients*) |
| 35 | +VerificationTest[ |
| 36 | + SubsetQ[ Keys @ $SupportedMCPClients, Keys @ DetectedMCPClients[ ] ], |
| 37 | + True, |
| 38 | + TestID -> "DetectedMCPClients-Subset@@Tests/SupportedClients.wlt:36,1-40,2" |
| 39 | +] |
| 40 | + |
| 41 | +(* ::**************************************************************************************************************:: *) |
| 42 | +(* ::Subsection::Closed:: *) |
| 43 | +(*Result preserves the ordering of $SupportedMCPClients*) |
| 44 | +VerificationTest[ |
| 45 | + With[ { detected = DetectedMCPClients[ ] }, |
| 46 | + Keys[ detected ] === Select[ Keys @ $SupportedMCPClients, KeyExistsQ[ detected, # ] & ] |
| 47 | + ], |
| 48 | + True, |
| 49 | + TestID -> "DetectedMCPClients-Ordering@@Tests/SupportedClients.wlt:46,1-50,2" |
| 50 | +] |
| 51 | + |
| 52 | +(* ::**************************************************************************************************************:: *) |
| 53 | +(* ::Subsection::Closed:: *) |
| 54 | +(*Invalid arguments*) |
| 55 | +VerificationTest[ |
| 56 | + DetectedMCPClients[ "bogus" ], |
| 57 | + _Failure, |
| 58 | + { DetectedMCPClients::InvalidArguments }, |
| 59 | + SameTest -> MatchQ, |
| 60 | + TestID -> "DetectedMCPClients-InvalidArguments@@Tests/SupportedClients.wlt:57,1-63,2" |
| 61 | +] |
0 commit comments