Skip to content

Commit

Permalink
Added tests to check that adding package name to draw/signature/selfi…
Browse files Browse the repository at this point in the history
…e image questions is ignored
  • Loading branch information
grzesiek2010 committed Sep 22, 2023
1 parent 4471353 commit 257d33e
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions tests/test_image_app_parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,55 @@ def test_invalid_android_package_name(self):
""",
error__contains=["Invalid Android package name format"],
)

def test_adding_android_package_name_in_annotate_image(self):
self.assertPyxformXform(
name="data",
md="""
| survey | | | | | |
| | type | name | label | parameters | appearance |
| | image | my_image | Image | app=com.jeyluta.timestampcamerafree | annotate |
""",
xml__xpath_match=[
"/h:html/h:body/x:upload[@intent='com.jeyluta.timestampcamerafree' and @mediatype='image/*' and @ref='/data/my_image']"
],
)

def test_ignoring_android_package_name_in_signature_image(self):
self.assertPyxformXform(
name="data",
md="""
| survey | | | | | |
| | type | name | label | parameters | appearance |
| | image | my_image | Image | app=com.jeyluta.timestampcamerafree | signature |
""",
xml__xpath_match=[
"/h:html/h:body/x:upload[@mediatype='image/*' and @ref='/data/my_image']"
],
)

def test_ignoring_valid_android_package_name_in_draw_image(self):
self.assertPyxformXform(
name="data",
md="""
| survey | | | | | |
| | type | name | label | parameters | appearance |
| | image | my_image | Image | app=com.jeyluta.timestampcamerafree | draw |
""",
xml__xpath_match=[
"/h:html/h:body/x:upload[@mediatype='image/*' and @ref='/data/my_image']"
],
)

def test_ignoring_valid_android_package_name_in_draw_image(self):
self.assertPyxformXform(
name="data",
md="""
| survey | | | | | |
| | type | name | label | parameters | appearance |
| | image | my_image | Image | app=com.jeyluta.timestampcamerafree | new-front |
""",
xml__xpath_match=[
"/h:html/h:body/x:upload[@mediatype='image/*' and @ref='/data/my_image']"
],
)

0 comments on commit 257d33e

Please sign in to comment.