Beispiel #1
0
 def test_should_throw_network_error_if_host_not_reachable(
     self, mocked_call, mock_requests_post
 ):
     with pytest.raises(exceptions.WABizNetworkError):
         client = WABizAPI(**self.MOCK_COMPLETE_CONFIG)
         client.get_support_info()
         assert mocked_call.call_count == 1
Beispiel #2
0
 def test_should_not_throw_network_error_if_host_reachable(
     self, mocked_call, mock_requests_post
 ):
     try:
         client = WABizAPI(**self.MOCK_COMPLETE_CONFIG)
         support_info = client.get_support_info()
         assert mocked_call.call_count == 1
         assert "support" in support_info
     except Exception as e:
         pytest.fail(e)
Beispiel #3
0
def get_support_info():
    support_info_filename = os.path.join(OUTPUT_FOLDER, SUPPORT_INFO_LOG_FILE)
    try:
        config = Config().values
        if config:
            api = WABizAPI(**config.get("webapp"))
            support_info_content = api.get_support_info()
        else:
            return
    except Exception:
        return

    docker_utils.write_to_file(support_info_filename,
                               json.dumps(support_info_content, indent=2))
    return support_info_filename