From 1e05b9e61c24d90cc93d4507832e45a8036b6d33 Mon Sep 17 00:00:00 2001 From: Adam Spiers Date: Mon, 5 Aug 2019 15:30:26 +0100 Subject: [PATCH] Allow assertXmlEqual() to pass options to matchers.XMLMatches matchers.XMLMatches supports three options: - allow_mixed_nodes - skip_empty_text_nodes - skip_values However these are not accessible when using the matcher via assertXmlEqual(). So extend the latter with an *options dictionary to allow options to be passed through. This will be used by another commit in the SEV series in the near future which needs the allow_mixed_nodes option to be enabled to compare XML fragments with elements in different orders. blueprint: amd-sev-libvirt-support Change-Id: I31c60771891c3a2eb06fbc780ba2d369465498ec --- nova/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nova/test.py b/nova/test.py index 812ff435dce8..881718b30390 100644 --- a/nova/test.py +++ b/nova/test.py @@ -586,8 +586,8 @@ class TestCase(testtools.TestCase): error.difference = difference raise error - def assertXmlEqual(self, expected, observed): - self.assertThat(observed, matchers.XMLMatches(expected)) + def assertXmlEqual(self, expected, observed, **options): + self.assertThat(observed, matchers.XMLMatches(expected, **options)) def assertPublicAPISignatures(self, baseinst, inst): def get_public_apis(inst):