blob: 4687bb356ccec4901584f24c6264a1dfc66293c1 [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
Matteo Scandolo67654fa2017-06-09 09:33:17 -070016import os
17
18# Constants
19OUTPUT_DIR = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + "/out/")
20
Zack Williams045b63d2019-01-22 16:30:57 -070021TMP_TARGET_PATH = os.path.join(OUTPUT_DIR, "tmp.xtarget")
Matteo Scandolo67654fa2017-06-09 09:33:17 -070022
Scott Baker1f7791d2018-10-04 13:21:20 -070023# Passed around in various security / validation checks
Zack Williams045b63d2019-01-22 16:30:57 -070024
25
Scott Baker1f7791d2018-10-04 13:21:20 -070026class FakeObject:
Matteo Scandolo67654fa2017-06-09 09:33:17 -070027 pass
28
Matteo Scandolo67654fa2017-06-09 09:33:17 -070029
Zack Williams045b63d2019-01-22 16:30:57 -070030class XProtoTestHelpers:
Matteo Scandolo67654fa2017-06-09 09:33:17 -070031 @staticmethod
32 def write_tmp_target(target):
Zack Williams045b63d2019-01-22 16:30:57 -070033 tmp_file = open(TMP_TARGET_PATH, "w")
Matteo Scandolo67654fa2017-06-09 09:33:17 -070034 tmp_file.write(target)
35 tmp_file.close()
36 return TMP_TARGET_PATH