1 # ============LICENSE_START=======================================================
2 # Copyright (c) 2021 AT&T Intellectual Property. All rights reserved.
3 # ================================================================================
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 # ============LICENSE_END=========================================================
17 import pytest, json, sys, logging, logging.config
18 from policysync.cmd import Config, main, parsecmd
19 import policysync.coroutines
23 def test_parse_args(self):
41 assert c.filters == ["blah"]
42 assert c.check_period == 60
43 assert c.out_file == "out"
45 def test_parse_args_no_auth(self):
47 ["--out", "out", "--pdp-url", "blah", "--duration", "60", "--filters", "[blah]"]
50 assert c.client.pdp_url == "blah"
51 assert c.filters == ["blah"]
52 assert c.check_period == 60
53 assert c.out_file == "out"
55 def test_parse_args_no_pdp(self):
57 with pytest.raises(ValueError):
60 def test_parse_bad_bind(self):
78 with pytest.raises(ValueError):