Skip to content

Commit 73d51c1

Browse files
committed
Improve (inline) documentation
1 parent 5b68221 commit 73d51c1

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
python-version: ${{ matrix.python-version }}
2626
- name: Install dependencies
2727
run: |
28+
# Only needed for `pypy3`.
2829
sudo apt install libxml2-dev libxslt-dev
2930
python -m pip install --upgrade pip
3031
python -m pip install .[test]

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Connect to your Grafana API endpoint using the `GrafanaApi` class.
3939
```python
4040
from grafana_client import GrafanaApi
4141

42-
grafana = GrafanaApi(auth='abcde....', host='grafana.example.org')
42+
grafana = GrafanaApi(auth='eyJrIjoiWHg...dGJpZCI6MX0=', host='grafana.example.org')
4343

4444
# Create user
4545
user = grafana.admin.create_user(
@@ -52,7 +52,7 @@ user = grafana.admin.change_user_password(2, "newpassword")
5252
grafana.search.search_dashboards(tag='applications')
5353

5454
# Find a user by email
55-
user = grafana.users.find_user('test@test.com')
55+
user = grafana.users.find_user('test@example.org')
5656

5757
# Add user to team 2
5858
grafana.teams.add_team_member(2, user["id"])

test/elements/test_team.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,14 @@ def test_get_team(self, m):
144144
@requests_mock.Mocker()
145145
def test_add_team(self, m):
146146
m.post("http://localhost/api/teams", json={"message": "Team created", "teamId": 2})
147-
team = {"name": "MySecondTestTeam", "email": "email@test.com"}
147+
team = {"name": "MySecondTestTeam", "email": "email@example.org"}
148148
new_team = self.grafana.teams.add_team(team)
149149
self.assertEqual(new_team["teamId"], 2)
150150

151151
@requests_mock.Mocker()
152152
def test_update_team(self, m):
153153
m.put("http://localhost/api/teams/3", json={"message": "Team updated"})
154-
team = {"name": "MyThirdTestTeam", "email": "email@test.com"}
154+
team = {"name": "MyThirdTestTeam", "email": "email@example.org"}
155155
response = self.grafana.teams.update_team(3, team)
156156
self.assertEqual(response["message"], "Team updated")
157157

test/test_grafana_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def test_grafana_client(self, mock_get):
3434
"isGrafanaAdmin": true
3535
}"""
3636
grafana = GrafanaApi(("admin", "admin"), host="localhost", url_path_prefix="", protocol="https")
37-
grafana.users.find_user("test@test.com")
37+
grafana.users.find_user("test@example.org")
3838

3939
def test_grafana_client_no_verify(self):
4040
grafana = GrafanaApi(
@@ -58,9 +58,9 @@ def test_grafana_client_no_verify(self):
5858
)
5959

6060
basic_auth = requests.auth.HTTPBasicAuth("admin", "admin")
61-
grafana.users.find_user("test@test.com")
61+
grafana.users.find_user("test@example.org")
6262
grafana.client.s.get.assert_called_once_with(
63-
"https://localhost/api/users/lookup?loginOrEmail=test@test.com",
63+
"https://localhost/api/users/lookup?loginOrEmail=test@example.org",
6464
auth=basic_auth,
6565
headers=None,
6666
json=None,

0 commit comments

Comments
 (0)