OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2015 Google Inc. All rights reserved. | 2 # Copyright 2015 Google Inc. All rights reserved. |
3 # | 3 # |
4 # Licensed under the Apache License, Version 2.0 (the "License"); | 4 # Licensed under the Apache License, Version 2.0 (the "License"); |
5 # you may not use this file except in compliance with the License. | 5 # you may not use this file except in compliance with the License. |
6 # You may obtain a copy of the License at | 6 # You may obtain a copy of the License at |
7 # | 7 # |
8 # http://www.apache.org/licenses/LICENSE-2.0 | 8 # http://www.apache.org/licenses/LICENSE-2.0 |
9 # | 9 # |
10 # Unless required by applicable law or agreed to in writing, software | 10 # Unless required by applicable law or agreed to in writing, software |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 0x00000020: 00390038 00000034 '8.9.4... ') | 42 0x00000020: 00390038 00000034 '8.9.4... ') |
43 """ | 43 """ |
44 | 44 |
45 class TestAndroid(unittest.TestCase): | 45 class TestAndroid(unittest.TestCase): |
46 def test_GetIMEI(self): | 46 def test_GetIMEI(self): |
47 device = MockDevice( | 47 device = MockDevice( |
48 [ | 48 [ |
49 ('dumpsys iphonesubinfo', ''), | 49 ('dumpsys iphonesubinfo', ''), |
50 ('service call iphonesubinfo 1', RAW_IMEI), | 50 ('service call iphonesubinfo 1', RAW_IMEI), |
51 ]) | 51 ]) |
52 cache = high.DeviceCache(None, None, None, None, None, None) | 52 cache = high.DeviceCache(None, None, None, None, None) |
53 self.assertEqual( | 53 self.assertEqual( |
54 u'355236058685894', high.HighDevice(device, cache).GetIMEI()) | 54 u'355236058685894', high.HighDevice(device, cache).GetIMEI()) |
55 | 55 |
56 | 56 |
57 if __name__ == '__main__': | 57 if __name__ == '__main__': |
58 if '-v' in sys.argv: | 58 if '-v' in sys.argv: |
59 unittest.TestCase.maxDiff = None # pragma: no cover | 59 unittest.TestCase.maxDiff = None # pragma: no cover |
60 logging.basicConfig( | 60 logging.basicConfig( |
61 level=logging.DEBUG if '-v' in sys.argv else logging.CRITICAL) | 61 level=logging.DEBUG if '-v' in sys.argv else logging.CRITICAL) |
62 unittest.main() | 62 unittest.main() |
OLD | NEW |