本文整理汇总了Python中preferences.Preferences.gammuIndex方法的典型用法代码示例。如果您正苦于以下问题:Python Preferences.gammuIndex方法的具体用法?Python Preferences.gammuIndex怎么用?Python Preferences.gammuIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类preferences.Preferences
的用法示例。
在下文中一共展示了Preferences.gammuIndex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testSaveLoad
# 需要导入模块: from preferences import Preferences [as 别名]
# 或者: from preferences.Preferences import gammuIndex [as 别名]
def testSaveLoad(self):
prefs = Preferences('prefstest.conf')
self.assertEqual(None, prefs.btDevice)
self.assertEqual('bluetooth', prefs.connectionMethod)
self.assertEqual('', prefs.customDevice)
self.assertEqual(0, prefs.gammuIndex)
prefs.btDevice = BluetoothDevice('00:00:00:00', 42, 'deviceName', 'serviceName')
prefs.connectionMethod = 'connection'
prefs.customDevice = '/dev/rfcomm0'
prefs.gammuIndex = 2
prefs.save()
prefsLoaded = Preferences('prefstest.conf')
prefsLoaded.load()
self.assertNotEqual(None, prefsLoaded.btDevice, "Device has not been loaded")
self.assertEqual('00:00:00:00', prefsLoaded.btDevice.address)
self.assertEqual(42, prefsLoaded.btDevice.port)
self.assertEqual('deviceName', prefsLoaded.btDevice.deviceName)
self.assertEqual('serviceName', prefsLoaded.btDevice.serviceName)
self.assertEqual('connection', prefsLoaded.connectionMethod)
self.assertEqual('/dev/rfcomm0', prefsLoaded.customDevice)
self.assertEqual(2, prefsLoaded.gammuIndex)