def test_namespace_match(self): assert_that(self.get_stubo_request(body='<user:find xmlns:user="******"><me>hello</me></user:find>'), body_xpath('/user:find/me', {'user' : "http://www.my.com/userschema"})) assert_that(self.get_stubo_request(body='<user:find xmlns:user="******"><me>hello</me></user:find>'), body_xpath('//user:find/me', {'user' : "http://www.my.com/userschema"}))
def test_failure(self): assert_that(self.get_stubo_request(body='<findx><me>hello</me></findx>'), is_not(body_xpath('/find/me'))) assert_that(self.get_stubo_request(body='<findx><me>hello</me></findx>'), is_not(body_xpath('//find/me')))
def test_match(self): assert_that(self.get_stubo_request(body='<find><me>hello</me></find>'), body_xpath('/find/me')) assert_that(self.get_stubo_request(body='<find><me>hello</me></find>'), body_xpath('//find/me'))