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


Python Dependency.notify_new_relic方法代碼示例

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


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

示例1: CoreJenkinsDeploymentTest

# 需要導入模塊: from common.utilities.inversion_of_control import Dependency [as 別名]
# 或者: from common.utilities.inversion_of_control.Dependency import notify_new_relic [as 別名]
class CoreJenkinsDeploymentTest(unittest.TestCase):
    def setUp(self):
        register_common_mock_dependencies()
        self.deployment_provider = Dependency("DeploymentProvider").value

    def doCleanups(self):
        dependencies.clear()

    def test_notify_new_relic(self):
        response = self.deployment_provider.notify_new_relic("Mack Daddy App", "The daddy of the mack daddy", "Daddy Mack")

        self.assertEqual(self.deployment_provider.new_relic_application_name, "Mack Daddy App")
        self.assertEqual(self.deployment_provider.new_relic_deployment_description, "The daddy of the mack daddy")
        self.assertEqual(self.deployment_provider.new_relic_api_key, "Daddy Mack")

        # make sure we get an xml string back, with a <deployment> root node that has <id> and <timestamp> elements
        tree = ET.fromstring(response)
        self.assertEqual(tree.tag, "deployment")
        self.assertEqual(tree.find("id").text, "1489838")
        self.assertEqual(tree.find("timestamp").text, "2013-05-05T11:35:24-07:00")
開發者ID:erezrubinstein,項目名稱:aa,代碼行數:22,代碼來源:test_jenkins_deployment.py


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