parsers/stanza_error: fix tests behind 'component' feature
Signed-off-by: pep <pep@bouah.net>
This commit is contained in:
parent
061ccecb3f
commit
7d47173318
2 changed files with 18 additions and 0 deletions
|
|
@ -122,6 +122,7 @@ XXXX-YY-ZZ RELEASER <admin@example.com>
|
|||
- Fix compatibility to uuid 1.12
|
||||
- Implement Default for Tune
|
||||
- Re-export xso::error::FromElementError.
|
||||
- Fix a few tests behind 'component' feature
|
||||
|
||||
Version 0.21.0:
|
||||
2024-07-25 Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
|
||||
|
|
|
|||
|
|
@ -375,9 +375,17 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn test_error_code() {
|
||||
#[cfg(not(feature = "component"))]
|
||||
let elem: Element = r#"<error code="501" type="cancel" xmlns='jabber:client'>
|
||||
<feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
|
||||
<text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>The feature requested is not implemented by the recipient or server and therefore cannot be processed.</text>
|
||||
</error>"#
|
||||
.parse()
|
||||
.unwrap();
|
||||
#[cfg(feature = "component")]
|
||||
let elem: Element = r#"<error code="501" type="cancel" xmlns='jabber:component:accept'>
|
||||
<feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
|
||||
<text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>The feature requested is not implemented by the recipient or server and therefore cannot be processed.</text>
|
||||
</error>"#
|
||||
.parse()
|
||||
.unwrap();
|
||||
|
|
@ -387,10 +395,19 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn test_error_multiple_text() {
|
||||
#[cfg(not(feature = "component"))]
|
||||
let elem: Element = r#"<error type="cancel" xmlns='jabber:client'>
|
||||
<item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
|
||||
<text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas' xml:lang="fr">Nœud non trouvé</text>
|
||||
<text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas' xml:lang="en">Node not found</text>
|
||||
</error>"#
|
||||
.parse()
|
||||
.unwrap();
|
||||
#[cfg(feature = "component")]
|
||||
let elem: Element = r#"<error type="cancel" xmlns='jabber:component:accept'>
|
||||
<item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
|
||||
<text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas' xml:lang="fr">Nœud non trouvé</text>
|
||||
<text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas' xml:lang="en">Node not found</text>
|
||||
</error>"#
|
||||
.parse()
|
||||
.unwrap();
|
||||
|
|
|
|||
Loading…
Reference in a new issue