]>
git.ipfire.org Git - thirdparty/pdns.git/blob - regression-tests.api/test_Cache.py
6a3f618d51cf84686dafbeb5c83590009be2faf1
1 from test_helper
import ApiTestCase
, is_auth
, is_recursor
4 class Servers(ApiTestCase
):
7 r
= self
.session
.put(self
.url("/api/v1/servers/localhost/cache/flush?domain=example.org."))
8 self
.assert_success_json(r
)
10 self
.assertIn('count', data
)
12 def test_flush_root(self
):
13 r
= self
.session
.put(self
.url("/api/v1/servers/localhost/cache/flush?domain=."))
14 self
.assert_success_json(r
)
16 self
.assertIn('count', data
)
17 self
.assertEqual(data
['result'], 'Flushed cache.')
19 def test_flush_no_domain(self
):
21 self
.url("/api/v1/servers/localhost/cache/flush"))
22 self
.assertEquals(r
.status_code
, 422)
24 def test_flush_unqualified(self
):
26 self
.url("/api/v1/servers/localhost/cache/flush?domain=bar"))
27 self
.assertEquals(r
.status_code
, 422)