summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Šplíchal <psplicha@redhat.com>2011-08-18 10:58:55 +0200
committerPetr Šplíchal <psplicha@redhat.com>2011-08-18 10:58:55 +0200
commit5d8dc98302c2f264f9fddd08c634cb58a76ab6a6 (patch)
tree7594c4d1d393a90ebf51bb0db115260e9ff18af2
parent9a1e549f64d3b531902de8121b2863b5d913efe1 (diff)
downloadpython-nitrate-5d8dc98302c2f264f9fddd08c634cb58a76ab6a6.tar.gz
python-nitrate-5d8dc98302c2f264f9fddd08c634cb58a76ab6a6.tar.xz
python-nitrate-5d8dc98302c2f264f9fddd08c634cb58a76ab6a6.zip
Nitrate: Made 'listed' public as it's useful for others
-rw-r--r--Nitrate.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/Nitrate.py b/Nitrate.py
index b2b1f9a..7d3633b 100644
--- a/Nitrate.py
+++ b/Nitrate.py
@@ -212,7 +212,7 @@ def _setter(field):
# Various Utilities
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-def _listed(items, quote=""):
+def listed(items, quote=""):
""" Convert provided iterable into a nice, human readable list. """
items = ["{0}{1}{0}".format(quote, item) for item in items]
@@ -1197,11 +1197,11 @@ class Container(Mutable):
if self._items:
# List of identifiers
try:
- return _listed(sorted(
+ return listed(sorted(
[item.identifier for item in self._items]))
# If no identifiers, just join strings
except AttributeError:
- return _listed(self._items, quote="'")
+ return listed(self._items, quote="'")
else:
return "[None]"
@@ -1497,13 +1497,13 @@ class PlanTags(Container):
def _add(self, tags):
""" Attach provided tags to the test plan. """
log.info("Tagging {0} with {1}".format(
- self._identifier, _listed(tags, quote="'")))
+ self._identifier, listed(tags, quote="'")))
self._server.TestPlan.add_tag(self.id, list(tags))
def _remove(self, tags):
""" Detach provided tags from the test plan. """
log.info("Untagging {0} of {1}".format(
- self._identifier, _listed(tags, quote="'")))
+ self._identifier, listed(tags, quote="'")))
self._server.TestPlan.remove_tag(self.id, list(tags))
@@ -1525,13 +1525,13 @@ class RunTags(Container):
def _add(self, tags):
""" Attach provided tags to the test run. """
log.info("Tagging {0} with {1}".format(
- self._identifier, _listed(tags, quote="'")))
+ self._identifier, listed(tags, quote="'")))
self._server.TestRun.add_tag(self.id, list(tags))
def _remove(self, tags):
""" Detach provided tags from the test run. """
log.info("Untagging {0} of {1}".format(
- self._identifier, _listed(tags, quote="'")))
+ self._identifier, listed(tags, quote="'")))
self._server.TestRun.remove_tag(self.id, list(tags))
@@ -1553,13 +1553,13 @@ class CaseTags(Container):
def _add(self, tags):
""" Attach provided tags to the test case. """
log.info("Tagging {0} with {1}".format(
- self._identifier, _listed(tags, quote="'")))
+ self._identifier, listed(tags, quote="'")))
self._server.TestCase.add_tag(self.id, list(tags))
def _remove(self, tags):
""" Detach provided tags from the test case. """
log.info("Untagging {0} of {1}".format(
- self._identifier, _listed(tags, quote="'")))
+ self._identifier, listed(tags, quote="'")))
self._server.TestCase.remove_tag(self.id, list(tags))
@@ -1789,7 +1789,7 @@ class TestPlans(Container):
def _add(self, plans):
""" Link provided plans to the test case. """
log.info("Linking {1} to {0}".format(self._identifier,
- _listed([plan.identifier for plan in plans])))
+ listed([plan.identifier for plan in plans])))
self._server.TestCase.link_plan(self.id, [plan.id for plan in plans])
def _remove(self, plans):
@@ -2315,7 +2315,7 @@ class TestCases(Container):
def _add(self, cases):
""" Link provided cases to the test plan. """
log.info("Linking {1} to {0}".format(self._identifier,
- _listed([case.identifier for case in cases])))
+ listed([case.identifier for case in cases])))
self._server.TestCase.link_plan([case.id for case in cases], self.id)
def _remove(self, cases):