blob: ae52076eb767f3284606abe9625d51e8171f3ca3 [file] [log] [blame]
Matteo Scandolod2044a42017-08-07 16:08:28 -07001
2# Copyright 2017-present Open Networking Foundation
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
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
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
16
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
22TMP_TARGET_PATH = os.path.join(OUTPUT_DIR, 'tmp.xtarget')
23
Scott Baker1f7791d2018-10-04 13:21:20 -070024# Passed around in various security / validation checks
25class FakeObject:
Matteo Scandolo67654fa2017-06-09 09:33:17 -070026 pass
27
28class XProtoTestHelpers:
29
30 @staticmethod
31 def write_tmp_target(target):
32 tmp_file = open(TMP_TARGET_PATH, 'w')
33 tmp_file.write(target)
34 tmp_file.close()
35 return TMP_TARGET_PATH
36