Skip to content

Commit

Permalink
robotframework version not for 6
Browse files Browse the repository at this point in the history
  • Loading branch information
jensens committed Feb 21, 2022
1 parent e237998 commit b8b4fb8
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 29 deletions.
12 changes: 0 additions & 12 deletions base.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,6 @@ plone.batching = >=1.1.7
# plone.app.standardtiles = 2.3.1 # fix https://github.com/plone/plone.app.standardtiles/issues/111
pycodestyle =

# Robot Testing (see buildout.coredev[5.2]/versions.cfg)
plone.app.robotframework = 1.5.4
robotframework = 3.1.2
robotframework-python3 = 2.9
robotframework-debuglibrary = 1.2.1
robotframework-ride = 1.7.4.1
robotframework-seleniumlibrary = 3.3.1
robotframework-selenium2library = 3.0.0
robotframework-selenium2screenshots = 0.8.1
robotsuite = 2.2.1
selenium = 3.141.0

[versions:python27]
# to get codeanalysis working
build = 0.1
Expand Down
29 changes: 14 additions & 15 deletions src/collective/collectionfilter/vocabularies.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
# Use this EMPTY_MARKER for your custom indexer to index empty criterions.
EMPTY_MARKER = "__EMPTY__"
TEXT_IDX = "SearchableText"
INTEGER_IDXS = []
GEOLOC_IDX = [
"latitude",
"longitude",
Expand Down Expand Up @@ -59,7 +60,12 @@
] + GEOLOC_IDX # latitude/longitude is handled as a range filter ... see query.py # noqa
DEFAULT_FILTER_TYPE = "single"
LIST_SCALING = ["No Scaling", "Linear", "Logarithmic"]

TRUTHY = [
safe_encode("true"),
safe_encode("1"),
safe_encode("t"),
safe_encode("yes"),
]

def translate_value(value, *args, **kwargs):
return translate(_(value), context=getRequest())
Expand All @@ -71,30 +77,20 @@ def translate_messagefactory(value, *args, **kwargs):

def make_bool(value):
"""Transform into a boolean value."""
truthy = [
safe_encode("true"),
safe_encode("1"),
safe_encode("t"),
safe_encode("yes"),
]

if value is None:
return
if isinstance(value, bool):
return value
value = safe_encode(value)
value = value.lower()
if value in truthy:
return True
else:
return False
value = safe_encode(value).lower()
return value in TRUTHY


def yes_no(value):
"""Return i18n message for a value."""
if value:
return _(u"Yes")
else:
return _(u"No")
return _(u"No")


def get_yes_no_title(item, *args, **kwargs):
Expand Down Expand Up @@ -156,6 +152,9 @@ def groupby(self):
index_modifier = make_bool
display_modifier = get_yes_no_title

if idx in INTEGER_IDXS:
index_modifier = int

# for portal_type or Type we have some special sauce as we need to translate via fti.i18n_domain. # noqa
if it == "portal_type":
display_modifier = translate_portal_type
Expand Down
13 changes: 12 additions & 1 deletion test-5.0.x.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,15 @@ plone.jsonserializer = 0.9.6

plone.formwidget.geolocation = < 2.2.2 # Introduced a dep on CMFPlone 5.2

six = 1.16.0
six = 1.16.0

plone.app.robotframework = 1.5.4
robotframework = 3.1.2
robotframework-python3 = 2.9
robotframework-debuglibrary = 1.2.1
robotframework-ride = 1.7.4.1
robotframework-seleniumlibrary = 3.3.1
robotframework-selenium2library = 3.0.0
robotframework-selenium2screenshots = 0.8.1
robotsuite = 2.2.1
selenium = 3.141.0
13 changes: 12 additions & 1 deletion test-5.1.x.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,15 @@ configparser = 3.8.1

plone.formwidget.geolocation = < 2.2.2 # Introduced a dep on CMFPlone 5.2

six = 1.16.0
six = 1.16.0

plone.app.robotframework = 1.5.4
robotframework = 3.1.2
robotframework-python3 = 2.9
robotframework-debuglibrary = 1.2.1
robotframework-ride = 1.7.4.1
robotframework-seleniumlibrary = 3.3.1
robotframework-selenium2library = 3.0.0
robotframework-selenium2screenshots = 0.8.1
robotsuite = 2.2.1
selenium = 3.141.0
12 changes: 12 additions & 0 deletions test-5.2.x.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,17 @@ test-eggs =
extensions +=
flake8-black

[versions]
plone.app.robotframework = 1.5.4
robotframework = 3.1.2
robotframework-python3 = 2.9
robotframework-debuglibrary = 1.2.1
robotframework-ride = 1.7.4.1
robotframework-seleniumlibrary = 3.3.1
robotframework-selenium2library = 3.0.0
robotframework-selenium2screenshots = 0.8.1
robotsuite = 2.2.1
selenium = 3.141.0

[versions:python3]
coverage = >=3.7

0 comments on commit b8b4fb8

Please sign in to comment.