Age | Commit message (Collapse) | Author |
|
By default, pybuild uses the following command to run automatic unit
tests:
$ python3 -m unittest discover
Unfortunately, it does not work with us since unittest is unable to
discover our tests. Instead, we rely on pytest which succeeds so far.
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
The cards from usr/share are not accessible when running the tests from
a temporary directory. This happens for instance when running
$ pybuild --test --test-pytest
Make sure that this command would succeed by mocking the calls to open.
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Also, the GameManager object is not created globally anymore when
importing the module.
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
GameManager had a method called join_game ; which was not actually doing
any joining. Instead, it was just returning a reference to the game that
would match the specified game name and language. In case the game would
not exist, it would be created before being returned.
The function is now renamed find_by_name. Also a new parameter "create"
has been added. It is a boolean that controls whether a game would be
created if it does not exist.
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
The only reason why we had a reference was that we were able to send
notifications back to the client.
Instead, we now store the notifications at the player level.
At the client level, we now have a coroutine that waits for
notifications from the player and sends them when available.
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
When sending a card reception notification, we don't want to provide the
index from the whole deck. Instead we want to give a counter
corresponding to the player's total number of received cards.
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
It seems that between version 8 and 10 of the websockets package, a
redesign of the modules hierarchy was performed.
In version 8, when importing "websockets", we would end up with
a lot of extra things imported in the websockets namespace. For
instance:
* websockets.exceptions
* websockets.server
These extra are no longer imported in recent versions. Therefore, we
have to be more explicit when importing features from the websockets
package.
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Functions which generate notifications for clients were all making use
of await and async. This is not great because if we add a notification
somewhere, we need to change the function to a coroutine and update all
invocations (recursively changing all functions to coroutines).
Instead, we now add a task to the event loop whenever a notification
needs to be generated. This allows to drop the await and async
specifiers from mostly everywhere.
On the downside, it means that if we send a notification to n clients,
we have to register n tasks.
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|
|
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
|