FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-libjuju/tests/unit/test_proxy.py at master · Maxcode123/python-libjuju · GitHub
Maxcode123
python-libjuju
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-libjuju
/
tests
/
unit
/
test_proxy.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
49 lines (41 loc) · 1.46 KB
Breadcrumbs
python-libjuju
/
tests
/
unit
/
test_proxy.py
Copy path
File metadata and controls
49 lines (41 loc) · 1.46 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import
unittest
from
juju
.
client
.
proxy
.
factory
import
proxy_from_config
from
juju
.
client
.
proxy
.
kubernetes
.
proxy
import
KubernetesProxy
class
TestJujuDataFactory
(
unittest
.
TestCase
):
def
test_proxy_from_config_unknown_type
(
self
):
"""
Test that a unknown proxy type results in a UnknownProxyTypeError
exception
"""
self
.
assertRaises
(
ValueError
,
proxy_from_config
, {
"config"
: {},
"type"
:
"does-not-exists"
,
})
def
test_proxy_from_config_missing_type
(
self
):
"""
Test that a nil proxy type returns None
"""
self
.
assertIsNone
(
proxy_from_config
({
"config"
: {},
}))
def
test_proxy_from_config_non_arg
(
self
):
"""
Tests that providing an empty proxy config results in a None proxy
"""
self
.
assertIsNone
(
proxy_from_config
(
None
))
def
test_proxy_from_config_kubernetes
(
self
):
"""
Tests that a Kubernetes proxy is correctly created from config
"""
proxy
=
proxy_from_config
({
"type"
:
"kubernetes-port-forward"
,
"config"
: {
"api-host"
:
"https://localhost:8456"
,
"namespace"
:
"controller-python-test"
,
"remote-port"
:
"1234"
,
"service"
:
"controller"
,
"service-account-token"
:
"==AA"
,
"ca-cert"
:
"==AA"
,
},
})
self
.
assertIs
(
type
(
proxy
),
KubernetesProxy
)
Back
|
FazBrowse Home
|
New Git URL