Skip to content

CV3-68 Refactor fixtures folder #515

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
180 changes: 180 additions & 0 deletions fixtures/analytics/analytics_query_responses.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
from ..output.OutputBuilder import build
from ..output.Error import error_item

null = None
all_analytics_query_response = {
"data": {
"allAnalytics": {
"checkinsPercentage": 0.0,
"appBookingsPercentage": 0.0,
"autoCancellationsPercentage": 0.0,
"cancellationsPercentage": 0.0,
"bookings": 1,
"analytics": [
{
"roomName": "Entebbe",
"cancellations": 0,
"cancellationsPercentage": 0.0,
"autoCancellations": 0,
"numberOfBookings": 1,
"checkins": 0,
"checkinsPercentage": 0.0,
"bookingsPercentageShare": 100.0,
"appBookings": 0,
"appBookingsPercentage": 0.0,
"events": [
{
"durationInMinutes": 45
}
]
},
{
"roomName": "Tana",
"cancellations": 0,
"cancellationsPercentage": 0.0,
"autoCancellations": 0,
"numberOfBookings": 0,
"checkins": 0,
"checkinsPercentage": 0.0,
"bookingsPercentageShare": 0.0,
"appBookings": 0,
"appBookingsPercentage": 0.0,
"events": [
{
"durationInMinutes": 0
}
]
}
],
"bookingsCount": [
{
"totalBookings": 1,
"period": "Jul 11 2018"
},
{
'totalBookings': 0,
'period': 'Jul 12 2018'
}
]
}
}
}

aaq_error = error_item
aaq_error.message = "Location Id does not exist"
aaq_error.locations = [{"line": 3, "column": 7}]
aaq_error.path = ["allAnalytics"]
aaq_data = {"allAnalytics": None}

