-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathtest_client.py
More file actions
35 lines (29 loc) · 1.15 KB
/
Copy pathtest_client.py
File metadata and controls
35 lines (29 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# -*- coding: utf-8 -*-
#
# PowerDNS web api python client and interface (python-powerdns)
#
# Copyright (C) 2018 Denis Pompilio (jawa) <denis.pompilio@gmail.com>
#
# This file is part of python-powerdns
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the MIT License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# MIT License for more details.
#
# You should have received a copy of the MIT License along with this
# program; if not, see <https://opensource.org/licenses/MIT>.
from unittest import TestCase
from . import API_CLIENT, PDNS_API, PDNS_KEY
class TestClient(TestCase):
def test_client_repr_and_str(self):
repr_str = "PDNSApiClient('%s', '%s', verify=False, timeout=None)" % (
PDNS_API, PDNS_KEY
)
self.assertEqual(repr(API_CLIENT), repr_str)
self.assertEqual(str(API_CLIENT), PDNS_API)
def test_client_full_uri(self):
self.assertIsInstance(API_CLIENT.get(PDNS_API + "/servers"), list)