'Test wrong login reply.'

@mock.patch.object(requests, 'request', FakeRequests)
def test_wrong_login_reply(self):

    RUNTIME_VARS['login'] = '<hash>\n                                                                                <access-key>%s</access-key>\n                                                                                <status    type="integer">0</status>\n                                                                </hash>'
    self.assertRaises(exception.MalformedResponse, self.driver.do_setup, None)
    RUNTIME_VARS['login'] = '\n                                                <hash>\n                                                                <user>\n                                                                                <updated-at    type="datetime">2012-04-30...</updated-at>\n                                                                                <id    type="integer">1</id>\n                                                                                <created-at    type="datetime">2012-02-21...</created-at>\n                                                                                <email>jsmith@example.com</email>\n                                                                                <username>jsmith</username>\n                                                                </user>\n                                                                <access-key>%s</access-key>\n                                                                <status    type="integer">0</status>\n                                                </hash>'
    self.assertRaises(exception.MalformedResponse, self.driver.do_setup, None)
