MCPcopy Create free account
hub / github.com/crewjam/saml / mustFindElement

Function mustFindElement

element_to_bytes_test.go:12–19  ·  view source on GitHub ↗
(t *testing.T, xmlStr, path string)

Source from the content-addressed store, hash-verified

10)
11
12func mustFindElement(t *testing.T, xmlStr, path string) *etree.Element {
13 t.Helper()
14 doc := etree.NewDocument()
15 assert.Check(t, doc.ReadFromString(xmlStr))
16 el := doc.FindElement(path)
17 assert.Assert(t, el != nil, "cannot find %s", path)
18 return el
19}
20
21// The serialized element must be well-formed XML on its own: every prefix
22// it uses has to be declared, and the default namespace must be written as

Calls

no outgoing calls

Tested by

no test coverage detected