How to use test_import method in wpt

Best JavaScript code snippet using wpt

test_create_upload.py

Source:test_create_upload.py Github

copy

Full Screen

1from castoredc_api.importer.helpers import read_excel, create_upload2class TestCreateUpload:3 """Tests the helper functions for creation of the uploading dataframe."""4 def test_create_upload_study_values_success(self, import_study):5 """Tests if creating the to_upload dataframe works for value data"""6 to_upload = create_upload(7 path_to_upload="tests/test_import/data_files_for_import_tests/data_file_study_values.xlsx",8 path_to_col_link="tests/test_import/link_files_for_import_tests/study_link_file.xlsx",9 path_to_translation=None,10 path_to_merge=None,11 label_data=False,12 study=import_study,13 format_options={14 "date": "%d-%m-%Y",15 "datetime": "%d-%m-%Y;%H:%M",16 "time": "%H:%M",17 },18 target=None,19 target_name=None,20 )21 comparison = read_excel(22 "tests/test_import/data_files_for_import_tests/data_file_study_final.xlsx"23 )24 assert to_upload.equals(comparison)25 def test_create_upload_study_labels_success(self, import_study):26 """Tests if creating the to_upload dataframe works for label data"""27 to_upload = create_upload(28 path_to_upload="tests/test_import/data_files_for_import_tests/data_file_study_labels.xlsx",29 path_to_col_link="tests/test_import/link_files_for_import_tests/study_link_file.xlsx",30 path_to_translation=None,31 path_to_merge=None,32 label_data=True,33 study=import_study,34 format_options={35 "date": "%d-%m-%Y",36 "datetime": "%d-%m-%Y;%H:%M",37 "time": "%H:%M",38 },39 target=None,40 target_name=None,41 )42 comparison = read_excel(43 "tests/test_import/data_files_for_import_tests/data_file_study_final.xlsx"44 )45 assert to_upload.equals(comparison)46 def test_create_upload_study_values_missings(self, import_study):47 """Tests if creating the to_upload dataframe works for value data with missings"""48 to_upload = create_upload(49 path_to_upload="tests/test_import/data_files_for_import_tests/data_file_study_values_missings.xlsx",50 path_to_col_link="tests/test_import/link_files_for_import_tests/study_link_file.xlsx",51 path_to_translation=None,52 path_to_merge=None,53 label_data=False,54 study=import_study,55 format_options={56 "date": "%d-%m-%Y",57 "datetime": "%d-%m-%Y;%H:%M",58 "time": "%H:%M",59 },60 target=None,61 target_name=None,62 )63 comparison = read_excel(64 "tests/test_import/data_files_for_import_tests/data_file_study_final_missings.xlsx"65 )66 assert to_upload.equals(comparison)67 def test_create_upload_study_labels_missings(self, import_study):68 """Tests if creating the to_upload dataframe works for label data with missings"""69 to_upload = create_upload(70 path_to_upload="tests/test_import/data_files_for_import_tests/data_file_study_labels_missings.xlsx",71 path_to_col_link="tests/test_import/link_files_for_import_tests/study_link_file.xlsx",72 path_to_translation=None,73 path_to_merge=None,74 label_data=True,75 study=import_study,76 format_options={77 "date": "%d-%m-%Y",78 "datetime": "%d-%m-%Y;%H:%M",79 "time": "%H:%M",80 },81 target=None,82 target_name=None,83 )84 comparison = read_excel(85 "tests/test_import/data_files_for_import_tests/data_file_study_final_missings.xlsx"86 )87 assert to_upload.equals(comparison)88 def test_create_upload_study_values_errors(self, import_study):89 """Tests if creating the to_upload dataframe works for value data with errors"""90 to_upload = create_upload(91 path_to_upload="tests/test_import/data_files_for_import_tests/data_file_study_values_errors.xlsx",92 path_to_col_link="tests/test_import/link_files_for_import_tests/study_link_file.xlsx",93 path_to_translation=None,94 path_to_merge=None,95 label_data=False,96 study=import_study,97 format_options={98 "date": "%d-%m-%Y",99 "datetime": "%d-%m-%Y;%H:%M",100 "time": "%H:%M",101 },102 target=None,103 target_name=None,104 )105 comparison = read_excel(106 "tests/test_import/data_files_for_import_tests/data_file_study_final_errors.xlsx"107 )108 assert to_upload.equals(comparison)109 def test_create_upload_study_labels_errors(self, import_study):110 """Tests if creating the to_upload dataframe works for label data with errors"""111 to_upload = create_upload(112 path_to_upload="tests/test_import/data_files_for_import_tests/data_file_study_labels_errors.xlsx",113 path_to_col_link="tests/test_import/link_files_for_import_tests/study_link_file.xlsx",114 path_to_translation=None,115 path_to_merge=None,116 label_data=True,117 study=import_study,118 format_options={119 "date": "%d-%m-%Y",120 "datetime": "%d-%m-%Y;%H:%M",121 "time": "%H:%M",122 },123 target=None,124 target_name=None,125 )126 comparison = read_excel(127 "tests/test_import/data_files_for_import_tests/data_file_study_final_errors.xlsx"128 )129 assert to_upload.equals(comparison)130 def test_create_upload_report_medication_values_success(self, import_study):131 """Tests if creating the to_upload dataframe works for report data with dependencies"""132 to_upload = create_upload(133 path_to_upload="tests/test_import/data_files_for_import_tests/data_file_report_medication_values.xlsx",134 path_to_col_link="tests/test_import/link_files_for_import_tests/report_link_file.xlsx",135 path_to_translation=None,136 path_to_merge=None,137 label_data=False,138 study=import_study,139 format_options={140 "date": "%d-%m-%Y",141 "datetime": "%d-%m-%Y;%H:%M",142 "time": "%H:%M",143 },144 target=None,145 target_name=None,146 )147 comparison = read_excel(148 "tests/test_import/data_files_for_import_tests/data_file_report_medication_final.xlsx"149 )150 assert to_upload.equals(comparison)151 def test_create_upload_report_medication_labels_success(self, import_study):152 """Tests if creating the to_upload dataframe works for report data with dependencies"""153 to_upload = create_upload(154 path_to_upload="tests/test_import/data_files_for_import_tests/data_file_report_medication_labels.xlsx",155 path_to_col_link="tests/test_import/link_files_for_import_tests/report_link_file.xlsx",156 path_to_translation=None,157 path_to_merge=None,158 label_data=True,159 study=import_study,160 format_options={161 "date": "%d-%m-%Y",162 "datetime": "%d-%m-%Y;%H:%M",163 "time": "%H:%M",164 },165 target=None,166 target_name=None,167 )168 comparison = read_excel(169 "tests/test_import/data_files_for_import_tests/data_file_report_medication_final.xlsx"170 )171 assert to_upload.equals(comparison)172 def test_create_upload_report_medication_values_missings(self, import_study):173 """Tests if creating the to_upload dataframe works for report data with dependencies and missings"""174 to_upload = create_upload(175 path_to_upload="tests/test_import/data_files_for_import_tests/data_file_report_medication_values_missings.xlsx",176 path_to_col_link="tests/test_import/link_files_for_import_tests/report_link_file.xlsx",177 path_to_translation=None,178 path_to_merge=None,179 label_data=False,180 study=import_study,181 format_options={182 "date": "%d-%m-%Y",183 "datetime": "%d-%m-%Y;%H:%M",184 "time": "%H:%M",185 },186 target=None,187 target_name=None,188 )189 comparison = read_excel(190 "tests/test_import/data_files_for_import_tests/data_file_report_medication_final_missings.xlsx"191 )192 assert to_upload.equals(comparison)193 def test_create_upload_report_medication_labels_missings(self, import_study):194 """Tests if creating the to_upload dataframe works for report data with dependencies and missings"""195 to_upload = create_upload(196 path_to_upload="tests/test_import/data_files_for_import_tests/data_file_report_medication_labels_missings.xlsx",197 path_to_col_link="tests/test_import/link_files_for_import_tests/report_link_file.xlsx",198 path_to_translation=None,199 path_to_merge=None,200 label_data=True,201 study=import_study,202 format_options={203 "date": "%d-%m-%Y",204 "datetime": "%d-%m-%Y;%H:%M",205 "time": "%H:%M",206 },207 target=None,208 target_name=None,209 )210 comparison = read_excel(211 "tests/test_import/data_files_for_import_tests/data_file_report_medication_final_missings.xlsx"212 )213 assert to_upload.equals(comparison)214 def test_create_upload_report_medication_values_errors(self, import_study):215 """Tests if creating the to_upload dataframe works for report data with dependencies and errors"""216 to_upload = create_upload(217 path_to_upload="tests/test_import/data_files_for_import_tests/data_file_report_medication_values_errors.xlsx",218 path_to_col_link="tests/test_import/link_files_for_import_tests/report_link_file.xlsx",219 path_to_translation=None,220 path_to_merge=None,221 label_data=False,222 study=import_study,223 format_options={224 "date": "%d-%m-%Y",225 "datetime": "%d-%m-%Y;%H:%M",226 "time": "%H:%M",227 },228 target=None,229 target_name=None,230 )231 comparison = read_excel(232 "tests/test_import/data_files_for_import_tests/data_file_report_medication_final_errors.xlsx"233 )234 assert to_upload.equals(comparison)235 def test_create_upload_report_medication_labels_errors(self, import_study):236 """Tests if creating the to_upload dataframe works for report data with dependencies and errors"""237 to_upload = create_upload(238 path_to_upload="tests/test_import/data_files_for_import_tests/data_file_report_medication_labels_errors.xlsx",239 path_to_col_link="tests/test_import/link_files_for_import_tests/report_link_file.xlsx",240 path_to_translation=None,241 path_to_merge=None,242 label_data=False,243 study=import_study,244 format_options={245 "date": "%d-%m-%Y",246 "datetime": "%d-%m-%Y;%H:%M",247 "time": "%H:%M",248 },249 target=None,250 target_name=None,251 )252 comparison = read_excel(253 "tests/test_import/data_files_for_import_tests/data_file_report_medication_final_errors.xlsx"254 )255 assert to_upload.equals(comparison)256 def test_create_upload_survey_values_success(self, import_study):257 """Tests if creating the to_upload dataframe works for value data"""258 to_upload = create_upload(259 path_to_upload="tests/test_import/data_files_for_import_tests/data_file_survey_values.xlsx",260 path_to_col_link="tests/test_import/link_files_for_import_tests/survey_link_file.xlsx",261 path_to_translation=None,262 path_to_merge=None,263 label_data=False,264 study=import_study,265 format_options={266 "date": "%d-%m-%Y",267 "datetime": "%d-%m-%Y;%H:%M",268 "time": "%H:%M",269 },270 target=None,271 target_name=None,272 )273 comparison = read_excel(274 "tests/test_import/data_files_for_import_tests/data_file_survey_final.xlsx"275 )276 assert to_upload.equals(comparison)277 def test_create_upload_survey_labels_success(self, import_study):278 """Tests if creating the to_upload dataframe works for label data"""279 to_upload = create_upload(280 path_to_upload="tests/test_import/data_files_for_import_tests/data_file_survey_labels.xlsx",281 path_to_col_link="tests/test_import/link_files_for_import_tests/survey_link_file.xlsx",282 path_to_translation=None,283 path_to_merge=None,284 label_data=True,285 study=import_study,286 format_options={287 "date": "%d-%m-%Y",288 "datetime": "%d-%m-%Y;%H:%M",289 "time": "%H:%M",290 },291 target=None,292 target_name=None,293 )294 comparison = read_excel(295 "tests/test_import/data_files_for_import_tests/data_file_survey_final.xlsx"296 )297 assert to_upload.equals(comparison)298 def test_create_upload_survey_values_missings(self, import_study):299 """Tests if creating the to_upload dataframe works for value data with missings"""300 to_upload = create_upload(301 path_to_upload="tests/test_import/data_files_for_import_tests/data_file_survey_values_missings.xlsx",302 path_to_col_link="tests/test_import/link_files_for_import_tests/survey_link_file.xlsx",303 path_to_translation=None,304 path_to_merge=None,305 label_data=False,306 study=import_study,307 format_options={308 "date": "%d-%m-%Y",309 "datetime": "%d-%m-%Y;%H:%M",310 "time": "%H:%M",311 },312 target=None,313 target_name=None,314 )315 comparison = read_excel(316 "tests/test_import/data_files_for_import_tests/data_file_survey_final_missings.xlsx"317 )318 assert to_upload.equals(comparison)319 def test_create_upload_survey_labels_missings(self, import_study):320 """Tests if creating the to_upload dataframe works for label data with missings"""321 to_upload = create_upload(322 path_to_upload="tests/test_import/data_files_for_import_tests/data_file_survey_labels_missings.xlsx",323 path_to_col_link="tests/test_import/link_files_for_import_tests/survey_link_file.xlsx",324 path_to_translation=None,325 path_to_merge=None,326 label_data=True,327 study=import_study,328 format_options={329 "date": "%d-%m-%Y",330 "datetime": "%d-%m-%Y;%H:%M",331 "time": "%H:%M",332 },333 target=None,334 target_name=None,335 )336 comparison = read_excel(337 "tests/test_import/data_files_for_import_tests/data_file_survey_final_missings.xlsx"338 )339 assert to_upload.equals(comparison)340 def test_create_upload_survey_values_errors(self, import_study):341 """Tests if creating the to_upload dataframe works for value data with missings"""342 to_upload = create_upload(343 path_to_upload="tests/test_import/data_files_for_import_tests/data_file_survey_values_errors.xlsx",344 path_to_col_link="tests/test_import/link_files_for_import_tests/survey_link_file.xlsx",345 path_to_translation=None,346 path_to_merge=None,347 label_data=False,348 study=import_study,349 format_options={350 "date": "%d-%m-%Y",351 "datetime": "%d-%m-%Y;%H:%M",352 "time": "%H:%M",353 },354 target=None,355 target_name=None,356 )357 comparison = read_excel(358 "tests/test_import/data_files_for_import_tests/data_file_survey_final_errors.xlsx"359 )360 assert to_upload.equals(comparison)361 def test_create_upload_survey_labels_errors(self, import_study):362 """Tests if creating the to_upload dataframe works for label data with missings"""363 to_upload = create_upload(364 path_to_upload="tests/test_import/data_files_for_import_tests/data_file_survey_labels_errors.xlsx",365 path_to_col_link="tests/test_import/link_files_for_import_tests/survey_link_file.xlsx",366 path_to_translation=None,367 path_to_merge=None,368 label_data=True,369 study=import_study,370 format_options={371 "date": "%d-%m-%Y",372 "datetime": "%d-%m-%Y;%H:%M",373 "time": "%H:%M",374 },375 target=None,376 target_name=None,377 )378 comparison = read_excel(379 "tests/test_import/data_files_for_import_tests/data_file_survey_final_errors.xlsx"380 )...

