Tests¶

Utilities¶

Some important (and often-used) utility functions.

tests.util.create_test_admin(slack_id)¶

Create a test admin user with slack id, and with all other attributes set.

Property Preset
Slack ID slack_id
Bio I like puppies and kittens!
Email admin@ubc.ca
Name Iemann Atmin
Github kibbles
Image URL https://via.placeholder.com/150
Major Computer Science
Permission Admin
Position Adrenaline Junkie
Parameters:slack_id (str) – The slack id string
Return type:User
Returns:a filled-in user model (no empty strings)
tests.util.create_test_project(github_team_id, github_urls)¶

Create a test project with project ID, URLs, and all other attributes set.

Property Preset
ID SHA1(github_urls[0], time.time())
Team ID github_team_id
Github URLs github_urls
Display Name Rocket2
Short Descrip. Slack bot, team management, and onboarding system for…
Long Descrip. Slack bot, team management, and onboarding system for…
Tags python, docker, pipenv, waterboarding
Website https://github.com/ubclaunchpad/rocket2
Appstore URL ¯\_(ツ)_/¯
Playstore URL ¯\_(ツ)_/¯
Parameters:
  • github_team_id (str) – The Github team ID
  • github_urls (List[str]) – The URLs to all connected projects
Return type:

Project

Returns:

a filled-in project model (no empty strings)

tests.util.create_test_team(tid, team_name, display_name)¶

Create a test team with team name, and with all other attributes the same.

Property Preset
Github tid
Name slug team_name
Display display_name
Platform slack
Members [‘abc_123’]
Parameters:
  • tid (str) – The github ID associated with the team
  • team_name (str) – The github team name slug
  • display_name (str) – The github team name
Return type:

Team

Returns:

a filled-in team model (no empty strings)