The nova.tests.test_matchers Module

class TestDictListMatches(*args, **kwargs)

Bases: testtools.testcase.TestCase, testtools.tests.matchers.helpers.TestMatchersInterface

describe_examples = [('Length mismatch: len(L1)=2 != len(L2)=0', {}, <nova.tests.matchers.DictListMatches object at 0x22e3bdd0>), ('Dictionaries do not match at fluffy. d1: True d2: False', [{'foo': 'bar', 'baz': 'qoox', 'cat': {'fluffy': True, 'tabby': True}}, {'dog': 'yorkie'}], <nova.tests.matchers.DictListMatches object at 0x22e3bdd0>)]
matches_matcher = <nova.tests.matchers.DictListMatches object at 0x22e3bdd0>
matches_matches = [[{'foo': 'bar', 'baz': 'qoox', 'cat': {'fluffy': False, 'tabby': True}}, {'dog': 'yorkie'}], [{'foo': 'bar', 'baz': False, 'cat': {'fluffy': False, 'tabby': True}}, {'dog': 'yorkie'}]]
matches_mismatches = [[], {}, [{'foo': 'bar', 'baz': 'qoox', 'cat': {'fluffy': True, 'tabby': True}}, {'dog': 'yorkie'}], [{'foo': 'bar', 'baz': False, 'cat': {'fluffy': False, 'tabby': True}}, {'cat': 'yorkie'}], [{'foo': 'bop', 'baz': False, 'cat': {'fluffy': False, 'tabby': True}}, {'dog': 'yorkie'}]]
str_examples = [("DictListMatches([{'baz': 'DONTCARE', 'cat': {'fluffy': False, 'tabby': True}, 'foo': 'bar'},\n {'dog': 'yorkie'}])", <nova.tests.matchers.DictListMatches object at 0x22e3bdd0>)]
class TestDictMatches(*args, **kwargs)

Bases: testtools.testcase.TestCase, testtools.tests.matchers.helpers.TestMatchersInterface

describe_examples = [('Dictionaries do not match at fluffy. d1: False d2: True', {'foo': 'bar', 'baz': 'quux', 'cat': {'fluffy': True, 'tabby': True}}, <nova.tests.matchers.IsSubDictOf object at 0x2235ed90>), ('Dictionaries do not match at foo. d1: bar d2: bop', {'foo': 'bop', 'baz': 'quux', 'cat': {'fluffy': False, 'tabby': True}}, <nova.tests.matchers.IsSubDictOf object at 0x2235ed90>)]
matches_matcher = <nova.tests.matchers.IsSubDictOf object at 0x2235ed90>
matches_matches = [{'foo': 'bar', 'baz': 'noox', 'cat': {'fluffy': False, 'tabby': True}}, {'foo': 'bar', 'baz': 'quux'}]
matches_mismatches = [{'foo': 'bop', 'baz': 'qux', 'cat': {'fluffy': False, 'tabby': True}}, {'foo': 'bar', 'baz': 'quux', 'cat': {'fluffy': True, 'tabby': True}}, {'foo': 'bar', 'dog': None, 'cat': {'fluffy': False, 'tabby': True}}]
str_examples = [("IsSubDictOf({'foo': 'bar', 'baz': 'DONTCARE', 'cat': {'fluffy': False, 'tabby': True}})", <nova.tests.matchers.IsSubDictOf object at 0x2235ed90>)]
class TestXMLMatches(*args, **kwargs)

Bases: testtools.testcase.TestCase, testtools.tests.matchers.helpers.TestMatchersInterface