all_analytics_query_response_super_admin_with_invalid_locationid = build(
aaq_error.build_error(aaq_error),
aaq_data
)
all_analytics_query_response_super_admin = {
"data": {
"allAnalytics": {
"checkinsPercentage": 0.0,
"appBookingsPercentage": 0.0,
"autoCancellationsPercentage": 0.0,
"cancellationsPercentage": 0.0,
"bookings": 12,
"analytics": [
{
"roomName": "Oculus",
"cancellations": 0,
"cancellationsPercentage": 0.0,
"autoCancellations": 0,
"numberOfBookings": 6,
"checkins": 0,
"checkinsPercentage": 0.0,
"bookingsPercentageShare": 50.0,
"appBookings": 0,
"appBookingsPercentage": 0.0,
"events": [
{
"durationInMinutes": 890
}
]
},
{
"roomName": "Krypton",
"cancellations": 0,
"cancellationsPercentage": 0.0,
"autoCancellations": 0,
"numberOfBookings": 3,
"checkins": 0,
"checkinsPercentage": 0.0,
"bookingsPercentageShare": 25.0,
"appBookings": 0,
"appBookingsPercentage": 0.0,
"events": [
{
"durationInMinutes": 155
}
]
},
{
"roomName": "Bujumbura",
"cancellations": 0,
"cancellationsPercentage": 0.0,
"autoCancellations": 0,
"numberOfBookings": 3,
"checkins": 0,
"checkinsPercentage": 0.0,
"bookingsPercentageShare": 25.0,
"appBookings": 0,
"appBookingsPercentage": 0.0,
"events": [
{
"durationInMinutes": 92
}
]
},
{
"roomName": "Kampala",
"cancellations": 0,
"cancellationsPercentage": 0.0,
"autoCancellations": 0,
"numberOfBookings": 0,
"checkins": 0,
"checkinsPercentage": 0.0,
"bookingsPercentageShare": 0.0,
"appBookings": 0,
"appBookingsPercentage": 0.0,
"events": [
{
"durationInMinutes": 0
}
]
},
{
"roomName": "Algiers",
"cancellations": 0,
"cancellationsPercentage": 0.0,
"autoCancellations": 0,
"numberOfBookings": 0,
"checkins": 0,
"checkinsPercentage": 0.0,
"bookingsPercentageShare": 0.0,
"appBookings": 0,
"appBookingsPercentage": 0.0,
"events": [
{
"durationInMinutes": 0
}
]
}
],
"bookingsCount": [
{
"totalBookings": 7,
"period": "Jul 11 2018"
},
{
"totalBookings": 5,
"period": "Jul 12 2018"
}
]
}
}
}
187 changes: 0 additions & 187 deletions fixtures/analytics/query_all_analytics_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,193 +59,6 @@
}
'''

all_analytics_query_response = {
"data": {
"allAnalytics": {
"checkinsPercentage": 0.0,
"appBookingsPercentage": 0.0,
"autoCancellationsPercentage": 0.0,
"cancellationsPercentage": 0.0,
"bookings": 1,
"analytics": [
{
"roomName": "Entebbe",
"cancellations": 0,
"cancellationsPercentage": 0.0,
"autoCancellations": 0,
"numberOfBookings": 1,
"checkins": 0,
"checkinsPercentage": 0.0,
"bookingsPercentageShare": 100.0,
"appBookings": 0,
"appBookingsPercentage": 0.0,
"events": [
{
"durationInMinutes": 45
}
]
},
{
"roomName": "Tana",
"cancellations": 0,
"cancellationsPercentage": 0.0,
"autoCancellations": 0,
"numberOfBookings": 0,
"checkins": 0,
"checkinsPercentage": 0.0,
"bookingsPercentageShare": 0.0,
"appBookings": 0,
"appBookingsPercentage": 0.0,
"events": [
{
"durationInMinutes": 0
}
]
}
],
"bookingsCount": [
{
"totalBookings": 1,
"period": "Jul 11 2018"
},
{
'totalBookings': 0,
'period': 'Jul 12 2018'
}
]
}
}
}

all_analytics_query_response_super_admin_with_invalid_locationid = {
"errors": [
{
"message": "Location Id does not exist",
"locations": [
{
"line": 3,
"column": 7
}
],
"path": [
"allAnalytics"
]
}
],
"data": {
"allAnalytics": None
}
}

all_analytics_query_response_super_admin = {
"data": {
"allAnalytics": {
"checkinsPercentage": 0.0,
"appBookingsPercentage": 0.0,
"autoCancellationsPercentage": 0.0,
"cancellationsPercentage": 0.0,
"bookings": 12,
"analytics": [
{
"roomName": "Oculus",
"cancellations": 0,
"cancellationsPercentage": 0.0,
"autoCancellations": 0,
"numberOfBookings": 6,
"checkins": 0,
"checkinsPercentage": 0.0,
"bookingsPercentageShare": 50.0,
"appBookings": 0,
"appBookingsPercentage": 0.0,
"events": [
{
"durationInMinutes": 890
}
]
},
{
"roomName": "Krypton",
"cancellations": 0,
"cancellationsPercentage": 0.0,
"autoCancellations": 0,
"numberOfBookings": 3,
"checkins": 0,
"checkinsPercentage": 0.0,
"bookingsPercentageShare": 25.0,
"appBookings": 0,
"appBookingsPercentage": 0.0,
"events": [
{
"durationInMinutes": 155
}
]
},
{
"roomName": "Bujumbura",
"cancellations": 0,
"cancellationsPercentage": 0.0,
"autoCancellations": 0,
"numberOfBookings": 3,
"checkins": 0,
"checkinsPercentage": 0.0,
"bookingsPercentageShare": 25.0,
"appBookings": 0,
"appBookingsPercentage": 0.0,
"events": [
{
"durationInMinutes": 92
}
]
},
{
"roomName": "Kampala",
"cancellations": 0,
"cancellationsPercentage": 0.0,
"autoCancellations": 0,
"numberOfBookings": 0,
"checkins": 0,
"checkinsPercentage": 0.0,
"bookingsPercentageShare": 0.0,
"appBookings": 0,
"appBookingsPercentage": 0.0,
"events": [
{
"durationInMinutes": 0
}
]
},
{
"roomName": "Algiers",
"cancellations": 0,
"cancellationsPercentage": 0.0,
"autoCancellations": 0,
"numberOfBookings": 0,
"checkins": 0,
"checkinsPercentage": 0.0,
"bookingsPercentageShare": 0.0,
"appBookings": 0,
"appBookingsPercentage": 0.0,
"events": [
{
"durationInMinutes": 0
}
]
}
],
"bookingsCount": [
{
"totalBookings": 7,
"period": "Jul 11 2018"
},
{
"totalBookings": 5,
"period": "Jul 12 2018"
}
]
}
}
}

analytics_query_for_date_ranges = '''
query {
allAnalytics(startDate:"jul 11 2020", endDate:"jul 12 2018") {
Expand Down
Loading