How to use get_num_test_views method in autotest

Best Python code snippet using autotest_python

rpc_interface_unittest_fixme.py

Source:rpc_interface_unittest_fixme.py Github

copy

Full Screen

...247 self._check_test_names(tests, ['mytest1'])248 tests = rpc_interface.get_test_views(249 exclude_attributes_where='attribute="myattr2"')250 self._check_test_names(tests, ['mytest2', 'kernbench'])251 def test_get_num_test_views(self):252 self.assertEquals(rpc_interface.get_num_test_views(), 3)253 self.assertEquals(rpc_interface.get_num_test_views(254 job_name='myjob1', test_name='mytest1'), 1)255 def test_get_group_counts(self):256 self.assertEquals(rpc_interface.get_num_groups(['job_name']), 2)257 counts = rpc_interface.get_group_counts(['job_name'])258 groups = counts['groups']259 self.assertEquals(len(groups), 2)260 group1, group2 = groups261 self.assertEquals(group1['group_count'], 2)262 self.assertEquals(group1['job_name'], 'myjob1')263 self.assertEquals(group2['group_count'], 1)264 self.assertEquals(group2['job_name'], 'myjob2')265 extra = {'extra' : 'kernel_hash'}266 counts = rpc_interface.get_group_counts(['job_name'],267 header_groups=[('job_name',)],268 extra_select_fields=extra)269 groups = counts['groups']270 self.assertEquals(len(groups), 2)271 group1, group2 = groups272 self.assertEquals(group1['group_count'], 2)273 self.assertEquals(group1['header_indices'], [0])274 self.assertEquals(group1['extra'], 'mykernel1')275 self.assertEquals(group2['group_count'], 1)276 self.assertEquals(group2['header_indices'], [1])277 self.assertEquals(group2['extra'], 'mykernel2')278 def test_get_status_counts(self):279 counts = rpc_interface.get_status_counts(group_by=['job_name'])280 group1, group2 = counts['groups']281 self.assertEquals(group1['pass_count'], 1)282 self.assertEquals(group1['complete_count'], 2)283 self.assertEquals(group1['incomplete_count'], 0)284 self.assertEquals(group2['pass_count'], 1)285 self.assertEquals(group2['complete_count'], 1)286 self.assertEquals(group2['incomplete_count'], 0)287 def test_get_latest_tests(self):288 counts = rpc_interface.get_latest_tests(group_by=['job_name'])289 group1, group2 = counts['groups']290 self.assertEquals(group1['pass_count'], 0)291 self.assertEquals(group1['complete_count'], 1)292 self.assertEquals(group1['test_idx'], 2)293 self.assertEquals(group2['test_idx'], 3)294 def test_get_latest_tests_extra_info(self):295 counts = rpc_interface.get_latest_tests(group_by=['job_name'],296 extra_info=['job_tag'])297 group1, group2 = counts['groups']298 self.assertEquals(group1['extra_info'], ['1-myjobtag1'])299 self.assertEquals(group2['extra_info'], ['2-myjobtag2'])300 def test_get_job_ids(self):301 self.assertEquals([1,2], rpc_interface.get_job_ids())302 self.assertEquals([1], rpc_interface.get_job_ids(test_name='mytest2'))303 def test_get_hosts_and_tests(self):304 host_info = rpc_interface.get_hosts_and_tests()305 self.assertEquals(len(host_info), 1)306 info = host_info['myhost']307 self.assertEquals(info['tests'], ['kernbench'])308 self.assertEquals(info['id'], 1)309 def _check_for_get_test_labels(self, label, label_num):310 self.assertEquals(label['id'], label_num)311 self.assertEquals(label['description'], '')312 self.assertEquals(label['name'], 'testlabel%d' % label_num)313 def test_test_labels(self):314 labels = rpc_interface.get_test_labels_for_tests(test_name='mytest1')315 self.assertEquals(len(labels), 2)316 label1 = labels[0]317 label2 = labels[1]318 self._check_for_get_test_labels(label1, 1)319 self._check_for_get_test_labels(label2, 2)320 rpc_interface.test_label_remove_tests(label1['id'], test_name='mytest1')321 labels = rpc_interface.get_test_labels_for_tests(test_name='mytest1')322 self.assertEquals(len(labels), 1)323 label = labels[0]324 self._check_for_get_test_labels(label, 2)325 rpc_interface.test_label_add_tests(label1['id'], test_name='mytest1')326 labels = rpc_interface.get_test_labels_for_tests(test_name='mytest1')327 self.assertEquals(len(labels), 2)328 label1 = labels[0]329 label2 = labels[1]330 self._check_for_get_test_labels(label1, 1)331 self._check_for_get_test_labels(label2, 2)332 def test_get_test_attribute_fields(self):333 tests = rpc_interface.get_test_views(334 test_attribute_fields=['myattr', 'myattr2'])335 self.assertEquals(len(tests), 3)336 self.assertEquals(tests[0]['test_attribute_myattr'], 'myval')337 self.assertEquals(tests[0]['test_attribute_myattr2'], 'myval2')338 for index in (1, 2):339 self.assertEquals(tests[index]['test_attribute_myattr'], None)340 self.assertEquals(tests[index]['test_attribute_myattr2'], None)341 def test_filtering_on_test_attribute_fields(self):342 tests = rpc_interface.get_test_views(343 extra_where='test_attribute_myattr.value = "myval"',344 test_attribute_fields=['myattr'])345 self.assertEquals(len(tests), 1)346 def test_grouping_with_test_attribute_fields(self):347 num_groups = rpc_interface.get_num_groups(348 ['test_attribute_myattr'], test_attribute_fields=['myattr'])349 self.assertEquals(num_groups, 2)350 counts = rpc_interface.get_group_counts(351 ['test_attribute_myattr'], test_attribute_fields=['myattr'])352 groups = counts['groups']353 self.assertEquals(len(groups), num_groups)354 self.assertEquals(groups[0]['test_attribute_myattr'], None)355 self.assertEquals(groups[0]['group_count'], 2)356 self.assertEquals(groups[1]['test_attribute_myattr'], 'myval')357 self.assertEquals(groups[1]['group_count'], 1)358 def test_extra_info_test_attributes(self):359 counts = rpc_interface.get_latest_tests(360 group_by=['test_idx'], extra_info=['test_attribute_myattr'],361 test_attribute_fields=['myattr'])362 group1 = counts['groups'][0]363 self.assertEquals(group1['extra_info'], ['myval'])364 def test_get_test_label_fields(self):365 tests = rpc_interface.get_test_views(366 test_label_fields=['testlabel1', 'testlabel2'])367 self.assertEquals(len(tests), 3)368 self.assertEquals(tests[0]['test_label_testlabel1'], 'testlabel1')369 self.assertEquals(tests[0]['test_label_testlabel2'], 'testlabel2')370 for index in (1, 2):371 self.assertEquals(tests[index]['test_label_testlabel1'], None)372 self.assertEquals(tests[index]['test_label_testlabel2'], None)373 def test_filtering_on_test_label_fields(self):374 tests = rpc_interface.get_test_views(375 extra_where='test_label_testlabel1 = "testlabel1"',376 test_label_fields=['testlabel1'])377 self.assertEquals(len(tests), 1)378 def test_grouping_on_test_label_fields(self):379 num_groups = rpc_interface.get_num_groups(380 ['test_label_testlabel1'], test_label_fields=['testlabel1'])381 self.assertEquals(num_groups, 2)382 counts = rpc_interface.get_group_counts(383 ['test_label_testlabel1'], test_label_fields=['testlabel1'])384 groups = counts['groups']385 self.assertEquals(len(groups), 2)386 self.assertEquals(groups[0]['test_label_testlabel1'], None)387 self.assertEquals(groups[0]['group_count'], 2)388 self.assertEquals(groups[1]['test_label_testlabel1'], 'testlabel1')389 self.assertEquals(groups[1]['group_count'], 1)390 def test_get_iteration_result_fields(self):391 num_iterations = rpc_interface.get_num_test_views(392 iteration_result_fields=['iresult', 'iresult2'])393 self.assertEquals(num_iterations, 2)394 iterations = rpc_interface.get_test_views(395 iteration_result_fields=['iresult', 'iresult2'])396 self.assertEquals(len(iterations), 2)397 for index in (0, 1):398 self.assertEquals(iterations[index]['test_idx'], 1)399 self.assertEquals(iterations[0]['iteration_index'], 1)400 self.assertEquals(iterations[0]['iteration_result_iresult'], 1)401 self.assertEquals(iterations[0]['iteration_result_iresult2'], 2)402 self.assertEquals(iterations[1]['iteration_index'], 2)403 self.assertEquals(iterations[1]['iteration_result_iresult'], 3)404 self.assertEquals(iterations[1]['iteration_result_iresult2'], 4)405 def test_filtering_on_iteration_result_fields(self):...

