blob: 232cae18c9197ca047910e1de5e68c9e6ddb7e74 [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
24# Store in this class the args to pass at the generator
25class FakeArgs:
26 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