@@ -203,13 +203,13 @@ def test_graalpy_template(self):
203
203
test_file_path = os .path .join (work_dir , test_file )
204
204
self .addLocalMavenRepo (test_file_path )
205
205
206
- tested_code = "print (f\' This is test text and result is {123456789 * 1000}\' )"
207
- expected_text = "This is test text and result is 123456789000"
206
+ tested_code = "from termcolor import colored; print(colored('hello java', 'red', attrs=['reverse', 'blink']))"
208
207
command = [JBANG_CMD , "--verbose" , test_file_path , tested_code ]
209
208
out , result = run_cmd (command )
210
209
211
210
self .assertTrue (result == 0 , f"Execution failed with code { result } \n command: { command } \n stdout: { out } \n " )
212
- self .assertTrue (expected_text in out , f"Expected text:\n { expected_text } \n but in stdout was:\n { out } " )
211
+ self .assertTrue ("Successfully installed termcolor" in out , f"Expected text:\n Successfully installed termcolor\n but in stdout was:\n { out } " )
212
+ self .assertTrue ("hello java" in out , f"Expected text:\n hello java\n but in stdout was:\n { out } " )
213
213
214
214
@unittest .skipUnless (is_enabled , "ENABLE_JBANG_INTEGRATION_UNITTESTS is not true" )
215
215
@unittest .skipUnless ('win32' not in sys .platform , "Currently the jbang native image on Win gate fails." )
@@ -227,13 +227,13 @@ def test_graalpy_template_native(self):
227
227
228
228
test_file_path = os .path .join (work_dir , test_file )
229
229
self .addLocalMavenRepo (test_file_path )
230
- tested_code = "print (f\' This is test text and result is {147258369 * 1000}\' )"
231
- expected_text = "This is test text and result is 147258369000"
230
+ tested_code = "from termcolor import colored; print(colored('hello java', 'red', attrs=['reverse', 'blink']))"
232
231
command = [JBANG_CMD , "--verbose" , "--native" , test_file_path , tested_code ]
233
232
out , result = run_cmd (command )
234
233
235
234
self .assertTrue (result == 0 , f"Execution failed with code { result } \n command: { command } \n stdout: { out } " )
236
- self .assertTrue (expected_text in out , f"Expected text:\n { expected_text } \n but in stdout was:\n { out } " )
235
+ self .assertTrue ("Successfully installed termcolor" in out , f"Expected text:\n Successfully installed termcolor" )
236
+ self .assertTrue ("hello java" in out , f"Expected text:\n hello java\n but in stdout was:\n { out } " )
237
237
238
238
239
239
@unittest .skipUnless (is_enabled , "ENABLE_JBANG_INTEGRATION_UNITTESTS is not true" )
@@ -248,13 +248,13 @@ def test_graalpy_local_repo_template(self):
248
248
self .assertTrue (result == 0 , f"Creating template { template_name } failed" )
249
249
250
250
test_file_path = os .path .join (work_dir , test_file )
251
- tested_code = "print (f\' This is test text and result is {987654321 * 1000}\' )"
252
- expected_text = "This is test text and result is 987654321000"
251
+ tested_code = "from termcolor import colored; print(colored('hello java', 'red', attrs=['reverse', 'blink']))"
253
252
command = [JBANG_CMD , "--verbose" , test_file_path , tested_code ]
254
253
out , result = run_cmd (command )
255
254
256
255
self .assertTrue (result == 0 , f"Execution failed with code { result } \n command: { command } \n stdout: { out } " )
257
- self .assertTrue (expected_text in out , f"Expected text:\n { expected_text } \n but in stdout was:\n { out } " )
256
+ self .assertTrue ("Successfully installed termcolor" in out , f"Expected text:\n Successfully installed termcolor" )
257
+ self .assertTrue ("hello java" in out , f"Expected text:\n hello java\n but in stdout was:\n { out } " )
258
258
259
259
260
260
unittest .skip_deselected_test_functions (globals ())
0 commit comments