Skip to content

Commit fa793d0

Browse files
authored
[test][sdk] override fixture dir for SDK. (#3092)
1 parent 2a98280 commit fa793d0

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

tests/checks/common.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,17 +117,20 @@ def integration_name():
117117
raise Exception('No integration test file in stack')
118118

119119
@staticmethod
120-
def directory():
120+
def directory(sdk_dir=None):
121+
if sdk_dir:
122+
return os.path.join(sdk_dir, 'fixtures')
123+
121124
return os.path.join(os.path.dirname(__file__), 'fixtures',
122125
Fixtures.integration_name())
123126

124127
@staticmethod
125-
def file(file_name):
126-
return os.path.join(Fixtures.directory(), file_name)
128+
def file(file_name, sdk_dir=None):
129+
return os.path.join(Fixtures.directory(sdk_dir), file_name)
127130

128131
@staticmethod
129-
def read_file(file_name, string_escape=True):
130-
with open(Fixtures.file(file_name)) as f:
132+
def read_file(file_name, string_escape=True, sdk_dir=None):
133+
with open(Fixtures.file(file_name, sdk_dir)) as f:
131134
contents = f.read()
132135
if string_escape:
133136
contents = contents.decode('string-escape')

0 commit comments

Comments
 (0)