Lines Matching defs:action
35 import pkg.actions as action
93 def assertAttributeValue(self, action, attr, value):
94 attrs = action.attrs[attr]
107 def assertAttributes(self, action, attrlist):
108 if sorted(action.attrs.keys()) != sorted(attrlist):
112 Actual: {1}""".format(sorted(attrlist), sorted(action.attrs.keys())))
115 action.fromstr("file 12345 name=foo path=/tmp/foo")
116 action.fromstr("file 12345 name=foo attr=bar path=/tmp/foo")
117 action.fromstr("file 12345 name=foo attr=bar attr=bar path=/tmp/foo")
119 action.fromstr("file 12345 name=foo path=/tmp/foo attr=bar")
120 action.fromstr("file 12345 name=foo path=/tmp/foo attr=bar ")
121 action.fromstr("file 12345 name=foo path=/tmp/foo attr=bar ")
123 action.fromstr("file 12345 name=\"foo bar\" path=\"/tmp/foo\" attr=\"bar baz\"")
124 action.fromstr("file 12345 name=\"foo bar\" path=\"/tmp/foo\" attr=\"bar baz\"")
126 action.fromstr("file 12345 name=foo value=barbaz path=/tmp/foo")
127 action.fromstr("file 12345 name=foo value=\"bar baz\" path=/tmp/foo")
128 action.fromstr("file 12345 name=\"foo bar\" value=baz path=/tmp/foo")
130 action.fromstr("file 12345 name=foo value=barbazquux path=/tmp/foo")
131 action.fromstr("file 12345 name=foo value=\"bar baz quux\" path=/tmp/foo")
132 action.fromstr("file 12345 name=\"foo bar baz\" value=quux path=/tmp/foo")
134 action.fromstr("file 12345 name=\"foo\" value=\"bar\" path=/tmp/foo")
135 action.fromstr("file 12345 name=foo value=\"bar\" path=/tmp/foo")
136 action.fromstr("file 12345 name=\"foo\" value=bar path=/tmp/foo")
138 action.fromstr("signature 12345 algorithm=foo")
144 a = action.fromstr("set pkg.obsolete=true")
145 a2 = action.fromstr("set name=pkg.obsolete value=true")
152 a = action.fromstr("file 12345 name='foo' value=bar path=/tmp/foo")
160 a = action.fromstr("file 12345 name='f\"o\"o' value=bar path=/tmp/foo")
168 a = action.fromstr("file 12345 name='f\\'o\\'o' value=bar path=/tmp/foo")
176 a = action.fromstr("file 12345 name=foo\tvalue=bar path=/tmp/foo")
184 a = action.fromstr("file 12345 name=foo\"bar path=/tmp/foo")
190 a = action.fromstr("file 12345 name=foo\"bar\"baz path=/tmp/foo")
196 a = action.fromstr("file 12345 name=foo\\ path=/tmp/foo")
201 # An action with multiple identical attribute names should
203 a = action.fromstr("driver alias=pci1234,56 alias=pci4567,89 class=scsi name=lsimega")
207 # An action with an empty value.
208 a = action.fromstr('set name=foo value=""')
213 # An action with an empty value as part of a list.
214 a = action.fromstr('set name=foo value=ab value="" value=c')
219 # An action with its key attribute and extra attributes that
221 a = action.fromstr('license license="Common Development and '
232 a = action.fromstr(r'set name=pkg.description value="Sphinx is a tool that makes it easy to create intelligent \"and beautiful documentation f\"or Python projects (or \"other documents consisting of\" multiple reStructuredText so\"urces), written by Georg Bran\"dl. It was originally created\" to translate the new Python \"documentation, but has now be\"en cleaned up in the hope tha\"t it will be useful to many o\"ther projects. Sphinx uses re\"StructuredText as its markup \"language, and many of its str\"engths come from the power an\"d straightforwardness of reSt\"ructuredText and its parsing \"and translating suite, the Do\"cutils. Although it is still \"under constant development, t\"he following features are alr\"eady present, work fine and c\"an be seen \"in action\" \"in the Python docs: * Output \"formats: HTML (including Wind\"ows HTML Help) and LaTeX, for\" printable PDF versions * Ext\"ensive cross-references: sema\"ntic markup and automatic lin\"ks for functions, classes, gl\"ossary terms and similar piec\"es of information * Hierarchi\"cal structure: easy definitio\"n of a document tree, with au\"tomatic links to siblings, pa\"rents and children * Automati\"c indices: general index as w\"ell as a module index * Code \"handling: automatic highlight\"ing using the Pygments highli\"ghter * Various extensions ar\"e available, e.g. for automat\"ic testing of snippets and in\"clusion of appropriately formatted docstrings."')
235 # Make sure that the hash member of the action object properly
237 a = action.fromstr("file hash=abc123 path=usr/bin/foo mode=0755 owner=root group=bin")
241 """Test license action attributes."""
245 a = action.fromstr('license license="Common Development and '
251 a = action.fromstr('license license="Common Development and '
257 a = action.fromstr('license license="Common Development and '
263 a = action.fromstr('license license="Common Development and '
269 """Private helper function for action stringification
271 act = action.fromstr(astr)
278 get an identical action back (excluding a few cases detailed in
283 a = action.fromstr(s)
285 a2 = action.fromstr(s2)
297 a = action.fromstr(s)
301 a2 = action.fromstr(s2)
316 a = action.fromstr(astr.format(k))
317 self.assertTrue(action.fromstr(str(a)) == a)
322 # action in the tests below to ensure that the attributes were
349 # action type.
359 # parse an action with a multi-value attribute that
379 sig_act = action.fromstr(
382 # action.sig_str should return an identical string each
384 # sig_str so produce the same action.
385 a = action.fromstr(s)
389 # action, so there is no output to parse.
393 a2 = action.fromstr(s2)
404 a = action.fromstr(self.act_strings[0])
407 # Test that the sig_str of a signature action other than the
408 # argument action is None.
409 sig_act2 = action.fromstr(
420 action.fromstr(text)
421 except action.MalformedActionError as e:
427 # If the action isn't malformed, something is wrong.
434 action.fromstr(text)
435 except action.InvalidActionError:
438 # If the action isn't invalid, something is wrong.
442 # Unknown action type
443 self.assertRaises(action.UnknownActionError, action.fromstr,
445 self.assertRaises(action.UnknownActionError, action.fromstr,
448 # Nothing but the action type or type is malformed.
503 self.assertRaises(action.InvalidActionError, action.fromstr,
507 self.assertRaises(action.InvalidActionError, action.fromstr,
511 # exception action strings.
516 self.assertRaises(action.InvalidActionError, action.fromstr,
522 action.fromstr("file abc123 hash=abc123 path=usr/bin/foo mode=0755 owner=root group=bin")
525 """Verify that action validate() works as expected; currently
526 only used during publication or action execution failure."""
532 error=action.InvalidActionAttributesError):
533 bad_act = action.fromstr(astr)
558 # Multiple values never allowed for depend action 'type' attribute.
593 # Verify multiple values aren't allowed for legacy action
691 # Verify signature action attribute 'value' is required during
724 act = action.fromstr(