def test_patch_works(self):
        headers = {
            'Content-Type': 'application/json',
            'If-Match': '27f88f9749259b53ccaf48331074fa54d092e1cc'
        }
        data = {'state': 'UP'}

        backend = Backend()

        with HTTMock(response_patch):
            resp = backend.method_patch('http://alignakbackend.local/livehost/55d113976376e9835e1b2feb', ujson.dumps(data), headers)

        self.assertEqual({"_updated": "Wed, 19 Aug 2015 07:59:51 GMT", "_links": {"self": {"href": "livehost/55d113976376e9835e1b2feb", "title": "Livehost"}}, "_created": "Sun, 16 Aug 2015 22:49:59 GMT", "_status": "OK", "_id": "55d113976376e9835e1b2feb", "_etag": "fff582e398e47bce29e7317f25eb5068aaac3c4a"}, resp)
    def test_patch_etag_notok_notok(self):
        """
        Test Patch method with _etag not ok + 1 retry _etag not ok

        :return: None
        """

        headers = {
            'Content-Type': 'application/json',
            'If-Match': '27f88f9749259b53ccaf48331074fa54d092e1cd'
        }
        data = {'state': 'UP'}

        backend = Backend()

        with HTTMock(response_patch_notok):
            resp = backend.method_patch('http://alignakbackend.local/livehost/55d113976376e9835e1b2feb', ujson.dumps(data), headers)

        self.assertEqual('{}', resp)