Wykres commitów

1569 Commity (master)

Autor SHA1 Wiadomość Data
Paul Sokolovsky c72ec5c029 unittest: TestSuite: Add undescore to internal field, self._tests.
To avoid possible name clashes.

Signed-off-by: Paul Sokolovsky <pfalcon@users.sourceforge.net>
2022-05-06 10:47:37 +10:00
Paul Sokolovsky dc788f4e50 unittest: Reinstate useful debugger helper.
Signed-off-by: Paul Sokolovsky <pfalcon@users.sourceforge.net>
2022-05-06 10:47:37 +10:00
Paul Sokolovsky dedfe2dcd4 unittest: Add assertLessEqual, assertGreaterEqual methods.
As used by CPython testsuite.
2022-05-06 10:47:37 +10:00
Paul Sokolovsky a57b575020 unittest: AssertRaisesContext: Store exception value as self.exception.
For tests to check. This feature is used by CPython stdlib tests.
2022-05-06 10:47:37 +10:00
Paul Sokolovsky 965e25ce89 unittest: test_unittest: Typo fix. 2022-05-06 10:47:37 +10:00
Paul Sokolovsky fca89f65c7 unittest: test_unittest: Add test for .assertRaises(AssertionError).
Make sure that not raising AssertionError from tested function is properly
caught.
2022-05-06 10:47:37 +10:00
sss 669d343feb unittest: Allow to catch AssertionError with assertRaises().
Without this change, current implementaiton produces a false positive
result for AssertionError type.

Example of falsely passing test code:

def test(a, b):
    assert a > 10
    assert b > 10

self.assertRaises(AssertionError, test, 20, 20)
2022-05-06 10:47:37 +10:00
Paul Sokolovsky 663a3d6c54 unittest: test_unittest.py: Fix typo in method name. 2022-05-06 10:47:37 +10:00
Andrew Leech 7d4d02edfc unittest: Log failure tracebacks at test end.
Store traceback details for each test failure and log to console at the
end of the test, like CPython version of the module does.
2022-05-06 10:47:37 +10:00
Andrew Leech a9cd99ce2d unittest: Allow passing module name or instance into unittest.main() 2022-05-06 10:47:37 +10:00
Andrew Leech d64557a211 fnmatch: Release 0.6.0. 2022-05-06 10:47:37 +10:00
Andrew Leech 7259f0fd6f fnmatch: Remove dependency on os.path. 2022-05-06 10:47:37 +10:00
Andrew Leech dcdac1f552 fnmatch: Add ure compatibility.
Removes dependency on re-pcre which is only available on unix port.
2022-04-08 16:16:56 +10:00
Matt Trentini 0c31e0b3d7 micropython/aioble: Prioritise services in advertisement payload.
A number of fields (services, appearance, manufacturer, name) can appear
when a scan is requested.  However there is only so much space in the
header so, if a user has configured multiple fields, some may be 'pushed'
into the active scan response which requires additional communication.

When iOS scans for BLE devices it can filter by services, and so services
must be in the advertising (as opposed to scan response) payload.
2022-03-24 11:25:31 +11:00
robert-hh 760bfefd9d micropython/upysh: Add the cp() function and improve ls and rm.
- cp() copies a file. If the target is a directory, the file is copied
  into that directory.  It uses a small buffer, so it's not fast.
- ls uses ilistdir and creates a sorted output with directories listed as
  the first group.
- rm optionally deletes recursive, if the target is a directory.
2022-03-24 10:37:48 +11:00
Andrew Leech 22cd7fdd64 tools/codeformat: Fix compatibility running from subfolder in repo. 2022-03-23 12:16:24 +11:00
Andrew Leech ab1e6231dc tools/codeformat: By default only check/update on current git branch.
It can be difficult using the codeformat.py tool when there are other files
in the repository not currently matching the standard.

For developers, running over the entire repo can throw up a large list of
changes in a local git which can lead to inclusion of unrelated changes in
commits if they're added accidentally.  If the files arg is used to trim
down the list of files scanned, it runs a risk of missing some files
they've modified.  In CI, it means that PR's can fail on codeformat for
issues that aren't related to that PR.

This change adds a git query in the codeformat tool by default to only work
on the list of files that have been modified in the current branch.  This
can still be overridden by the files arg to run over all files still, eg.
python3 tools/codeformat.py -v '**'.
2022-03-22 16:46:48 +11:00
Lorenzo Cappelletti fc86070ffb python-stdlib/datetime: Add new implementation of datetime module.
This new module is a port of Python datetime providing classes for
manipulating dates, times, and deltas.  It completely replaces the existing
unix-ffi version.

Signed-off-by: Lorenzo Cappelletti <lorenzo.cappelletti@gmail.com>
2022-03-22 14:02:01 +11:00
Damien George 64b8817c0d all: Update formatting for new Black version 22.1.0.
Signed-off-by: Damien George <damien@micropython.org>
2022-03-22 13:30:34 +11:00
Jim Mussared cdd260f079 aioble/multitests: Add multitest for shutdown handlers.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-11-12 13:36:18 +11:00
Jim Mussared 10ec742baa aioble: Add a shutdown handler for cleanup.
This allows `aioble.stop()` to reset all internal state.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-11-12 13:35:52 +11:00
Jim Mussared a61bfc1460 aioble/README.md: Add l2cap example.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-11-12 13:35:50 +11:00
Jim Mussared 3ea74867f3 aioble: Add l2cap channel disconnected().
Allows `await channel.disconnected()`.

