-
Notifications
You must be signed in to change notification settings - Fork 2
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 #153 from digital-land/add_severity
Adding severity column functionality in log
- Loading branch information
Showing
3 changed files
with
49 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
issue-type,severity,name,description,responsibility | ||
type1,sev1,test,desc1,internal | ||
type2,sev2,test,desc2,internal |
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,23 @@ | ||
import pytest | ||
from digital_land.log import IssueLog | ||
|
||
test_collection_dir = "tests/data" | ||
|
||
|
||
@pytest.fixture | ||
def sample_issue_log_csv_path(): | ||
return test_collection_dir + "/specification/issue-type.csv" | ||
|
||
|
||
def test_add_severity_column(sample_issue_log_csv_path): | ||
issue = IssueLog() | ||
issue.log_issue("tesr", "type1", "value1") | ||
|
||
# Confirm 'severity' field is not added to the fieldnames beforehand | ||
assert "severity" not in issue.fieldnames | ||
|
||
issue.add_severity_column(sample_issue_log_csv_path) | ||
|
||
# Check if the 'severity' field is added to fieldnames | ||
assert "severity" in issue.fieldnames | ||
assert issue.rows[0]["severity"] == "sev1" |