describe_examples = [("/root/text[1]: XML text value mismatch: expected text value: 'some other text here'; actual value: 'mismatch text'", '<?xml version="1.0"?>\n<root>\n <text>some text here</text>\n <text>mismatch text</text>\n <attrs key1="spam" key2="quux"/>\n <children>\n <child1>child 1</child1>\n <child2>child 2</child2>\n <child3>child 3</child3>\n </children>\n</root>', <nova.tests.matchers.XMLMatches object at 0x22e3a290>), ('/root/attrs[2]: XML attributes mismatch: keys only in expected: key2; keys only in actual: key3', '<?xml version="1.0"?>\n<root>\n <text>some text here</text>\n <text>some other text here</text>\n <attrs key1="spam" key3="quux"/>\n <children>\n <child1>child 1</child1>\n <child2>child 2</child2>\n <child3>child 3</child3>\n </children>\n</root>', <nova.tests.matchers.XMLMatches object at 0x22e3a290>), ("/root/attrs[2]: XML attribute value mismatch: expected value of attribute key1: 'spam'; actual value: 'quux'", '<?xml version="1.0"?>\n<root>\n <text>some text here</text>\n <text>some other text here</text>\n <attrs key1="quux" key2="quux"/>\n <children>\n <child1>child 1</child1>\n <child2>child 2</child2>\n <child3>child 3</child3>\n </children>\n</root>', <nova.tests.matchers.XMLMatches object at 0x22e3a290>), ('/root/children[3]: XML tag mismatch at index 1: expected tag <child2>; actual tag <child4>', '<?xml version="1.0"?>\n<root>\n <text>some text here</text>\n <text>some other text here</text>\n <attrs key1="spam" key2="quux"/>\n <children>\n <child1>child 1</child1>\n <child4>child 4</child4>\n <child2>child 2</child2>\n <child3>child 3</child3>\n </children>\n</root>', <nova.tests.matchers.XMLMatches object at 0x22e3a290>), ('/root/children[3]: XML expected child element <child3> not present at index 2', '<?xml version="1.0"?>\n<root>\n <text>some text here</text>\n <text>some other text here</text>\n <attrs key1="spam" key2="quux"/>\n <children>\n <child1>child 1</child1>\n <child2>child 2</child2>\n </children>\n</root>', <nova.tests.matchers.XMLMatches object at 0x22e3a290>), ('/root/children[3]: XML unexpected child element <child4> present at index 3', '<?xml version="1.0"?>\n<root>\n <text>some text here</text>\n <text>some other text here</text>\n <attrs key1="spam" key2="quux"/>\n <children>\n <child1>child 1</child1>\n <child2>child 2</child2>\n <child3>child 3</child3>\n <child4>child 4</child4>\n </children>\n</root>', <nova.tests.matchers.XMLMatches object at 0x22e3a290>)]
matches_matcher = <nova.tests.matchers.XMLMatches object at 0x22e3a290>
matches_matches = ['<?xml version="1.0"?>\n<root>\n <text>some text here</text>\n <text>some other text here</text>\n <attrs key2="spam" key1="spam"/>\n <children>\n <child1>child 1</child1>\n <child2>child 2</child2>\n <child3>child 3</child3>\n </children>\n</root>', '<?xml version="1.0"?>\n<root>\n <text>some text here</text>\n <text>some other text here</text>\n <attrs key1="spam" key2="quux"/>\n <children><child1>child 1</child1>\n<child2>child 2</child2>\n<child3>blah</child3>\n </children>\n</root>']
matches_mismatches = ['<?xml version="1.0"?>\n<root>\n <text>some text here</text>\n <text>mismatch text</text>\n <attrs key1="spam" key2="quux"/>\n <children>\n <child1>child 1</child1>\n <child2>child 2</child2>\n <child3>child 3</child3>\n </children>\n</root>', '<?xml version="1.0"?>\n<root>\n <text>some text here</text>\n <text>some other text here</text>\n <attrs key1="spam" key3="quux"/>\n <children>\n <child1>child 1</child1>\n <child2>child 2</child2>\n <child3>child 3</child3>\n </children>\n</root>', '<?xml version="1.0"?>\n<root>\n <text>some text here</text>\n <text>some other text here</text>\n <attrs key1="quux" key2="quux"/>\n <children>\n <child1>child 1</child1>\n <child2>child 2</child2>\n <child3>child 3</child3>\n </children>\n</root>', '<?xml version="1.0"?>\n<root>\n <text>some text here</text>\n <text>some other text here</text>\n <attrs key1="spam" key2="quux"/>\n <children>\n <child1>child 1</child1>\n <child4>child 4</child4>\n <child2>child 2</child2>\n <child3>child 3</child3>\n </children>\n</root>', '<?xml version="1.0"?>\n<root>\n <text>some text here</text>\n <text>some other text here</text>\n <attrs key1="spam" key2="quux"/>\n <children>\n <child1>child 1</child1>\n <child2>child 2</child2>\n </children>\n</root>', '<?xml version="1.0"?>\n<root>\n <text>some text here</text>\n <text>some other text here</text>\n <attrs key1="spam" key2="quux"/>\n <children>\n <child1>child 1</child1>\n <child2>child 2</child2>\n <child3>child 3</child3>\n <child4>child 4</child4>\n </children>\n</root>']
str_examples = [('XMLMatches(\'<?xml version="1.0"?>\\n<root>\\n <text>some text here</text>\\n <text>some other text here</text>\\n <attrs key1="spam" key2="DONTCARE"/>\\n <children>\\n <!--This is a comment-->\\n <child1>child 1</child1>\\n <child2>child 2</child2>\\n <child3>DONTCARE</child3>\\n <?spam processing instruction?>\\n </children>\\n</root>\')', <nova.tests.matchers.XMLMatches object at 0x22e3a290>)]

Previous topic

The nova.tests.test_loadables Module

Next topic

The nova.tests.test_metadata Module

This Page