Skip to content
This repository was archived by the owner on Aug 15, 2024. It is now read-only.

Commit f88e5bd

Browse files
committed
Fix python tests runner
1 parent 94f63f5 commit f88e5bd

File tree

1 file changed

+9
-1
lines changed
  • tools/snippet-testing/language_handler

1 file changed

+9
-1
lines changed

tools/snippet-testing/language_handler/python.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,15 @@ def self.run_before_test(directory)
1616
end
1717

1818
private
19-
19+
def text_with_custom_header(file_content)
20+
cert_path = ENV['FAKE_CERT_PATH']
21+
file_content.prepend(
22+
"import twilio.rest.resources.base\n"\
23+
"import sys\n"\
24+
"twilio.rest.resources.base.get_cert_file = lambda: '#{cert_path}'\n"\
25+
"sys.modules['twilio.rest.base.resources'] = twilio.rest.resources.base\n"
26+
)
27+
end
2028
def execute_command(file)
2129
command = bash_string_command(
2230
'source /usr/local/bin/virtualenvwrapper.sh &&'\

0 commit comments

Comments
 (0)