4 # ==================================================================================
5 # Copyright (c) 2019-2020 Nokia
6 # Copyright (c) 2018-2020 AT&T Intellectual Property.
8 # Licensed under the Apache License, Version 2.0 (the "License");
9 # you may not use this file except in compliance with the License.
10 # You may obtain a copy of the License at
12 # http://www.apache.org/licenses/LICENSE-2.0
14 # Unless required by applicable law or agreed to in writing, software
15 # distributed under the License is distributed on an "AS IS" BASIS,
16 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 # See the License for the specific language governing permissions and
18 # limitations under the License.
19 # ==================================================================================
20 from ricxappframe.xapp_sdl import SDLWrapper
28 test raw sdl functions
30 sdl = SDLWrapper(use_fake_sdl=True)
31 sdl.set(NS, "as.df1", "data")
32 sdl.set(NS, "as.df2", "data2")
33 assert sdl.get(NS, "as.df1") == "data"
34 assert sdl.get(NS, "as.df2") == "data2"
35 assert sdl.find_and_get(NS, "as.df1") == {"as.df1": "data"}
36 assert sdl.find_and_get(NS, "as.df2") == {"as.df2": "data2"}
37 assert sdl.find_and_get(NS, "as.df") == {"as.df1": "data", "as.df2": "data2"}
38 assert sdl.find_and_get(NS, "as.d") == {"as.df1": "data", "as.df2": "data2"}
39 assert sdl.find_and_get(NS, "as.") == {"as.df1": "data", "as.df2": "data2"}
40 assert sdl.find_and_get(NS, "asd") == {}
43 sdl.delete(NS, "as.df1")
44 assert sdl.get(NS, "as.df1") is None
45 assert sdl.get(NS, "as.df2") == "data2"
48 sdl.delete(NS, "as.df2")
49 assert sdl.get(NS, "as.df2") is None
51 assert sdl.find_and_get(NS, "as.df") == {}
52 assert sdl.find_and_get(NS, "") == {}