Skip to content

Commit ea4559b

Browse files
authored
chore(test): Increase test coverage across multiple modules (#169)
Used jules.google.com to increase Test Coverage.
1 parent d5e5f5f commit ea4559b

19 files changed

+4124
-33
lines changed

.coveragerc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ omit =
55
*/site-packages/*
66
*/__init__.py
77
*/noxfile.py*
8+
src/a2a/grpc/*
89

910
[report]
1011
exclude_lines =
@@ -15,4 +16,4 @@ exclude_lines =
1516
if TYPE_CHECKING
1617
@abstractmethod
1718
pass
18-
raise ImportError
19+
raise ImportError

.github/actions/spelling/allow.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,26 @@ coro
2929
datamodel
3030
dunders
3131
genai
32+
getkwargs
3233
gle
3334
inmemory
3435
kwarg
3536
langgraph
3637
lifecycles
3738
linting
39+
lstrips
40+
mockurl
3841
oauthoidc
42+
oidc
3943
opensource
4044
protoc
4145
pyi
4246
pyversions
47+
resub
4348
socio
4449
sse
4550
tagwords
51+
taskupdate
52+
testuuid
53+
typeerror
4654
vulnz

.github/workflows/unit-tests.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,8 @@ jobs:
4040
- name: Install dependencies
4141
run: uv sync --dev
4242

43-
- name: Run tests
44-
run: uv run pytest
43+
- name: Run tests and check coverage
44+
run: uv run pytest --cov=a2a --cov-report=xml --cov-fail-under=85
4545

46-
- name: Upload coverage report
47-
uses: actions/upload-artifact@v4
48-
with:
49-
name: coverage-report-${{ matrix.python-version }}
50-
path: coverage.xml
51-
if-no-files-found: ignore
46+
- name: Show coverage summary in log
47+
run: uv run coverage report

tests/auth/test_user.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import unittest
2+
3+
from a2a.auth.user import UnauthenticatedUser
4+
5+
6+
class TestUnauthenticatedUser(unittest.TestCase):
7+
def test_is_authenticated_returns_false(self):
8+
user = UnauthenticatedUser()
9+
self.assertFalse(user.is_authenticated)
10+
11+
def test_user_name_returns_empty_string(self):
12+
user = UnauthenticatedUser()
13+
self.assertEqual(user.user_name, '')
14+
15+
16+
if __name__ == '__main__':
17+
unittest.main()

0 commit comments

Comments
 (0)