'Test alter retention policy for TestInfluxDBClient object.'

def test_alter_retention_policy(self):

    example_response = u'{"results":[{}]}'
    with requests_mock.Mocker() as m:
        m.register_uri(requests_mock.GET, u'http://localhost:8086/query', text=example_response)
        self.cli.alter_retention_policy(u'somename', u'db', duration=u'4d')
        self.assertEqual(m.last_request.qs[u'q'][0], u'alter    retention    policy    "somename"    on    "db"    duration    4d')
        self.cli.alter_retention_policy(u'somename', u'db', replication=4)
        self.assertEqual(m.last_request.qs[u'q'][0], u'alter    retention    policy    "somename"    on    "db"    replication    4')
        self.cli.alter_retention_policy(u'somename', u'db', default=True)
        self.assertEqual(m.last_request.qs[u'q'][0], u'alter    retention    policy    "somename"    on    "db"    default')