Full Screen

Full Screen

test_import_finding_action.py

Source:test_import_finding_action.py Github

copy

Full Screen

...122 .format(action, allowed_values)123 )124 self._action = action125 @property126 def test_import(self):127 """Gets the test_import of this TestImportFindingAction. # noqa: E501128 :return: The test_import of this TestImportFindingAction. # noqa: E501129 :rtype: int130 """131 return self._test_import132 @test_import.setter133 def test_import(self, test_import):134 """Sets the test_import of this TestImportFindingAction.135 :param test_import: The test_import of this TestImportFindingAction. # noqa: E501136 :type: int137 """138 self._test_import = test_import139 @property140 def finding(self):141 """Gets the finding of this TestImportFindingAction. # noqa: E501142 :return: The finding of this TestImportFindingAction. # noqa: E501143 :rtype: int144 """145 return self._finding146 @finding.setter147 def finding(self, finding):...

Full Screen

Full Screen

slice.js

Source:slice.js Github

copy

Full Screen

1const wasm = require('wasm-bindgen-test.js');2const assert = require('assert');3exports.js_export = () => {4 const i8 = new Int8Array(2);5 i8[0] = 1;6 i8[1] = 2;7 assert.deepStrictEqual(wasm.export_i8(i8), i8);8 const u8 = new Uint8Array(2);9 u8[0] = 1;10 u8[1] = 2;11 assert.deepStrictEqual(wasm.export_u8(u8), u8);12 const i16 = new Int16Array(2);13 i16[0] = 1;14 i16[1] = 2;15 assert.deepStrictEqual(wasm.export_i16(i16), i16);16 const u16 = new Uint16Array(2);17 u16[0] = 1;18 u16[1] = 2;19 assert.deepStrictEqual(wasm.export_u16(u16), u16);20 const i32 = new Int32Array(2);21 i32[0] = 1;22 i32[1] = 2;23 assert.deepStrictEqual(wasm.export_i32(i32), i32);24 assert.deepStrictEqual(wasm.export_isize(i32), i32);25 const u32 = new Uint32Array(2);26 u32[0] = 1;27 u32[1] = 2;28 assert.deepStrictEqual(wasm.export_u32(u32), u32);29 assert.deepStrictEqual(wasm.export_usize(u32), u32);30 const f32 = new Float32Array(2);31 f32[0] = 1;32 f32[1] = 2;33 assert.deepStrictEqual(wasm.export_f32(f32), f32);34 const f64 = new Float64Array(2);35 f64[0] = 1;36 f64[1] = 2;37 assert.deepStrictEqual(wasm.export_f64(f64), f64);38};39const test_import = (a, b, c) => {40 assert.strictEqual(a.length, 2);41 assert.strictEqual(a[0], 1);42 assert.strictEqual(a[1], 2);43 assert.strictEqual(b.length, 2);44 assert.strictEqual(b[0], 1);45 assert.strictEqual(b[1], 2);46 assert.strictEqual(c, undefined);47 return a;48};49exports.import_js_i8 = test_import;50exports.import_js_u8 = test_import;51exports.import_js_i16 = test_import;52exports.import_js_u16 = test_import;53exports.import_js_i32 = test_import;54exports.import_js_isize = test_import;55exports.import_js_u32 = test_import;56exports.import_js_usize = test_import;57exports.import_js_f32 = test_import;58exports.import_js_f64 = test_import;59exports.js_import = () => {60 const i8 = new Int8Array(2);61 i8[0] = 1;62 i8[1] = 2;63 assert.deepStrictEqual(wasm.import_rust_i8(i8), i8);64 const u8 = new Uint8Array(2);65 u8[0] = 1;66 u8[1] = 2;67 assert.deepStrictEqual(wasm.import_rust_u8(u8), u8);68 const i16 = new Int16Array(2);69 i16[0] = 1;70 i16[1] = 2;71 assert.deepStrictEqual(wasm.import_rust_i16(i16), i16);72 const u16 = new Uint16Array(2);73 u16[0] = 1;74 u16[1] = 2;75 assert.deepStrictEqual(wasm.import_rust_u16(u16), u16);76 const i32 = new Int32Array(2);77 i32[0] = 1;78 i32[1] = 2;79 assert.deepStrictEqual(wasm.import_rust_i32(i32), i32);80 assert.deepStrictEqual(wasm.import_rust_isize(i32), i32);81 const u32 = new Uint32Array(2);82 u32[0] = 1;83 u32[1] = 2;84 assert.deepStrictEqual(wasm.import_rust_u32(u32), u32);85 assert.deepStrictEqual(wasm.import_rust_usize(u32), u32);86 const f32 = new Float32Array(2);87 f32[0] = 1;88 f32[1] = 2;89 assert.deepStrictEqual(wasm.import_rust_f32(f32), f32);90 const f64 = new Float64Array(2);91 f64[0] = 1;92 f64[1] = 2;93 assert.deepStrictEqual(wasm.import_rust_f64(f64), f64);94};95exports.js_pass_array = () => {96 wasm.pass_array_rust_i8([1, 2]);97 wasm.pass_array_rust_u8([1, 2]);98 wasm.pass_array_rust_i16([1, 2]);99 wasm.pass_array_rust_u16([1, 2]);100 wasm.pass_array_rust_i32([1, 2]);101 wasm.pass_array_rust_u32([1, 2]);102 wasm.pass_array_rust_isize([1, 2]);103 wasm.pass_array_rust_usize([1, 2]);104 wasm.pass_array_rust_f32([1, 2]);105 wasm.pass_array_rust_f64([1, 2]);106};107const import_mut_foo = (a, b, c) => {108 assert.strictEqual(a.length, 3);109 assert.strictEqual(a[0], 1);110 assert.strictEqual(a[1], 2);111 a[0] = 4;112 a[1] = 5;113 assert.strictEqual(b.length, 3);114 assert.strictEqual(b[0], 4);115 assert.strictEqual(b[1], 5);116 assert.strictEqual(b[2], 6);117 b[0] = 8;118 b[1] = 7;119 assert.strictEqual(c, undefined);120};121exports.import_mut_js_i8 = import_mut_foo;122exports.import_mut_js_u8 = import_mut_foo;123exports.import_mut_js_i16 = import_mut_foo;124exports.import_mut_js_u16 = import_mut_foo;125exports.import_mut_js_i32 = import_mut_foo;126exports.import_mut_js_u32 = import_mut_foo;127exports.import_mut_js_isize = import_mut_foo;128exports.import_mut_js_usize = import_mut_foo;129exports.import_mut_js_f32 = import_mut_foo;130exports.import_mut_js_f64 = import_mut_foo;131const export_mut_run = (a, rust) => {132 assert.strictEqual(a.length, 3);133 a[0] = 1;134 a[1] = 2;135 a[2] = 3;136 console.log(a);137 rust(a);138 console.log(a);139 assert.strictEqual(a.length, 3);140 assert.strictEqual(a[0], 4);141 assert.strictEqual(a[1], 5);142 assert.strictEqual(a[2], 3);143};144exports.js_export_mut = () => {145 export_mut_run(new Int8Array(3), wasm.export_mut_i8);146 export_mut_run(new Uint8Array(3), wasm.export_mut_u8);147 export_mut_run(new Int16Array(3), wasm.export_mut_i16);148 export_mut_run(new Uint16Array(3), wasm.export_mut_u16);149 export_mut_run(new Int32Array(3), wasm.export_mut_i32);150 export_mut_run(new Uint32Array(3), wasm.export_mut_u32);151 export_mut_run(new Int32Array(3), wasm.export_mut_isize);152 export_mut_run(new Uint32Array(3), wasm.export_mut_usize);153 export_mut_run(new Float32Array(3), wasm.export_mut_f32);154 export_mut_run(new Float64Array(3), wasm.export_mut_f64);155};156exports.js_return_vec = () => {157 const app = wasm.return_vec_web_main();158 for (let i = 0; i < 10; i++) {159 app.tick();160 const bad = wasm.return_vec_broken_vec();161 console.log('Received from rust:', i, bad);162 assert.strictEqual(bad[0], 1);163 assert.strictEqual(bad[1], 2);164 assert.strictEqual(bad[2], 3);165 assert.strictEqual(bad[3], 4);166 assert.strictEqual(bad[4], 5);167 assert.strictEqual(bad[5], 6);168 assert.strictEqual(bad[6], 7);169 assert.strictEqual(bad[7], 8);170 assert.strictEqual(bad[8], 9);171 }172};173exports.js_clamped = (a, offset) => {174 assert.ok(a instanceof Uint8ClampedArray);175 assert.equal(a.length, 3);176 assert.equal(a[0], offset + 0);177 assert.equal(a[1], offset + 1);178 assert.equal(a[2], offset + 2);...

Full Screen

Full Screen

main.py

Source:main.py Github

copy

Full Screen

1# -*- coding:utf-8 -*-2import sys3sys.path.append('../')4#import test_import_15#import test_import_26import test_import_37'''8In [3]: import test_import9import test_import.B.a.numpy10import test_import.B.a.class_a.sklearn11import test_import.B.a.class_b.sklearn12import test_import.B.class_x.sklearn13可见,放在class名下作为类属性的模块,会先自动加载。14放在普通def函数、类下的函数里的模块,均不会自动加载。15在任何地方,如类中或函数中加载过的模块,再次import,是不会重新加载的,会很快。16类名下加载的模块,在类函数里是调用不到的。。。17在类外加载,类函数里才能调用18In [3]: from test_import import C19import test_import.B.a.numpy20import test_import.B.a.class_a.sklearn21import test_import.B.a.class_b.sklearn22import test_import.B.class_x.sklearn23import test_import.B.a.numpy24import test_import.B.a.class_a.sklearn25import test_import.B.a.class_b.sklearn26可以看到,虽然明面上是import C,实际上是将所有模块都加载了,27跟import test_import一模一样28In [4]: import test_import_229In [5]: test_import_2.C.class_x.a()30['/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sklearn']31import test_import.C.class_x.a.sklearn32In [6]: import sklearn # 很快,表明在test_import的类的函数里import过sklearn后,在其他任意地方再import sklearn,是不重新import的33关于__init__(self),加载类时不执行,实例化时才执行34********** 结论 **********35如果想import jizhipy时很快,则用当前写法:将所有import,放到函数里(普通函数或类函数),不放在.py顶格位置和类名下!!!...

Full Screen

Full Screen

import-scripts-updated-flag-worker.js

Source:import-scripts-updated-flag-worker.js Github

copy

Full Screen

1importScripts('/resources/testharness.js');2let echo_output = null;3// Tests importing a script that sets |echo_output| to the query string.4function test_import(str) {5 echo_output = null;6 importScripts('import-scripts-echo.py?msg=' + str);7 assert_equals(echo_output, str);8}9test_import('root');10test_import('root-and-message');11self.addEventListener('install', () => {12 test_import('install');13 test_import('install-and-message');14 });15self.addEventListener('message', e => {16 var error = null;17 echo_output = null;18 try {19 importScripts('import-scripts-echo.py?msg=' + e.data);20 } catch (e) {21 error = e && e.name;22 }23 e.source.postMessage({ error: error, value: echo_output });...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('wpt');2wpt.test_import();3exports.test_import = function(){4 console.log("test import");5}6exports.test_import = function(){7 console.log("test import");8}9var wpt = require('wpt');10wpt.test_import();11exports.test_import = function(){12 console.log("test import");13}14exports.test_import = function(){15 console.log("test import");16}17var wpt = require('wpt');18wpt.test_import();19exports.test_import = function(){20 console.log("test import");21}22exports.test_import = function(){23 console.log("test import");24}25var wpt = require('wpt');26wpt.test_import();27exports.test_import = function(){28 console.log("test import");29}30exports.test_import = function(){31 console.log("test import");32}33var wpt = require('wpt');34wpt.test_import();

Full Screen

Using AI Code Generation

copy

Full Screen

1function test_import() {2}3function test_import() {4}5function test_import() {6}7function test_import() {8}9function test_import() {10}11function test_import() {12}13function test_import() {14}15function test_import() {16}17function test_import() {18}19function test_import() {20}21function test_import() {22}23function test_import() {24}25function test_import() {26}

Full Screen

Using AI Code Generation

copy

Full Screen

1require(["wpt_test_import"], function (test_import) {2 test_import.test_import();3});4define({5 test_import: function () {6 console.log("test_import");7 }8});9define({10 test_import2: function () {11 console.log("test_import2");12 }13});14define({15 test_import3: function () {16 console.log("test_import3");17 }18});19define({20 test_import4: function () {21 console.log("test_import4");22 }23});24define({25 test_import5: function () {26 console.log("test_import5");27 }28});29define({30 test_import6: function () {31 console.log("test_import6");32 }33});34define({35 test_import7: function () {36 console.log("test_import7");37 }38});39define({40 test_import8: function () {41 console.log("test_import8");42 }43});44define({45 test_import9: function () {46 console.log("test_import9");47 }48});49define({50 test_import10: function () {51 console.log("test_import10");52 }53});54define({55 test_import11: function () {56 console.log("test_import11");57 }58});59define({60 test_import12: function () {61 console.log("test_import12");62 }63});64define({65 test_import13: function () {66 console.log("test_import13");67 }68});69define({70 test_import14: function () {71 console.log("test_import14");72 }73});74define({75 test_import15: function () {76 console.log("test_import15");77 }78});79define({

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('./wpt.js');2wpt.test_import();3module.exports = {4 test_import: function(){5 console.log("test_import method of wpt.js");6 }7}8var wpt = require('./wpt.js');9wpt.test_import();10module.exports = {11 test_import: function(){12 console.log("test_import method of wpt.js");13 }14}15var wpt = require('./wpt.js');16wpt.test_import();17module.exports = {18 test_import: function(){19 console.log("test_import method of wpt.js");20 }21}22var wpt = require('./wpt.js');23wpt.test_import();24module.exports = {25 test_import: function(){26 console.log("test_import method of wpt.js");27 }28}29var wpt = require('./wpt.js');30wpt.test_import();31module.exports = {32 test_import: function(){33 console.log("test_import method of wpt.js");34 }35}36var wpt = require('./wpt.js');37wpt.test_import();38module.exports = {

Full Screen

Using AI Code Generation

copy

Full Screen

1test_import();2var test_import = function(){3 console.log('test_import method of wpt.js');4}5module.exports = {6 test_import : test_import7}

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('./wpt.js');2wpt.test_import();3exports.test_import = function() {4 console.log('test import');5}6test import7module.exports = {8 add: function(a, b) {9 return a + b;10 },11 subtract: function(a, b) {12 return a - b;13 },14 multiply: function(a, b) {15 return a * b;16 },17 divide: function(a, b) {18 return a / b;19 }20};21var module = require('./module.js');22console.log('Addition: ' + module.add(2, 3));23console.log('Subtraction: ' + module.subtract(2, 3));24console.log('Multiplication: ' + module.multiply(2, 3));25console.log('Division: ' + module.divide(2, 3));

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run wpt automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful