blob: d1ad5440b40827e3a133d6272cc1af2e16c0e51d [file] [log] [blame]
DR695H303fda12019-09-19 12:24:38 -04001# Copyright 2019 AT&T Intellectual Property. All rights reserved.
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
15import requests_mock
16from unittest import TestCase
17from unittest import main
18
19from ONAPLibrary.SO import SO
20
21
22class SOTests(TestCase):
23
24 def test_get(self):
25 with requests_mock.mock() as m:
26 so = SO()
27 m.get('http://test.com/', text='data')
28 resp = so.run_get_request(endpoint="http://test.com", data_path="/",
29 accept="application/json", auth={"user", "pass"})
30 self.assertEqual("data", resp.text)
31
32 if __name__ == '__main__':
33 main()