Skip to content

CV3-77 Clean up base.py test file #514

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
6 changes: 6 additions & 0 deletions fixtures/location/all_locations_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@
}
]
},
{
"name": "Kigali",
"abbreviation": "KGL",
"rooms": []
},
{
"name": "Lagos",
"abbreviation": "LOS",
Expand Down Expand Up @@ -112,6 +117,7 @@
},
]},
{'rooms': []},
{'rooms': []},
{'rooms': []}
]
}
Expand Down
6 changes: 4 additions & 2 deletions fixtures/response/room_response_fixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

null = None

start_date = (datetime.date.today() - datetime.timedelta(
created_at = 'Nov 30 2019'
created_at_datetime = datetime.datetime.strptime(created_at, '%b %d %Y')
start_date = (created_at_datetime - datetime.timedelta(
days=2)).strftime('%b %d %Y')
end_date = datetime.date.today().strftime('%b %d %Y')
end_date = created_at_datetime.strftime('%b %d %Y')
invalid_start_date = (datetime.date.today() + datetime.timedelta(
days=10)).strftime('%b %d %Y')
invalid_end_date = (datetime.date.today() + datetime.timedelta(
Expand Down
14 changes: 14 additions & 0 deletions test_data/devices_table.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"table_name": "devices",
"data": [
{
"last_seen":"2018-06-08T11:17:58.785136",
"date_added":"2018-06-08T11:17:58.785136",
"name":"Samsung",
"location":"Kampala",
"device_type":"External Display",
"room_id":1,
"state":"active"
}
]
}
15 changes: 15 additions & 0 deletions test_data/events_table.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"table_name": "events",
"data": [
{
"event_id":"test_id5",
"room_id":1,
"event_title":"Onboarding",
"start_time":"2018-07-11T09:00:00Z",
"end_time":"2018-07-11T09:45:00Z",
"number_of_participants":4,
"checked_in":false,
"cancelled":false
}
]
}
21 changes: 21 additions & 0 deletions test_data/locations_table.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"table_name": "locations",
"data": [
{
"name":"Kampala",
"abbreviation":"KLA"
},
{
"name": "Nairobi",
"abbreviation": "NBO"
},
{
"name": "Lagos",
"abbreviation": "LOS"
},
{
"name": "Kigali",
"abbreviation": "KGL"
}
]
}
18 changes: 18 additions & 0 deletions test_data/office_structures_table.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"table_name": "structures",
"data": [
{
"id":"C56A4180-65AA-42EC-A945-5FD21DEC0518",
"name":"Epic Tower",
"tag":"Lagos Building",
"location_id":1
},
{
"id": "C56A4180-65AA-42EC-A945-5FD21DEC0519",
"name": "Gold Coast",
"tag": "First Floor",
"parent_id":"C56A4180-65AA-42EC-A945-5FD21DEC0518",
"location_id": 1
}
]
}
38 changes: 38 additions & 0 deletions test_data/questions_table.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"table_name": "questions",
"data": [
{
"question_type":"rate",
"question_title":"Rating Feedback",
"question":"How will you rate the brightness of the room",
"start_date":"20 Nov 2018",
"end_date":"28 Nov 2018",
"is_active":true
},
{
"question_type": "check",
"question_title": "check Feedback",
"question": "Is there anything missing in the room",
"check_options":["apple tv", "whiteboard", "maker pen"],
"start_date": "20 Nov 2018",
"end_date": "30 Nov 2018",
"is_active": true
},
{
"question_type":"input",
"question_title":"input Feedback",
"question":"Any other suggestion",
"start_date":"20 Nov 2018",
"end_date":"28 Nov 2018"
},
{
"question_type":"check",
"question_title":"Missing item",
"question":"Anything missing in the room?",
"check_options":["duster"],
"start_date":"20 Nov 2018",
"end_date":"30 Nov 2018",
"is_active":true
}
]
}
9 changes: 9 additions & 0 deletions test_data/resources_table.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"table_name": "resources",
"data": [
{
"name":"Markers",
"quantity":3
}
]
}
30 changes: 30 additions & 0 deletions test_data/responses_table.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"table_name": "responses",
"data": [
{
"question_id":1,
"room_id":1,
"question_type":"rate",
"created_date": "2019-11-30 16:20:24.885363",
"response":"1",
"resolved":false
},
{
"question_id":2,
"room_id":1,
"question_type":"check",
"created_date": "2019-11-30 16:20:24.885363",
"response":["marker pen", "apple tv"],
"resolved":true
},
{
"question_id":4,
"room_id":2,
"question_type":"check",
"created_date":"2019-11-30 16:20:24.885363",
"response":["duster"],
"resolved":true,
"state":"archived"
}
]
}
14 changes: 14 additions & 0 deletions test_data/roles_table.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"table_name": "roles",
"data": [
{
"role": "Admin"
},
{
"role": "Test"
},
{
"role": "Super Admin"
}
]
}
13 changes: 13 additions & 0 deletions test_data/room_tags_association_table.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"table_name": "room_tags",
"data": [
{
"tag_id": 1,
"room_id": 1
},
{
"tag_id": 1,
"room_id": 2
}
]
}
33 changes: 33 additions & 0 deletions test_data/rooms_table.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"table_name": "rooms",
"data": [
{
"name":"Entebbe",
"room_type":"meeting",
"capacity":6,
"location_id": 1,
"structure_id":"851ae8b3-48dd-46b5-89bc-ca3f8111ad87",
"calendar_id":"[email protected]",
"image_url":"https://www.officelovin.com/wp-content/uploads/2016/10/andela-office-main-1.jpg",
"room_labels":
[
"1st Floor",
"Wing A"
]
},
{
"name": "Tana",
"room_type": "meeting",
"capacity": 14,
"location_id":1,
"structure_id": "851ae8b3-48dd-46b5-89bc-ca3f8111ad87",
"calendar_id": "[email protected]",
"image_url": "https://www.officelovin.com/wp-content/uploads/2016/10/andela-office-main-1.jpg",
"room_labels": [
"1st Floor",
"Wing B"
]
}
]

}
15 changes: 15 additions & 0 deletions test_data/structures_table.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"table_name": "office_structures",
"data": [
{
"structure_id":"b05fc5f2-b4aa-4f48-a8fb-30bdcc3fc968",
"level":1,
"name":"Epic tower",
"parent_id":"1",
"parent_title":"parent_title",
"tag":"Building",
"location_id":1,
"position":1
}
]
}
15 changes: 15 additions & 0 deletions test_data/tags_table.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"table_name": "tags",
"data": [
{
"name":"Block-B",
"color":"green",
"description":"The description"
},
{
"name": "Block-C",
"color": "blue",
"description": "The description"
}
]
}
13 changes: 13 additions & 0 deletions test_data/users_roles_association_table.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"table_name": "users_roles",
"data": [
{
"user_id": 1,
"role_id": 1
},
{
"user_id": 2,
"role_id": 1
}
]
}
17 changes: 17 additions & 0 deletions test_data/users_table.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"table_name": "users",
"data": [
{
"email": "[email protected]",
"name": "Peter Walugembe",
"picture": "https://www.andela.com/walugembe",
"location": "Kampala"
},
{
"email":"[email protected]",
"name":"Peter Adeoye",
"picture":"https://www.andela.com/adeoye",
"location":"Lagos"
}
]
}
Loading