Skip to content

Commit

Permalink
add missing cassette
Browse files Browse the repository at this point in the history
  • Loading branch information
MJedr committed Oct 5, 2023
1 parent d63f692 commit bf87f5a
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Library-Notification-Service/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 CERN Scientific Information Service
Copyright (c) 2023 CERN Scientific Information Service

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
8 changes: 4 additions & 4 deletions Library-Notification-Service/src/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@


import json
from typing import List
import urllib.parse
from typing import List

import requests

from .env import (
LIBRARY_CATALOGUE_BACKOFFICE_ITEMS_API,
LIBRARY_CATALOGUE_BACKOFFICE_EITEMS_API,
LIBRARY_CATALOGUE_BACKOFFICE_API_TOKEN,
LIBRARY_CATALOGUE_BACKOFFICE_EITEMS_API,
LIBRARY_CATALOGUE_BACKOFFICE_ITEMS_API,
LIBRARY_CATALOGUE_SITE_API,
NOTIFICATIONS_API_SECRET,
NOTIFICATIONS_API_URL,
NOTIFICATIONS_CHANNEL_ID,
)
from .utils import (
get_full_query,
get_last_week_date_range,
get_last_five_years_range,
get_last_week_date_range,
get_pids_from_docs,
)

Expand Down
4 changes: 2 additions & 2 deletions Library-Notification-Service/src/utils.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""Module containing methods related to query generator."""

from datetime import datetime, timedelta
import urllib.parse
from typing import Optional, List
from datetime import datetime, timedelta
from typing import List, Optional

from .env import LIBRARY_CATALOGUE_SITE_URL

Expand Down
90 changes: 90 additions & 0 deletions matomo-api/tests/cassettes/test_cli_default_arguments.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
interactions:
- request:
body: null
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
User-Agent:
- python-requests/2.31.0
method: GET
uri: https://webanalytics.web.cern.ch/index.php?date=2023-01-04+00%3A10%3A00&format=json&method=VisitsSummary.getVisits&module=API&period=day
response:
body:
string: '{"value":24}'
headers:
access-control-allow-credentials:
- 'false'
access-control-allow-origin:
- '*'
cache-control:
- must-revalidate
- private
content-length:
- '12'
content-type:
- application/json; charset=utf-8
date:
- Thu, 05 Oct 2023 13:49:49 GMT
server:
- Apache/2.4.57 (Debian)
set-cookie:
- d63becdd54bbddc0aa193e4f140940ae=59b5ec39d39574dd892a40073505fa96; path=/;
HttpOnly; Secure; SameSite=None
vary:
- Origin
x-matomo-request-id:
- d4116
x-powered-by:
- PHP/8.1.23
status:
code: 200
message: OK
- request:
body: null
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
User-Agent:
- python-requests/2.31.0
method: GET
uri: https://webanalytics.web.cern.ch/index.php?date=2023-01-04+00%3A10%3A00&format=json&method=VisitsSummary.getVisits&module=API&period=day
response:
body:
string: '{"value":24}'
headers:
access-control-allow-credentials:
- 'false'
access-control-allow-origin:
- '*'
cache-control:
- must-revalidate
- private
content-length:
- '12'
content-type:
- application/json; charset=utf-8
date:
- Thu, 05 Oct 2023 13:49:49 GMT
server:
- Apache/2.4.57 (Debian)
set-cookie:
- d63becdd54bbddc0aa193e4f140940ae=59b5ec39d39574dd892a40073505fa96; path=/;
HttpOnly; Secure; SameSite=None
vary:
- Origin
x-matomo-request-id:
- 8fa2e
x-powered-by:
- PHP/8.1.23
status:
code: 200
message: OK
version: 1

0 comments on commit bf87f5a

Please sign in to comment.