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


Python Transaction.set_type_方法代碼示例

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


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

示例1: transaction__set_type_

# 需要導入模塊: from src.transaction import Transaction [as 別名]
# 或者: from src.transaction.Transaction import set_type_ [as 別名]
    def transaction__set_type_(self, args):
        import os
        from src.bank import Bank
        from src.household import Household
        from src.firm import Firm
        from src.environment import Environment
        from src.transaction import Transaction

        text = "This test checks transaction.set_type_ \n"
        self.print_info(text)
        #
        # INITIALIZATION
        #
        environment_directory = str(args[0])
        identifier = str(args[1])
        log_directory = str(args[2])

        # Configure logging parameters so we get output while the program runs
        logging.basicConfig(format='%(asctime)s %(message)s', datefmt='%m/%d/%Y %H:%M:%S',
                            filename=log_directory + identifier + ".log", level=logging.INFO)
        logging.info('START logging for test transaction__set_type_ in run: %s',
                     environment_directory + identifier + ".xml")

        # Construct household filename
        environment = Environment(environment_directory,  identifier)

        #
        # TESTING
        #

        print("Creating a transaction")
        transaction = Transaction()
        transaction.type_ = "test_type"
        print("Type: ")
        print(transaction.get_type_())
        print("Setting type")
        transaction.set_type_("new_type")
        print("Type: ")
        print(transaction.get_type_())
開發者ID:cogeorg,項目名稱:black_rhino,代碼行數:41,代碼來源:tests_transaction.py


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