diff options
author | Martin Pitt <martin.pitt@ubuntu.com> | 2014-03-11 17:39:20 +0100 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2014-03-11 19:33:04 -0500 |
commit | 5bf5cf8ddd83f632aa85ddbdc6c2dec075854e75 (patch) | |
tree | 4f04a181fc6a028de3695895a0b62d027a47f346 /test | |
parent | 0393a41e3589380b701dc73fc15fa90a24d7e55a (diff) | |
download | ofono-5bf5cf8ddd83f632aa85ddbdc6c2dec075854e75.tar.bz2 |
test: Replace obsolete has_key() with "in"
In order to also work with Python 3
Diffstat (limited to 'test')
-rwxr-xr-x | test/test-modem | 22 | ||||
-rwxr-xr-x | test/test-network-registration | 4 |
2 files changed, 13 insertions, 13 deletions
diff --git a/test/test-modem b/test/test-modem index e4dd6bd6..76810946 100755 --- a/test/test-modem +++ b/test/test-modem @@ -24,39 +24,39 @@ if __name__ == "__main__": properties = modem.GetProperties() - if properties.has_key('Name'): + if 'Name' in properties: print("Name: %s" % (properties['Name'])) - if properties.has_key('Manufacturer'): + if 'Manufacturer' in properties: print("Manufacturer: %s" % (properties['Manufacturer'])) - if properties.has_key('Model'): + if 'Model' in properties: print("Model: %s" % (properties['Model'])) - if properties.has_key('Revision'): + if 'Revision' in properties: print("Revision: %s" % (properties['Revision'])) - if properties.has_key('Serial'): + if 'Serial' in properties: print("Serial: %s" % (properties['Serial'])) - if properties.has_key('Powered'): + if 'Powered' in properties: print("Powered: %s" % (properties['Powered'])) - if properties.has_key('Online'): + if 'Online' in properties: print("Online: %s" % (properties['Online'])) - if properties.has_key('Lockdown'): + if 'Lockdown' in properties: print("Lockdown: %s" % (properties['Lockdown'])) - if properties.has_key('Emergency'): + if 'Emergency' in properties: print("Emergency: %s" % (properties['Emergency'])) - if properties.has_key('Features'): + if 'Features' in properties: print("Features:") for feature in properties["Features"]: print(" [ %s ]" % (feature)) - if properties.has_key('Interfaces'): + if 'Interfaces' in properties: print("Interfaces:") for interface in properties["Interfaces"]: print(" [ %s ]" % (interface)) diff --git a/test/test-network-registration b/test/test-network-registration index 5d3f75e3..9410ae6e 100755 --- a/test/test-network-registration +++ b/test/test-network-registration @@ -47,11 +47,11 @@ if __name__ == "__main__": print("Status is: '%s', Operator Name is: '%s'" %\ (props['Status'], props['Name'])) - if props.has_key('LocationAreaCode') and props.has_key('CellId'): + if 'LocationAreaCode' in props and 'CellId' in props: print("Location: '%d', Cell: '%d'" %\ (props['LocationAreaCode'], props['CellId'])) - if props.has_key('Technology'): + if 'Technology' in props: print("Technology: '%s'" % (props['Technology'])) try: |