This also fixes a bug where connection._l2cap_channel wasn't being set to
None on disconnect.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-11-12 13:35:45 +11:00
Jim Mussared dd9b783568 aioble/multitests: Add test for subscription and notification.
This replicates the failure described in #453 (which is fixed by #459.

Also adds a test for subscription.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-11-10 17:41:11 +11:00
Jim Mussared 9169ca6543 aioble: Add support for write-with-update.
This allows a server to write a characteristic and automatically
notify/indicate all subscribed clients.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-11-10 13:47:04 +11:00
Jim Mussared dc03b4af4d aioble: Fix notified/indicated event waiting.
After a client does a successful `await char.notified()`, then before the
next call to `notified()` a notification arrives, then they call
`notified()` twice before the _next_ notification, the second call will
return None rather than waiting.

This applies the same fix as in 5a86aa5866
which solved a similar problem for server-side `char.written()`. Using
a deque is slightly overkill here, but it's consistent with the server
side, and also makes it very easy to support having a notification queue
in the future.

Also makes the client characteristic properly flags/properties-aware (i.e.
explicitly fail operations that aren't supported).

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-11-08 17:34:08 +11:00
Jim Mussared 43cad17946 aioble/multitests/ble_write_capture.py: Add multitest for write capture.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-11-05 14:30:40 +11:00
Jim Mussared 23b3c7fe2d aioble/multitests: Fix existing multitests.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-11-05 14:30:31 +11:00
Jim Mussared 5a86aa5866 aioble: Add a write queue for gatt server.
This fixes a bug where an incoming write before `written` is awaited causes
`written` to return None.  It also introduces a mechanism for a server to
"capture" all incoming written values (instead of only having access to the
most recent value).

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-11-05 14:30:08 +11:00
Jim Mussared 3c383f6d28 aioble: Fix docs for subscribe (needs await).
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-07-12 13:38:33 +10:00
Jim Mussared 32684886ee micropython/bluetooth/aioble: subscribe must register the connection.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-07-08 15:15:47 +10:00
Martin Komon 2e91b92413 unix-ffi/datetime: Add tzinfo.__new__ to make the package importable.
Add constructor to tzinfo class so that the package can be imported without
errors.
2021-06-02 00:38:42 +10:00
Damien George a3df207934 python-stdlib/random: Add getrandbits with no limit on number of bits.
Thanks to Macarthur Inbody aka @133794m3r for the implementation.

Signed-off-by: Damien George <damien@micropython.org>
2021-05-30 16:04:17 +10:00
Jim Mussared 8631225b7f micropython/aioble: Add asyncio-based wrapper for ubluetooth.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-05-28 18:26:49 +10:00
Damien George fe975d973a python-ecosys/iperf3: Add iperf3.
Signed-off-by: Damien George <damien@micropython.org>
2021-05-28 12:47:35 +10:00
Damien George f7f38ff2f1 python-stdlib/cgi: Apply Black formatting.
Signed-off-by: Damien George <damien@micropython.org>
2021-05-27 22:42:47 +10:00
Damien George c05ee03d5b workflows: Add initial GitHub workflows support, with code formatting.
Signed-off-by: Damien George <damien@micropython.org>
2021-05-27 22:42:43 +10:00
Damien George d093a684a4 tools: Add code formatting and CI scripts.
Adapted from the micropython repo.

Signed-off-by: Damien George <damien@micropython.org>
2021-05-27 22:42:36 +10:00
Jim Mussared 3a6ab0b46d top: Remove upip-related scripts.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-05-27 16:57:06 +10:00
Jim Mussared 35e3c9e4ff python-ecosys: Move urequests to python-ecosys.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-05-27 16:53:02 +10:00
Jim Mussared bc2b6b0b7f micropython/uasyncio: Remove uasyncio-v2.
Superceded by uasyncio-v3 in the main repo.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-05-27 16:52:16 +10:00
Jim Mussared fa13cbbc8b all: Run black over all code.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-05-27 15:50:04 +10:00
Jim Mussared af3e1aff9e all: Update READMEs. 2021-05-27 15:41:08 +10:00
Jim Mussared 1a28fe84e8 top: Move modules into python-stdlib, unix-ffi, or micropython. 2021-05-27 15:41:08 +10:00
Jim Mussared a1c4b5b564 binascii/hashlib: Set type to stdlib. 2021-05-27 15:41:08 +10:00
Jim Mussared cdcce0384d test: Remove PEP380 test (better handled by core testing). 2021-05-27 15:41:08 +10:00
Jim Mussared caf16675cf cpython-uasyncio: Remove as new-uasyncio is compatible with CPython. 2021-05-27 15:41:08 +10:00
Jim Mussared b4eeaae105 top: Remove unhelpful packages. 2021-05-27 15:41:08 +10:00
Jim Mussared 444b45e431 top: Remove all empty packages. 2021-05-27 15:41:08 +10:00
Damien George eae01bd4e4 logging: Add "levelno" entry to log record object/dict.
Useful for custom handlers to do further level filtering.

Signed-off-by: Damien George <damien@micropython.org>
2020-09-03 11:29:36 +10:00