本文整理匯總了Python中src.transaction.Transaction.type_方法的典型用法代碼示例。如果您正苦於以下問題:Python Transaction.type_方法的具體用法?Python Transaction.type_怎麽用?Python Transaction.type_使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類src.transaction.Transaction
的用法示例。
在下文中一共展示了Transaction.type_方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: transaction__get_type_
# 需要導入模塊: from src.transaction import Transaction [as 別名]
# 或者: from src.transaction.Transaction import type_ [as 別名]
def transaction__get_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.get_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__get_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_())