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
This commit is contained in:
Adam Spiers 2019-08-05 15:30:26 +01:00
parent 872a823d9a
commit 1e05b9e61c
1 changed files with 2 additions and 2 deletions

View File

@ -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):