本文整理汇总了Python中py65.utils.addressing.AddressParser.address_for方法的典型用法代码示例。如果您正苦于以下问题:Python AddressParser.address_for方法的具体用法?Python AddressParser.address_for怎么用?Python AddressParser.address_for使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类py65.utils.addressing.AddressParser
的用法示例。
在下文中一共展示了AddressParser.address_for方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_address_for_returns_none_by_default
# 需要导入模块: from py65.utils.addressing import AddressParser [as 别名]
# 或者: from py65.utils.addressing.AddressParser import address_for [as 别名]
def test_address_for_returns_none_by_default(self):
parser = AddressParser(labels={})
self.assertEqual(None, parser.address_for('chrout'))
示例2: test_adderss_for_returns_alternate_default
# 需要导入模块: from py65.utils.addressing import AddressParser [as 别名]
# 或者: from py65.utils.addressing.AddressParser import address_for [as 别名]
def test_adderss_for_returns_alternate_default(self):
parser = AddressParser(labels={})
self.assertEqual('foo', parser.address_for('chrout', 'foo'))
示例3: test_address_for_returns_address
# 需要导入模块: from py65.utils.addressing import AddressParser [as 别名]
# 或者: from py65.utils.addressing.AddressParser import address_for [as 别名]
def test_address_for_returns_address(self):
parser = AddressParser(labels={'chrout': 0xFFD2})
self.assertEqual(0xFFD2, parser.address_for('chrout'))