blob: e6d87abf563fb2085cdd5da8c8c826d8008bafe6 [file] [log] [blame]
Matteo Scandolod2044a42017-08-07 16:08:28 -07001# Copyright 2017-present Open Networking Foundation
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
Zack Williams9a42f872019-02-15 17:56:04 -070016from __future__ import absolute_import
Matteo Scandolo67654fa2017-06-09 09:33:17 -070017import os
18
19# Constants
20OUTPUT_DIR = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + "/out/")
21
Zack Williams045b63d2019-01-22 16:30:57 -070022TMP_TARGET_PATH = os.path.join(OUTPUT_DIR, "tmp.xtarget")
Matteo Scandolo67654fa2017-06-09 09:33:17 -070023
Scott Baker1f7791d2018-10-04 13:21:20 -070024# Passed around in various security / validation checks
Zack Williams045b63d2019-01-22 16:30:57 -070025
26
Scott Baker1f7791d2018-10-04 13:21:20 -070027class FakeObject:
Matteo Scandolo67654fa2017-06-09 09:33:17 -070028 pass
29
Matteo Scandolo67654fa2017-06-09 09:33:17 -070030
Zack Williams045b63d2019-01-22 16:30:57 -070031class XProtoTestHelpers:
Matteo Scandolo67654fa2017-06-09 09:33:17 -070032 @staticmethod
33 def write_tmp_target(target):
Zack Williams045b63d2019-01-22 16:30:57 -070034 tmp_file = open(TMP_TARGET_PATH, "w")
Matteo Scandolo67654fa2017-06-09 09:33:17 -070035 tmp_file.write(target)
36 tmp_file.close()
37 return TMP_TARGET_PATH