File tree Expand file tree Collapse file tree 2 files changed +35
-30
lines changed Expand file tree Collapse file tree 2 files changed +35
-30
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ # Copyright 2019 The Kubernetes Authors.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ from asynctest import CoroutineMock , TestCase
16
+
17
+ from kubernetes_asyncio .utils import create_from_yaml
18
+
19
+
20
+ class CreateFromYamlTest (TestCase ):
21
+
22
+ async def test_create_from_yaml (self ):
23
+ api_client = CoroutineMock ()
24
+ api_client .call_api = CoroutineMock ()
25
+
26
+ await create_from_yaml (api_client , 'examples/nginx-deployment.yaml' )
27
+
28
+ # simple check for api call
29
+ self .assertEqual (api_client .call_api .call_args [0 ][0 ],
30
+ '/apis/extensions/v1beta1/namespaces/{namespace}/deployments' )
31
+
32
+
33
+ if __name__ == '__main__' :
34
+ import asynctest
35
+ asynctest .main ()
You can’t perform that action at this time.
0 commit comments