Skip to content
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

Add pyxform.test_utils into pyxform packaging #600

Closed
wants to merge 1 commit into from
Closed
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
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from pyxform.utils import NSMAP
from pyxform.validators.odk_validate import ODKValidateError, check_xform
from pyxform.xls2json import workbook_to_json
from tests.test_utils.md_table import md_table_to_ss_structure
from pyxform.test_utils.md_table import md_table_to_ss_structure

logger = logging.getLogger(__name__)
logger.addHandler(logging.StreamHandler())
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
packages=find_packages(exclude=["tests", "tests.*"]),
package_data={
"pyxform.validators.odk_validate": ["bin/*.*"],
"pyxform": ["iana_subtags.txt"],
"pyxform": ["iana_subtags.txt", "test_utils"],
},
url="http://pypi.python.org/pypi/pyxform/",
description="A Python package to create XForms for ODK Collect.",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_allow_mock_accuracy.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


class GeoParameterTest(PyxformTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
AreaTest - test enclosed-area(geo_shape) calculation.
"""
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


class AreaTest(PyxformTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_audio_quality.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


class AudioQualityTest(PyxformTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
AuditTest - test audit question type.
"""
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


class AuditTest(PyxformTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_background_audio.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


class BackgroundAudioTest(PyxformTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_bind_conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
BindConversionsTest - test bind conversions.
"""
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


class BindConversionsTest(PyxformTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_bug_missing_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Test missing headers in XLSForm.
"""
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


class MissingHeaders(PyxformTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_bug_round_calculation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Test round(number, precision) calculation.
"""
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


class RoundCalculationTest(PyxformTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_choices_sheet.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


class ChoicesSheetTest(PyxformTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_custom_xml_namespaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Test custom namespaces.
"""
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase

MD = """
| survey | | | |
Expand Down
2 changes: 1 addition & 1 deletion tests/test_dynamic_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Test handling dynamic default in forms
"""

from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


class DynamicDefaultTests(PyxformTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_external_instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from textwrap import dedent

from pyxform.errors import PyXFormError
from tests.pyxform_test_case import PyxformTestCase, PyxformTestError
from pyxform.test_utils.pyxform_test_case import PyxformTestCase, PyxformTestError


class ExternalInstanceTests(PyxformTestCase):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_external_instances_for_selects.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from pyxform.constants import EXTERNAL_INSTANCE_EXTENSIONS
from pyxform.errors import PyXFormError
from pyxform.xls2xform import get_xml_path, xls2xform_convert
from tests.pyxform_test_case import PyxformTestCase
from tests.test_utils.md_table import md_table_to_workbook
from pyxform.test_utils.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.md_table import md_table_to_workbook
from tests.utils import get_temp_dir


Expand Down
2 changes: 1 addition & 1 deletion tests/test_fieldlist_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Test field-list labels
"""
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


class FieldListLabels(PyxformTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Test duplicate survey question field name.
"""
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


class FieldsTests(PyxformTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Test file question type.
"""
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


class FileWidgetTest(PyxformTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_for_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Test loop question type.
"""
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


class TestLoop(PyxformTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_form_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Test setting form name to data.
"""
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


class FormNameTest(PyxformTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_geo.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Test geo widgets.
"""
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


class GeoWidgetsTest(PyxformTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Test XForm groups.
"""
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


class GroupsTests(PyxformTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_guidance_hint.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Guidance hint test module.
"""
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


class GuidanceHintTest(PyxformTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_language_warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import os
import tempfile

from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


class LanguageWarningTest(PyxformTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_last_saved.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
The last-saved virtual instance can be queried to get values from the last saved instance of the form being authored.
"""
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


class LastSavedTest(PyxformTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_max_pixels.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Test image max-pixel parameters.
"""
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


class MaxPixelsTest(PyxformTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import os
import tempfile

from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


class MetadataTest(PyxformTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_osm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Test OSM widgets.
"""
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase

expected_xml_output = """
<upload mediatype="osm/*" ref="/osm/osm_building">
Expand Down
2 changes: 1 addition & 1 deletion tests/test_pyxform_test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from dataclasses import dataclass
from typing import TYPE_CHECKING

from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase

if TYPE_CHECKING:
from typing import Set
Expand Down
2 changes: 1 addition & 1 deletion tests/test_pyxformtestcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Ensuring that the pyxform_test_case.PyxformTestCase class does some
internal conversions correctly.
"""
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


class PyxformTestCaseNonMarkdownSurveyAlternatives(PyxformTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_randomize_itemsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Test randomize itemsets.
"""
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


class RandomizeItemsetsTest(PyxformTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_range.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Test range widget.
"""
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


class RangeWidgetTest(PyxformTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_rank.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Test rank widget.
"""
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


class RangeWidgetTest(PyxformTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_repeat.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Test reapeat structure.
"""
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


class TestRepeat(PyxformTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_repeat_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Test repeat template and instance structure.
"""
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


class TestRepeatTemplate(PyxformTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_secondary_instance_translations.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Testing inlining translation when no translation is specified.
"""
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


class TestSecondaryInstanceTest(PyxformTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_set_geopoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Test setgeopoint widget.
"""
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


class SetGeopointTest(PyxformTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_settings_auto_send_delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Test settins auto settings.
"""
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


class SettingsAutoSendDelete(PyxformTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_sheet_columns.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Test XLSForm sheet names.
"""
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase
from tests.utils import prep_for_xml_contains


Expand Down
2 changes: 1 addition & 1 deletion tests/test_sms.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Test sms syntax.
"""
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


class SMSTest(PyxformTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_static_defaults.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


class StaticDefaultTests(PyxformTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_survey.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


class TestSurvey(PyxformTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_table_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Test table list appearance syntax.
"""
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase

MD = '''
| survey | | | | | |
Expand Down
2 changes: 1 addition & 1 deletion tests/test_translations.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from pyxform.validators.pyxform.missing_translations_check import (
format_missing_translations_msg,
)
from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


@dataclass()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Test handling setvalue of 'trigger' column in forms
"""

from tests.pyxform_test_case import PyxformTestCase
from pyxform.test_utils.pyxform_test_case import PyxformTestCase


class TriggerSetvalueTests(PyxformTestCase):
Expand Down
Loading