當前位置: 首頁>>代碼示例>>Python>>正文


Python DocumentIO.dumps方法代碼示例

本文整理匯總了Python中linaro_dashboard_bundle.io.DocumentIO.dumps方法的典型用法代碼示例。如果您正苦於以下問題:Python DocumentIO.dumps方法的具體用法?Python DocumentIO.dumps怎麽用?Python DocumentIO.dumps使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在linaro_dashboard_bundle.io.DocumentIO的用法示例。


在下文中一共展示了DocumentIO.dumps方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: invoke_sub

# 需要導入模塊: from linaro_dashboard_bundle.io import DocumentIO [as 別名]
# 或者: from linaro_dashboard_bundle.io.DocumentIO import dumps [as 別名]
 def invoke_sub(self):
     bundle = generate_combined_bundle(self.args.serial,
                                       self.args.result_id)
     try:
         print DocumentIO.dumps(bundle)
     except IOError:
         pass
開發者ID:inwotep,項目名稱:lava-android-test,代碼行數:9,代碼來源:commands.py

示例2: _savetestdata

# 需要導入模塊: from linaro_dashboard_bundle.io import DocumentIO [as 別名]
# 或者: from linaro_dashboard_bundle.io.DocumentIO import dumps [as 別名]
 def _savetestdata(self, analyzer_assigned_uuid, run_options=""):
     config = get_config()
     TIMEFORMAT = '%Y-%m-%dT%H:%M:%SZ'
     bundle = {
         'format': config.bundle_format,
         'test_runs': [
             {
             'analyzer_assigned_uuid': analyzer_assigned_uuid,
             'analyzer_assigned_date':
                     self.runner.starttime.strftime(TIMEFORMAT),
             'time_check_performed': False,
             'attributes':{},
             'test_id': self.testname,
             'test_results':[],
             'attachments':[],
             'hardware_context': hwprofile.get_hardware_context(self.adb),
             'software_context': swprofile.get_software_context(self.adb)
             }
         ]
     }
     if run_options:
         bundle['test_runs'][0]['attributes']['run_options'] = run_options
     self._add_install_options(bundle, config)
     filename_host = os.path.join(config.tempdir_host, 'testdata.json')
     write_file(DocumentIO.dumps(bundle), filename_host)
     filename_target = os.path.join(self.resultsdir, 'testdata.json')
     self.adb.push(filename_host, filename_target)
開發者ID:inwotep,項目名稱:lava-android-test,代碼行數:29,代碼來源:testdef.py

示例3: test_load_and_save_does_not_clobber_the_data

# 需要導入模塊: from linaro_dashboard_bundle.io import DocumentIO [as 別名]
# 或者: from linaro_dashboard_bundle.io.DocumentIO import dumps [as 別名]
 def test_load_and_save_does_not_clobber_the_data(self):
     original_text = resource_string(
         'linaro_dashboard_bundle', 'test_documents/' +
         self.filename)
     fmt, doc = DocumentIO.loads(original_text)
     final_text = DocumentIO.dumps(doc,)
     final_text += "\n"  # the original string has newline at the end
     self.assertEqual(final_text, original_text)
開發者ID:Bruce-Zou,項目名稱:lava-dispatcher,代碼行數:10,代碼來源:tests.py

示例4: submit_bundle

# 需要導入模塊: from linaro_dashboard_bundle.io import DocumentIO [as 別名]
# 或者: from linaro_dashboard_bundle.io.DocumentIO import dumps [as 別名]
 def submit_bundle(self, main_bundle, server, stream, token):
     dashboard = _get_dashboard(server, token)
     json_bundle = DocumentIO.dumps(main_bundle)
     job_name = self.context.job_data.get('job_name', "LAVA Results")
     try:
         result = dashboard.put_ex(json_bundle, job_name, stream)
         print >> self.context.oob_file, 'dashboard-put-result:', result
         self.context.output.write_named_data('result-bundle', result)
         logging.info("Dashboard : %s" % result)
     except xmlrpclib.Fault, err:
         logging.warning("xmlrpclib.Fault occurred")
         logging.warning("Fault code: %d" % err.faultCode)
         logging.warning("Fault string: %s" % err.faultString)
         raise OperationFailed("could not push to dashboard")
開發者ID:inwotep,項目名稱:lava-dispatcher,代碼行數:16,代碼來源:launch_control.py

示例5: test_dumper_can_dump_decimals

# 需要導入模塊: from linaro_dashboard_bundle.io import DocumentIO [as 別名]
# 或者: from linaro_dashboard_bundle.io.DocumentIO import dumps [as 別名]
 def test_dumper_can_dump_decimals(self):
     doc = {
         "format": "Dashboard Bundle Format 1.0",
         "test_runs": [
             {
                 "test_id": "NOT RELEVANT",
                 "analyzer_assigned_date": "2010-11-14T01:03:06Z",
                 "analyzer_assigned_uuid": "NOT RELEVANT",
                 "time_check_performed": False,
                 "test_results": [
                     {
                         "test_case_id": "NOT RELEVANT",
                         "result": "unknown",
                         "measurement": Decimal("1.5")
                     }
                 ]
             }
         ]
     }
     text = DocumentIO.dumps(doc)
     self.assertIn("1.5", text)
開發者ID:Bruce-Zou,項目名稱:lava-dispatcher,代碼行數:23,代碼來源:tests.py

示例6: test_dumps_produces_compact_sorted_ouptut

# 需要導入模塊: from linaro_dashboard_bundle.io import DocumentIO [as 別名]
# 或者: from linaro_dashboard_bundle.io.DocumentIO import dumps [as 別名]
 def test_dumps_produces_compact_sorted_ouptut(self):
     observed_text = DocumentIO.dumps(self.doc, human_readable=False, sort_keys=True)
     self.assertEqual(observed_text, self.expected_compact_sorted_text)
開發者ID:Bruce-Zou,項目名稱:lava-dispatcher,代碼行數:5,代碼來源:tests.py

示例7: test_dumps_produces_readable_ouptut

# 需要導入模塊: from linaro_dashboard_bundle.io import DocumentIO [as 別名]
# 或者: from linaro_dashboard_bundle.io.DocumentIO import dumps [as 別名]
 def test_dumps_produces_readable_ouptut(self):
     observed_text = DocumentIO.dumps(self.doc, human_readable=True)
     self.assertEqual(observed_text, self.expected_readable_text)
開發者ID:Bruce-Zou,項目名稱:lava-dispatcher,代碼行數:5,代碼來源:tests.py


注:本文中的linaro_dashboard_bundle.io.DocumentIO.dumps方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。