Full Screen

Full Screen

rpc_interface_unittest.py

Source:rpc_interface_unittest.py Github

copy

Full Screen

...227 self._check_test_names(tests, ['mytest1'])228 tests = rpc_interface.get_test_views(229 exclude_attributes_where='attribute="myattr2"')230 self._check_test_names(tests, ['mytest2', 'kernbench'])231 def test_get_num_test_views(self):232 self.assertEquals(rpc_interface.get_num_test_views(), 3)233 self.assertEquals(rpc_interface.get_num_test_views(234 job_name='myjob1', test_name='mytest1'), 1)235 def test_get_group_counts(self):236 self.assertEquals(rpc_interface.get_num_groups(['job_name']), 2)237 counts = rpc_interface.get_group_counts(['job_name'])238 groups = counts['groups']239 self.assertEquals(len(groups), 2)240 group1, group2 = groups241 self.assertEquals(group1['group_count'], 2)242 self.assertEquals(group1['job_name'], 'myjob1')243 self.assertEquals(group2['group_count'], 1)244 self.assertEquals(group2['job_name'], 'myjob2')245 extra = {'extra': 'kernel_hash'}246 counts = rpc_interface.get_group_counts(['job_name'],247 header_groups=[('job_name',)],248 extra_select_fields=extra)249 groups = counts['groups']250 self.assertEquals(len(groups), 2)251 group1, group2 = groups252 self.assertEquals(group1['group_count'], 2)253 self.assertEquals(group1['header_indices'], [0])254 self.assertEquals(group1['extra'], 'mykernel1')255 self.assertEquals(group2['group_count'], 1)256 self.assertEquals(group2['header_indices'], [1])257 self.assertEquals(group2['extra'], 'mykernel2')258 def test_get_status_counts(self):259 counts = rpc_interface.get_status_counts(group_by=['job_name'])260 group1, group2 = counts['groups']261 self.assertEquals(group1['pass_count'], 1)262 self.assertEquals(group1['complete_count'], 2)263 self.assertEquals(group1['incomplete_count'], 0)264 self.assertEquals(group2['pass_count'], 1)265 self.assertEquals(group2['complete_count'], 1)266 self.assertEquals(group2['incomplete_count'], 0)267 def test_get_latest_tests(self):268 counts = rpc_interface.get_latest_tests(group_by=['job_name'])269 group1, group2 = counts['groups']270 self.assertEquals(group1['pass_count'], 0)271 self.assertEquals(group1['complete_count'], 1)272 self.assertEquals(group1['test_idx'], 2)273 self.assertEquals(group2['test_idx'], 3)274 def test_get_latest_tests_extra_info(self):275 counts = rpc_interface.get_latest_tests(group_by=['job_name'],276 extra_info=['job_tag'])277 group1, group2 = counts['groups']278 self.assertEquals(group1['extra_info'], ['1-myjobtag1'])279 self.assertEquals(group2['extra_info'], ['2-myjobtag2'])280 def test_get_job_ids(self):281 self.assertEquals([1, 2], rpc_interface.get_job_ids())282 self.assertEquals([1], rpc_interface.get_job_ids(test_name='mytest2'))283 def test_get_hosts_and_tests(self):284 host_info = rpc_interface.get_hosts_and_tests()285 self.assertEquals(len(host_info), 1)286 info = host_info['myhost']287 self.assertEquals(info['tests'], ['kernbench'])288 self.assertEquals(info['id'], 1)289 def _check_for_get_test_labels(self, label, label_num):290 self.assertEquals(label['id'], label_num)291 self.assertEquals(label['description'], '')292 self.assertEquals(label['name'], 'testlabel%d' % label_num)293 def test_test_labels(self):294 labels = rpc_interface.get_test_labels_for_tests(test_name='mytest1')295 self.assertEquals(len(labels), 2)296 label2 = labels[0]297 label3 = labels[1]298 self._check_for_get_test_labels(label2, 2)299 self._check_for_get_test_labels(label3, 3)300 rpc_interface.test_label_remove_tests(label2['id'], test_name='mytest1')301 labels = rpc_interface.get_test_labels_for_tests(test_name='mytest1')302 self.assertEquals(len(labels), 1)303 label = labels[0]304 self._check_for_get_test_labels(label, 3)305 rpc_interface.test_label_add_tests(label2['id'], test_name='mytest1')306 labels = rpc_interface.get_test_labels_for_tests(test_name='mytest1')307 self.assertEquals(len(labels), 2)308 label2 = labels[0]309 label3 = labels[1]310 self._check_for_get_test_labels(label2, 2)311 self._check_for_get_test_labels(label3, 3)312 def test_get_test_attribute_fields(self):313 tests = rpc_interface.get_test_views(314 test_attribute_fields=['myattr', 'myattr2'])315 self.assertEquals(len(tests), 3)316 self.assertEquals(tests[0]['test_attribute_myattr'], 'myval')317 self.assertEquals(tests[0]['test_attribute_myattr2'], 'myval2')318 for index in (1, 2):319 self.assertEquals(tests[index]['test_attribute_myattr'], None)320 self.assertEquals(tests[index]['test_attribute_myattr2'], None)321 def test_filtering_on_test_attribute_fields(self):322 tests = rpc_interface.get_test_views(323 extra_where='test_attribute_myattr.value = "myval"',324 test_attribute_fields=['myattr'])325 self.assertEquals(len(tests), 1)326 def test_grouping_with_test_attribute_fields(self):327 num_groups = rpc_interface.get_num_groups(328 ['test_attribute_myattr'], test_attribute_fields=['myattr'])329 self.assertEquals(num_groups, 2)330 counts = rpc_interface.get_group_counts(331 ['test_attribute_myattr'], test_attribute_fields=['myattr'])332 groups = counts['groups']333 self.assertEquals(len(groups), num_groups)334 self.assertEquals(groups[0]['test_attribute_myattr'], None)335 self.assertEquals(groups[0]['group_count'], 2)336 self.assertEquals(groups[1]['test_attribute_myattr'], 'myval')337 self.assertEquals(groups[1]['group_count'], 1)338 def test_extra_info_test_attributes(self):339 counts = rpc_interface.get_latest_tests(340 group_by=['test_idx'], extra_info=['test_attribute_myattr'],341 test_attribute_fields=['myattr'])342 group1 = counts['groups'][0]343 self.assertEquals(group1['extra_info'], ['myval'])344 def test_get_test_label_fields(self):345 tests = rpc_interface.get_test_views(346 test_label_fields=['testlabel2', 'testlabel3'])347 self.assertEquals(len(tests), 3)348 self.assertEquals(tests[0]['test_label_testlabel2'], 'testlabel2')349 self.assertEquals(tests[0]['test_label_testlabel3'], 'testlabel3')350 for index in (1, 2):351 self.assertEquals(tests[index]['test_label_testlabel2'], None)352 self.assertEquals(tests[index]['test_label_testlabel3'], None)353 def test_filtering_on_test_label_fields(self):354 tests = rpc_interface.get_test_views(355 extra_where='test_label_testlabel2 = "testlabel2"',356 test_label_fields=['testlabel2'])357 self.assertEquals(len(tests), 1)358 def test_grouping_on_test_label_fields(self):359 num_groups = rpc_interface.get_num_groups(360 ['test_label_testlabel2'], test_label_fields=['testlabel2'])361 self.assertEquals(num_groups, 2)362 counts = rpc_interface.get_group_counts(363 ['test_label_testlabel2'], test_label_fields=['testlabel2'])364 groups = counts['groups']365 self.assertEquals(len(groups), 2)366 self.assertEquals(groups[0]['test_label_testlabel2'], None)367 self.assertEquals(groups[0]['group_count'], 2)368 self.assertEquals(groups[1]['test_label_testlabel2'], 'testlabel2')369 self.assertEquals(groups[1]['group_count'], 1)370 def test_get_iteration_result_fields(self):371 num_iterations = rpc_interface.get_num_test_views(372 iteration_result_fields=['iresult', 'iresult2'])373 self.assertEquals(num_iterations, 2)374 iterations = rpc_interface.get_test_views(375 iteration_result_fields=['iresult', 'iresult2'])376 self.assertEquals(len(iterations), 2)377 for index in (0, 1):378 self.assertEquals(iterations[index]['test_idx'], 1)379 self.assertEquals(iterations[0]['iteration_index'], 1)380 self.assertEquals(iterations[0]['iteration_result_iresult'], 1)381 self.assertEquals(iterations[0]['iteration_result_iresult2'], 2)382 self.assertEquals(iterations[1]['iteration_index'], 2)383 self.assertEquals(iterations[1]['iteration_result_iresult'], 3)384 self.assertEquals(iterations[1]['iteration_result_iresult2'], 4)385 def test_filtering_on_iteration_result_fields(self):...

Full Screen

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 autotest 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