diff options
| author | DavePutz <dwputz@gmail.com> | 2020-09-14 16:50:40 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-14 16:50:40 -0500 |
| commit | 2a2a8d64571bf93e2a166626841555fe1753a565 (patch) | |
| tree | a4b7ba795a6e17d4d0b32abd942af380b1c36e57 /tests/basics/struct_micropython.py | |
| parent | 4a3be4df91837a1c71fcbd62e041f7c45cd4dd4b (diff) | |
| parent | 3d8bac50e41acc286cefbde9e052c5ccb335101e (diff) | |
Merge pull request #28 from adafruit/main
Merge from adafruit/main
Diffstat (limited to 'tests/basics/struct_micropython.py')
| -rw-r--r-- | tests/basics/struct_micropython.py | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/tests/basics/struct_micropython.py b/tests/basics/struct_micropython.py deleted file mode 100644 index e72153071..000000000 --- a/tests/basics/struct_micropython.py +++ /dev/null @@ -1,41 +0,0 @@ -# test MicroPython-specific features of struct - -try: - import ustruct as struct -except: - try: - import struct - except ImportError: - print("SKIP") - raise SystemExit - -try: - struct.pack('O', None) -except ValueError: - print("SKIP") - raise SystemExit - -class A(): - pass - -# pack and unpack objects -o = A() -s = struct.pack("<O", o) -o2 = struct.unpack("<O", s) -print(o is o2[0]) - -# pack can accept less arguments than required for the format spec -print(struct.pack('<2I', 1)) - -# pack and unpack pointer to a string -# This requires uctypes to get the address of the string and instead of -# putting this in a dedicated test that can be skipped we simply pass -# if the import fails. -try: - import uctypes - o = uctypes.addressof('abc') - s = struct.pack("<S", o) - o2 = struct.unpack("<S", s) - assert o2[0] == 'abc' -except ImportError: - pass |
