-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from TheManWhoLikesToCode/51-p2-file-mangement…
…-test-coverage-increase 51 p2 file management test coverage increase
- Loading branch information
Showing
21 changed files
with
718 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
backend/client_secrets.json | ||
backend/.env | ||
backend/credentials.json | ||
backend/support/.DS_Store | ||
|
||
client_secrets.json | ||
mycreds.txt | ||
backend/.env | ||
|
||
frontend/.env | ||
frontend/.DS_Store | ||
|
||
*.pyc | ||
*.DS_Store | ||
backend/support/.DS_Store | ||
|
||
credentials.json | ||
backend/credentials.json | ||
|
||
.DS_Store | ||
frontend/.DS_Store | ||
backend/support/.DS_Store | ||
frontend/.DS_Store | ||
frontend/.DS_Store | ||
.DS_Store | ||
frontend/.DS_Store | ||
*.env | ||
|
||
*.env | ||
|
||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
Feature: Backend Flask App - Login | ||
In order to protect directory | ||
As a system | ||
I want users to have to login | ||
|
||
Scenario: Successful Login | ||
Given the app is running | ||
When I pass valid credentials to the login endpoint | ||
Then the response of "200" and "Logged in successfully" should be returned | ||
And cookies should be set | ||
|
||
Scenario: Unsuccessful Login - Incorrect username and password | ||
Given the app is running | ||
When I pass an incorrect username and password to the login endpoint | ||
Then the response of "401" and "The username you entered cannot be identified." should be returned | ||
|
||
Scenario: Unsuccessful Login - Incorrect password | ||
Given the app is running | ||
When I pass an incorrect password to the login endpoint | ||
Then the response of "401" and "The password you entered was incorrect." should be returned | ||
|
||
Scenario: Unsuccessful Login - Incorrect username | ||
Given the app is running | ||
When I pass an incorrect username to the login endpoint | ||
Then the response of "401" and "The username you entered cannot be identified." should be returned | ||
|
||
Scenario: Unsuccessful Login - Missing password | ||
Given the app is running | ||
When I pass only a username to the login endpoint | ||
Then the response of "400" and "Missing username or password" should be returned | ||
|
||
Scenario: Unsuccessful Login - Missing username | ||
Given the app is running | ||
When I pass only a password to the login endpoint | ||
Then the response of "400" and "Missing username or password" should be returned | ||
|
||
Scenario: Unsuccessful Login - Missing username and password | ||
Given the app is running | ||
When I pass no credentials to the login endpoint | ||
Then the response of "400" and "Missing username or password" should be returned | ||
|
||
Scenario: Unsuccessful Login - Invalid JSON Format in Request | ||
Given the app is running | ||
When I pass data in an invalid JSON format to the login endpoint | ||
Then the response of "400" and "Invalid JSON format" should be returned | ||
|
||
Scenario: Already Logged In | ||
Given the app is running | ||
And the user is already logged in | ||
When I pass valid credentials to the login endpoint | ||
Then the response of "200" and "Already logged in" should be returned |
16 changes: 16 additions & 0 deletions
16
backend/features/bb_session_enable_instructors_and_time.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Feature: Blackboard Session - Enable Insturctors and Time | ||
In order to correctly name courses | ||
As a system | ||
I want to enable instructors and course season | ||
|
||
Scenario: Enable instructors when logged in | ||
Given I have valid credentials | ||
And I am logged in | ||
When I enable instructors | ||
Then the enable instructors response should be "Instructors enabled" | ||
|
||
Scenario: Enable instructors when not logged in | ||
Given I have invalid username and password | ||
And I am not logged in | ||
When I enable instructors | ||
Then the enable instructors response should be "Not logged in." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Feature: Blackboard Session - Get Courses | ||
In order to archive courses for the user | ||
As a system | ||
I want to get courses | ||
|
||
Scenario: Get courses when logged in | ||
Given I have valid credentials | ||
And I am logged in | ||
When I get courses | ||
Then the get courses response should be "Courses retrieved" | ||
|
||
Scenario: Get courses when not logged in | ||
Given I have invalid username and password | ||
And I am not logged in | ||
When I get courses | ||
Then the get courses response should be "Not logged in." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Feature: Blackboard Session - Get Download Tasks | ||
In order to return the courses to the user | ||
As a system | ||
I want to get the download tasks | ||
|
||
Scenario: Get download tasks when logged in | ||
Given I have valid credentials | ||
And I am logged in | ||
When I get download tasks | ||
Then the get download tasks response should be "Download tasks retrieved" | ||
|
||
Scenario: Get download tasks when not logged in | ||
Given I have invalid username and password | ||
And I am not logged in | ||
When I get download tasks | ||
Then the get download tasks response should be "Not logged in." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Feature: Blackboard Session - Login | ||
In order to access Blackboard | ||
As a system | ||
I want to login | ||
|
||
Scenario: Valid credentials login | ||
Given I have valid credentials | ||
When I login | ||
Then the response should be "Login successful." | ||
|
||
Scenario: Invalid both username and password | ||
Given I have invalid username and password | ||
When I login | ||
Then the response should be "The username you entered cannot be identified." | ||
|
||
Scenario: I attempt to login when already logged in | ||
Given I have valid credentials | ||
And I am logged in | ||
When I login | ||
Then the response should be "Already logged in." |
15 changes: 15 additions & 0 deletions
15
backend/features/bb_session_manager_creating_sessions.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Feature: Blackboard Sesssion Manager - Creating a new session for a user | ||
In order to use blackboard | ||
As a user | ||
I want to create a new session | ||
|
||
Scenario: Creating a new blackboard session for a user | ||
Given a blackboard session manager | ||
When I request a session for user "Alice" | ||
Then a new session should be created for "Alice" | ||
|
||
Scenario: Storing a blackboard session for a user | ||
Given a blackboard session manager | ||
And a blackboard session for user "Charlie" | ||
When I store the session for user "Charlie" | ||
Then the session for "Charlie" should be stored in the manager |
27 changes: 27 additions & 0 deletions
27
backend/features/bb_session_manager_deleting_sessions.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Feature: Blackboard Session Manager - Deleting Sessions | ||
In order to correctly delete user data | ||
As a system | ||
I want to delete blackboard sessions | ||
|
||
Scenario: Deleting a blackboard session for a user | ||
Given a blackboard session manager | ||
And an existing session for user "Eve" | ||
When I delete the session for user "Eve" | ||
Then the session for "Eve" should be removed | ||
|
||
Scenario: Cleaning up inactive sessions | ||
Given a blackboard session manager | ||
And inactive sessions older than 3600 seconds | ||
When I clean up inactive sessions | ||
Then all sessions older than 3600 seconds should be removed | ||
|
||
Scenario: Attempting to delete a session for a non-existent user | ||
Given a blackboard session manager | ||
When I delete the session for user "NonExistentUser" | ||
Then no session should be removed | ||
|
||
Scenario: Cleaning up with no inactive sessions | ||
Given a blackboard session manager | ||
And no inactive sessions | ||
When I clean up inactive sessions | ||
Then no session should be removed |
10 changes: 10 additions & 0 deletions
10
backend/features/bb_session_manager_modifying_sessions.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Feature: Blackboard session management - Modifying users sessions | ||
In order to modify users sessions to keep them alive | ||
As a blackboard administrator | ||
I want to be able to modify users sessions | ||
|
||
Scenario: Updating the last activity time of a session | ||
Given a blackboard session manager | ||
And an existing session for user "George" | ||
When I update the last activity time for "George"'s session | ||
Then the last activity time for "George"'s session should be updated |
38 changes: 38 additions & 0 deletions
38
backend/features/bb_session_manager_retrieving_sessions.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
Feature: Blackboard Session Manager: Retrieving a session | ||
In order to keep track of users | ||
As a system | ||
I want to be able to retrieve a blackboard session for a user | ||
|
||
Scenario: Retrieving an existing blackboard session for a user | ||
Given a blackboard session manager | ||
And an existing session for user "Bob" | ||
When I request a session for user "Bob" | ||
Then the existing session for "Bob" should be returned | ||
|
||
Scenario: Retrieving a blackboard session by username | ||
Given a blackboard session manager | ||
And an existing session for user "David" | ||
When I retrieve a session by username "David" | ||
Then the session for "David" should be returned | ||
|
||
Scenario: Retrieving a blackboard session by session ID | ||
Given a blackboard session manager | ||
And an existing session with ID "session123" | ||
When I retrieve a session by session ID "session123" | ||
Then the session with ID "session123" should be returned | ||
|
||
Scenario: Attempting to retrieve a session for a non-existent user | ||
Given a blackboard session manager | ||
When I retrieve a session by username "NonExistentUser" | ||
Then no session should be returned | ||
|
||
Scenario: Attempting to retrieve a session with a non-existent session ID | ||
Given a blackboard session manager | ||
When I retrieve a session by session ID "nonExistentSession123" | ||
Then no session should be returned | ||
|
||
Scenario: Multiple users sharing the same session ID | ||
Given a blackboard session manager | ||
And an existing session with ID "sharedSession123" for users "Harry" and "Irene" | ||
When I retrieve a session by session ID "sharedSession123" | ||
Then the same session should be returned for both "Harry" and "Irene" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from app import app | ||
|
||
def before_all(context): | ||
context.client = app.test_client() | ||
|
||
def after_scenario(context, scenario): | ||
context.client.post('/logout') |
Oops, something went wrong.