-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move "missing headers" test into new format
- Loading branch information
Showing
4 changed files
with
33 additions
and
18 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
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,33 @@ | ||
from pyxform_test_case import PyxformTestCase | ||
|
||
|
||
class MissingHeaders(PyxformTestCase): | ||
''' | ||
when survey and choices columns are missing headers, it is helpful to see | ||
an error message that prompts the user to include necessary headers. | ||
''' | ||
def test_missing_survey_headers(self): | ||
self.assertPyxformXform( | ||
md=""" | ||
| survey | | | | ||
| | select_one list | S1 | | ||
""", | ||
errored=True, | ||
error__contains=[ | ||
'missing important column headers', | ||
]) | ||
|
||
def test_missing_choice_headers(self): | ||
self.assertPyxformXform( | ||
md=""" | ||
| survey | | | | | ||
| | type | label | name | | ||
| | select_one list | S1 | s1 | | ||
| choices | | | | | ||
| | list | option a | a | | ||
| | list | option b | b | | ||
""", | ||
errored=True, | ||
error__contains=[ | ||
"has columns 'list name', 'name', and 'label'", | ||
]) |