Debian Codegraph @

tests/test_cli.py

raw
1 # vim: set ft=python ts=4 sw=4 expandtab:
2 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
3 #
4 # C E D A R
5 # S O L U T I O N S "Software done right."
6 # S O F T W A R E
7 #
8 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
9 #
10 # Copyright (c) 2004-2005,2007,2010,2015 Kenneth J. Pronovici.
11 # All rights reserved.
12 #
13 # This program is free software; you can redistribute it and/or
14 # modify it under the terms of the GNU General Public License,
15 # Version 2, as published by the Free Software Foundation.
16 #
17 # This program is distributed in the hope that it will be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 #
21 # Copies of the GNU General Public License are available from
22 # the Free Software Foundation website, http://www.gnu.org/.
23 #
24 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
25 #
26 # Author : Kenneth J. Pronovici <[email protected]>
27 # Language : Python 3
28 # Project : Cedar Backup, release 3
29 # Purpose : Tests command-line interface functionality.
30 #
31 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
32
33 ########################################################################
34 # Module documentation
35 ########################################################################
36
37 """
38 Unit tests for CedarBackup3/cli.py.
39
40 Code Coverage
41 =============
42
43 This module contains individual tests for the many of the public functions
44 and classes implemented in cli.py. Where possible, we test functions that
45 print output by passing a custom file descriptor. Sometimes, we only ensure
46 that a function or method runs without failure, and we don't validate what
47 its result is or what it prints out.
48
49 Naming Conventions
50 ==================
51
52 I prefer to avoid large unit tests which validate more than one piece of
53 functionality, and I prefer to avoid using overly descriptive (read: long)
54 test names, as well. Instead, I use lots of very small tests that each
55 validate one specific thing. These small tests are then named with an index
56 number, yielding something like ``testAddDir_001`` or ``testValidate_010``.
57 Each method has a docstring describing what it's supposed to accomplish. I
58 feel that this makes it easier to judge how important a given failure is,
59 and also makes it somewhat easier to diagnose and fix individual problems.
60
61 Full vs. Reduced Tests
62 ======================
63
64 All of the tests in this module are considered safe to be run in an average
65 build environment. There is a no need to use a CLITESTS_FULL environment
66 variable to provide a "reduced feature set" test suite as for some of the
67 other test modules.
68
69 @author Kenneth J. Pronovici <[email protected]>
70 """
71
72
73 ########################################################################
74 # Import modules and do runtime validations
75 ########################################################################
76
77 import unittest
78 from getopt import GetoptError
79 from os.path import exists, isabs, isdir, isfile, islink
80
81 from CedarBackup3.action import executeCollect, executePurge, executeRebuild, executeStage, executeStore, executeValidate
82 from CedarBackup3.cli import Options, _ActionSet, _diagnostics, _usage, _version
83 from CedarBackup3.config import (
84 ActionDependencies,
85 ExtendedAction,
86 ExtensionsConfig,
87 LocalPeer,
88 OptionsConfig,
89 PeersConfig,
90 PostActionHook,
91 PreActionHook,
92 RemotePeer,
93 )
94 from CedarBackup3.testutil import captureOutput, configureLogging, failUnlessAssignRaises
95
96 #######################################################################
97 # Test Case Classes
98 #######################################################################
99
100 ######################
101 # TestFunctions class
102 ######################
103
104
105 class TestFunctions(unittest.TestCase):
106 """Tests for the public functions."""
107
108 ################
109 # Setup methods
110 ################
111
112 @classmethod
113 def setUpClass(cls):
114 configureLogging()
115
116 def setUp(self):
117 pass
118
119 def tearDown(self):
120 pass
121
122 ########################
123 # Test simple functions
124 ########################
125
126 def testSimpleFuncs_001(self):
127 """
128 Test that the _usage() function runs without errors.
129 We don't care what the output is, and we don't check.
130 """
131 captureOutput(_usage)
132
133 def testSimpleFuncs_002(self):
134 """
135 Test that the _version() function runs without errors.
136 We don't care what the output is, and we don't check.
137 """
138 captureOutput(_version)
139
140 def testSimpleFuncs_003(self):
141 """
142 Test that the _diagnostics() function runs without errors.
143 We don't care what the output is, and we don't check.
144 """
145 captureOutput(_diagnostics)
146
147
148 ####################
149 # TestOptions class
150 ####################
151
152
153 class TestOptions(unittest.TestCase):
154 """Tests for the Options class."""
155
156 ################
157 # Setup methods
158 ################
159
160 @classmethod
161 def setUpClass(cls):
162 configureLogging()
163
164 def setUp(self):
165 pass
166
167 def tearDown(self):
168 pass
169
170 ##################
171 # Utility methods
172 ##################
173
174 def failUnlessAssignRaises(self, exception, obj, prop, value):
175 """Equivalent of :any:`failUnlessRaises`, but used for property assignments instead."""
176 failUnlessAssignRaises(self, exception, obj, prop, value)
177
178 ############################
179 # Test __repr__ and __str__
180 ############################
181
182 def testStringFuncs_001(self):
183 """
184 Just make sure that the string functions don't have errors (i.e. bad variable names).
185 """
186 obj = Options()
187 obj.__repr__()
188 obj.__str__()
189
190 ##################################
191 # Test constructor and attributes
192 ##################################
193
194 def testConstructor_001(self):
195 """
196 Test constructor with no arguments.
197 """
198 options = Options()
199 self.assertEqual(False, options.help)
200 self.assertEqual(False, options.version)
201 self.assertEqual(False, options.verbose)
202 self.assertEqual(False, options.quiet)
203 self.assertEqual(None, options.config)
204 self.assertEqual(False, options.full)
205 self.assertEqual(False, options.managed)
206 self.assertEqual(False, options.managedOnly)
207 self.assertEqual(None, options.logfile)
208 self.assertEqual(None, options.owner)
209 self.assertEqual(None, options.mode)
210 self.assertEqual(False, options.output)
211 self.assertEqual(False, options.debug)
212 self.assertEqual(False, options.stacktrace)
213 self.assertEqual(False, options.diagnostics)
214 self.assertEqual([], options.actions)
215
216 def testConstructor_002(self):
217 """
218 Test constructor with validate=False, no other arguments.
219 """
220 options = Options(validate=False)
221 self.assertEqual(False, options.help)
222 self.assertEqual(False, options.version)
223 self.assertEqual(False, options.verbose)
224 self.assertEqual(False, options.quiet)
225 self.assertEqual(None, options.config)
226 self.assertEqual(False, options.full)
227 self.assertEqual(False, options.managed)
228 self.assertEqual(False, options.managedOnly)
229 self.assertEqual(None, options.logfile)
230 self.assertEqual(None, options.owner)
231 self.assertEqual(None, options.mode)
232 self.assertEqual(False, options.output)
233 self.assertEqual(False, options.debug)
234 self.assertEqual(False, options.stacktrace)
235 self.assertEqual(False, options.diagnostics)
236 self.assertEqual([], options.actions)
237
238 def testConstructor_003(self):
239 """
240 Test constructor with argumentList=[], validate=False.
241 """
242 options = Options(argumentList=[], validate=False)
243 self.assertEqual(False, options.help)
244 self.assertEqual(False, options.version)
245 self.assertEqual(False, options.verbose)
246 self.assertEqual(False, options.quiet)
247 self.assertEqual(None, options.config)
248 self.assertEqual(False, options.full)
249 self.assertEqual(False, options.managed)
250 self.assertEqual(False, options.managedOnly)
251 self.assertEqual(None, options.logfile)
252 self.assertEqual(None, options.owner)
253 self.assertEqual(None, options.mode)
254 self.assertEqual(False, options.output)
255 self.assertEqual(False, options.debug)
256 self.assertEqual(False, options.stacktrace)
257 self.assertEqual(False, options.diagnostics)
258 self.assertEqual([], options.actions)
259
260 def testConstructor_004(self):
261 """
262 Test constructor with argumentString="", validate=False.
263 """
264 options = Options(argumentString="", validate=False)
265 self.assertEqual(False, options.help)
266 self.assertEqual(False, options.version)
267 self.assertEqual(False, options.verbose)
268 self.assertEqual(False, options.quiet)
269 self.assertEqual(None, options.config)
270 self.assertEqual(False, options.full)
271 self.assertEqual(False, options.managed)
272 self.assertEqual(False, options.managedOnly)
273 self.assertEqual(None, options.logfile)
274 self.assertEqual(None, options.owner)
275 self.assertEqual(None, options.mode)
276 self.assertEqual(False, options.output)
277 self.assertEqual(False, options.debug)
278 self.assertEqual(False, options.stacktrace)
279 self.assertEqual(False, options.diagnostics)
280 self.assertEqual([], options.actions)
281
282 def testConstructor_005(self):
283 """
284 Test constructor with argumentList=["--help", ], validate=False.
285 """
286 options = Options(argumentList=["--help"], validate=False)
287 self.assertEqual(True, options.help)
288 self.assertEqual(False, options.version)
289 self.assertEqual(False, options.verbose)
290 self.assertEqual(False, options.quiet)
291 self.assertEqual(None, options.config)
292 self.assertEqual(False, options.full)
293 self.assertEqual(False, options.managed)
294 self.assertEqual(False, options.managedOnly)
295 self.assertEqual(None, options.logfile)
296 self.assertEqual(None, options.owner)
297 self.assertEqual(None, options.mode)
298 self.assertEqual(False, options.output)
299 self.assertEqual(False, options.debug)
300 self.assertEqual(False, options.stacktrace)
301 self.assertEqual(False, options.diagnostics)
302 self.assertEqual([], options.actions)
303
304 def testConstructor_006(self):
305 """
306 Test constructor with argumentString="--help", validate=False.
307 """
308 options = Options(argumentString="--help", validate=False)
309 self.assertEqual(True, options.help)
310 self.assertEqual(False, options.version)
311 self.assertEqual(False, options.verbose)
312 self.assertEqual(False, options.quiet)
313 self.assertEqual(None, options.config)
314 self.assertEqual(False, options.full)
315 self.assertEqual(False, options.managed)
316 self.assertEqual(False, options.managedOnly)
317 self.assertEqual(None, options.logfile)
318 self.assertEqual(None, options.owner)
319 self.assertEqual(None, options.mode)
320 self.assertEqual(False, options.output)
321 self.assertEqual(False, options.debug)
322 self.assertEqual(False, options.stacktrace)
323 self.assertEqual(False, options.diagnostics)
324 self.assertEqual([], options.actions)
325
326 def testConstructor_007(self):
327 """
328 Test constructor with argumentList=["-h", ], validate=False.
329 """
330 options = Options(argumentList=["-h"], validate=False)
331 self.assertEqual(True, options.help)
332 self.assertEqual(False, options.version)
333 self.assertEqual(False, options.verbose)
334 self.assertEqual(False, options.quiet)
335 self.assertEqual(None, options.config)
336 self.assertEqual(False, options.full)
337 self.assertEqual(False, options.managed)
338 self.assertEqual(False, options.managedOnly)
339 self.assertEqual(None, options.logfile)
340 self.assertEqual(None, options.owner)
341 self.assertEqual(None, options.mode)
342 self.assertEqual(False, options.output)
343 self.assertEqual(False, options.debug)
344 self.assertEqual(False, options.stacktrace)
345 self.assertEqual(False, options.diagnostics)
346 self.assertEqual([], options.actions)
347
348 def testConstructor_008(self):
349 """
350 Test constructor with argumentString="-h", validate=False.
351 """
352 options = Options(argumentString="-h", validate=False)
353 self.assertEqual(True, options.help)
354 self.assertEqual(False, options.version)
355 self.assertEqual(False, options.verbose)
356 self.assertEqual(False, options.quiet)
357 self.assertEqual(None, options.config)
358 self.assertEqual(False, options.full)
359 self.assertEqual(False, options.managed)
360 self.assertEqual(False, options.managedOnly)
361 self.assertEqual(None, options.logfile)
362 self.assertEqual(None, options.owner)
363 self.assertEqual(None, options.mode)
364 self.assertEqual(False, options.output)
365 self.assertEqual(False, options.debug)
366 self.assertEqual(False, options.stacktrace)
367 self.assertEqual(False, options.diagnostics)
368 self.assertEqual([], options.actions)
369
370 def testConstructor_009(self):
371 """
372 Test constructor with argumentList=["--version", ], validate=False.
373 """
374 options = Options(argumentList=["--version"], validate=False)
375 self.assertEqual(False, options.help)
376 self.assertEqual(True, options.version)
377 self.assertEqual(False, options.verbose)
378 self.assertEqual(False, options.quiet)
379 self.assertEqual(None, options.config)
380 self.assertEqual(False, options.full)
381 self.assertEqual(False, options.managed)
382 self.assertEqual(False, options.managedOnly)
383 self.assertEqual(None, options.logfile)
384 self.assertEqual(None, options.owner)
385 self.assertEqual(None, options.mode)
386 self.assertEqual(False, options.output)
387 self.assertEqual(False, options.debug)
388 self.assertEqual(False, options.stacktrace)
389 self.assertEqual(False, options.diagnostics)
390 self.assertEqual([], options.actions)
391
392 def testConstructor_010(self):
393 """
394 Test constructor with argumentString="--version", validate=False.
395 """
396 options = Options(argumentString="--version", validate=False)
397 self.assertEqual(False, options.help)
398 self.assertEqual(True, options.version)
399 self.assertEqual(False, options.verbose)
400 self.assertEqual(False, options.quiet)
401 self.assertEqual(None, options.config)
402 self.assertEqual(False, options.full)
403 self.assertEqual(False, options.managed)
404 self.assertEqual(False, options.managedOnly)
405 self.assertEqual(None, options.logfile)
406 self.assertEqual(None, options.owner)
407 self.assertEqual(None, options.mode)
408 self.assertEqual(False, options.output)
409 self.assertEqual(False, options.debug)
410 self.assertEqual(False, options.stacktrace)
411 self.assertEqual(False, options.diagnostics)
412 self.assertEqual([], options.actions)
413
414 def testConstructor_011(self):
415 """
416 Test constructor with argumentList=["-V", ], validate=False.
417 """
418 options = Options(argumentList=["-V"], validate=False)
419 self.assertEqual(False, options.help)
420 self.assertEqual(True, options.version)
421 self.assertEqual(False, options.verbose)
422 self.assertEqual(False, options.quiet)
423 self.assertEqual(None, options.config)
424 self.assertEqual(False, options.full)
425 self.assertEqual(False, options.managed)
426 self.assertEqual(False, options.managedOnly)
427 self.assertEqual(None, options.logfile)
428 self.assertEqual(None, options.owner)
429 self.assertEqual(None, options.mode)
430 self.assertEqual(False, options.output)
431 self.assertEqual(False, options.debug)
432 self.assertEqual(False, options.stacktrace)
433 self.assertEqual(False, options.diagnostics)
434 self.assertEqual([], options.actions)
435
436 def testConstructor_012(self):
437 """
438 Test constructor with argumentString="-V", validate=False.
439 """
440 options = Options(argumentString="-V", validate=False)
441 self.assertEqual(False, options.help)
442 self.assertEqual(True, options.version)
443 self.assertEqual(False, options.verbose)
444 self.assertEqual(False, options.quiet)
445 self.assertEqual(None, options.config)
446 self.assertEqual(False, options.full)
447 self.assertEqual(False, options.managed)
448 self.assertEqual(False, options.managedOnly)
449 self.assertEqual(None, options.logfile)
450 self.assertEqual(None, options.owner)
451 self.assertEqual(None, options.mode)
452 self.assertEqual(False, options.output)
453 self.assertEqual(False, options.debug)
454 self.assertEqual(False, options.stacktrace)
455 self.assertEqual(False, options.diagnostics)
456 self.assertEqual([], options.actions)
457
458 def testConstructor_013(self):
459 """
460 Test constructor with argumentList=["--verbose", ], validate=False.
461 """
462 options = Options(argumentList=["--verbose"], validate=False)
463 self.assertEqual(False, options.help)
464 self.assertEqual(False, options.version)
465 self.assertEqual(True, options.verbose)
466 self.assertEqual(False, options.quiet)
467 self.assertEqual(None, options.config)
468 self.assertEqual(False, options.full)
469 self.assertEqual(False, options.managed)
470 self.assertEqual(False, options.managedOnly)
471 self.assertEqual(None, options.logfile)
472 self.assertEqual(None, options.owner)
473 self.assertEqual(None, options.mode)
474 self.assertEqual(False, options.output)
475 self.assertEqual(False, options.debug)
476 self.assertEqual(False, options.stacktrace)
477 self.assertEqual(False, options.diagnostics)
478 self.assertEqual([], options.actions)
479
480 def testConstructor_014(self):
481 """
482 Test constructor with argumentString="--verbose", validate=False.
483 """
484 options = Options(argumentString="--verbose", validate=False)
485 self.assertEqual(False, options.help)
486 self.assertEqual(False, options.version)
487 self.assertEqual(True, options.verbose)
488 self.assertEqual(False, options.quiet)
489 self.assertEqual(None, options.config)
490 self.assertEqual(False, options.full)
491 self.assertEqual(False, options.managed)
492 self.assertEqual(False, options.managedOnly)
493 self.assertEqual(None, options.logfile)
494 self.assertEqual(None, options.owner)
495 self.assertEqual(None, options.mode)
496 self.assertEqual(False, options.output)
497 self.assertEqual(False, options.debug)
498 self.assertEqual(False, options.stacktrace)
499 self.assertEqual(False, options.diagnostics)
500 self.assertEqual([], options.actions)
501
502 def testConstructor_015(self):
503 """
504 Test constructor with argumentList=["-b", ], validate=False.
505 """
506 options = Options(argumentList=["-b"], validate=False)
507 self.assertEqual(False, options.help)
508 self.assertEqual(False, options.version)
509 self.assertEqual(True, options.verbose)
510 self.assertEqual(False, options.quiet)
511 self.assertEqual(None, options.config)
512 self.assertEqual(False, options.full)
513 self.assertEqual(False, options.managed)
514 self.assertEqual(False, options.managedOnly)
515 self.assertEqual(None, options.logfile)
516 self.assertEqual(None, options.owner)
517 self.assertEqual(None, options.mode)
518 self.assertEqual(False, options.output)
519 self.assertEqual(False, options.debug)
520 self.assertEqual(False, options.stacktrace)
521 self.assertEqual(False, options.diagnostics)
522 self.assertEqual([], options.actions)
523
524 def testConstructor_016(self):
525 """
526 Test constructor with argumentString="-b", validate=False.
527 """
528 options = Options(argumentString="-b", validate=False)
529 self.assertEqual(False, options.help)
530 self.assertEqual(False, options.version)
531 self.assertEqual(True, options.verbose)
532 self.assertEqual(False, options.quiet)
533 self.assertEqual(None, options.config)
534 self.assertEqual(False, options.full)
535 self.assertEqual(False, options.managed)
536 self.assertEqual(False, options.managedOnly)
537 self.assertEqual(None, options.logfile)
538 self.assertEqual(None, options.owner)
539 self.assertEqual(None, options.mode)
540 self.assertEqual(False, options.output)
541 self.assertEqual(False, options.debug)
542 self.assertEqual(False, options.stacktrace)
543 self.assertEqual(False, options.diagnostics)
544 self.assertEqual([], options.actions)
545
546 def testConstructor_017(self):
547 """
548 Test constructor with argumentList=["--quiet", ], validate=False.
549 """
550 options = Options(argumentList=["--quiet"], validate=False)
551 self.assertEqual(False, options.help)
552 self.assertEqual(False, options.version)
553 self.assertEqual(False, options.verbose)
554 self.assertEqual(True, options.quiet)
555 self.assertEqual(None, options.config)
556 self.assertEqual(False, options.full)
557 self.assertEqual(False, options.managed)
558 self.assertEqual(False, options.managedOnly)
559 self.assertEqual(None, options.logfile)
560 self.assertEqual(None, options.owner)
561 self.assertEqual(None, options.mode)
562 self.assertEqual(False, options.output)
563 self.assertEqual(False, options.debug)
564 self.assertEqual(False, options.stacktrace)
565 self.assertEqual(False, options.diagnostics)
566 self.assertEqual([], options.actions)
567
568 def testConstructor_018(self):
569 """
570 Test constructor with argumentString="--quiet", validate=False.
571 """
572 options = Options(argumentString="--quiet", validate=False)
573 self.assertEqual(False, options.help)
574 self.assertEqual(False, options.version)
575 self.assertEqual(False, options.verbose)
576 self.assertEqual(True, options.quiet)
577 self.assertEqual(None, options.config)
578 self.assertEqual(False, options.full)
579 self.assertEqual(False, options.managed)
580 self.assertEqual(False, options.managedOnly)
581 self.assertEqual(None, options.logfile)
582 self.assertEqual(None, options.owner)
583 self.assertEqual(None, options.mode)
584 self.assertEqual(False, options.output)
585 self.assertEqual(False, options.debug)
586 self.assertEqual(False, options.stacktrace)
587 self.assertEqual(False, options.diagnostics)
588 self.assertEqual([], options.actions)
589
590 def testConstructor_019(self):
591 """
592 Test constructor with argumentList=["-q", ], validate=False.
593 """
594 options = Options(argumentList=["-q"], validate=False)
595 self.assertEqual(False, options.help)
596 self.assertEqual(False, options.version)
597 self.assertEqual(False, options.verbose)
598 self.assertEqual(True, options.quiet)
599 self.assertEqual(None, options.config)
600 self.assertEqual(False, options.full)
601 self.assertEqual(False, options.managed)
602 self.assertEqual(False, options.managedOnly)
603 self.assertEqual(None, options.logfile)
604 self.assertEqual(None, options.owner)
605 self.assertEqual(None, options.mode)
606 self.assertEqual(False, options.output)
607 self.assertEqual(False, options.debug)
608 self.assertEqual(False, options.stacktrace)
609 self.assertEqual(False, options.diagnostics)
610 self.assertEqual([], options.actions)
611
612 def testConstructor_020(self):
613 """
614 Test constructor with argumentString="-q", validate=False.
615 """
616 options = Options(argumentString="-q", validate=False)
617 self.assertEqual(False, options.help)
618 self.assertEqual(False, options.version)
619 self.assertEqual(False, options.verbose)
620 self.assertEqual(True, options.quiet)
621 self.assertEqual(None, options.config)
622 self.assertEqual(False, options.full)
623 self.assertEqual(False, options.managed)
624 self.assertEqual(False, options.managedOnly)
625 self.assertEqual(None, options.logfile)
626 self.assertEqual(None, options.owner)
627 self.assertEqual(None, options.mode)
628 self.assertEqual(False, options.output)
629 self.assertEqual(False, options.debug)
630 self.assertEqual(False, options.stacktrace)
631 self.assertEqual(False, options.diagnostics)
632 self.assertEqual([], options.actions)
633
634 def testConstructor_021(self):
635 """
636 Test constructor with argumentList=["--config", ], validate=False.
637 """
638 self.assertRaises(GetoptError, Options, argumentList=["--config"], validate=False)
639
640 def testConstructor_022(self):
641 """
642 Test constructor with argumentString="--config", validate=False.
643 """
644 self.assertRaises(GetoptError, Options, argumentString="--config", validate=False)
645
646 def testConstructor_023(self):
647 """
648 Test constructor with argumentList=["-c", ], validate=False.
649 """
650 self.assertRaises(GetoptError, Options, argumentList=["-c"], validate=False)
651
652 def testConstructor_024(self):
653 """
654 Test constructor with argumentString="-c", validate=False.
655 """
656 self.assertRaises(GetoptError, Options, argumentString="-c", validate=False)
657
658 def testConstructor_025(self):
659 """
660 Test constructor with argumentList=["--config", "something", ], validate=False.
661 """
662 options = Options(argumentList=["--config", "something"], validate=False)
663 self.assertEqual(False, options.help)
664 self.assertEqual(False, options.version)
665 self.assertEqual(False, options.verbose)
666 self.assertEqual(False, options.quiet)
667 self.assertEqual("something", options.config)
668 self.assertEqual(False, options.full)
669 self.assertEqual(False, options.managed)
670 self.assertEqual(False, options.managedOnly)
671 self.assertEqual(None, options.logfile)
672 self.assertEqual(None, options.owner)
673 self.assertEqual(None, options.mode)
674 self.assertEqual(False, options.output)
675 self.assertEqual(False, options.debug)
676 self.assertEqual(False, options.stacktrace)
677 self.assertEqual(False, options.diagnostics)
678 self.assertEqual([], options.actions)
679
680 def testConstructor_026(self):
681 """
682 Test constructor with argumentString="--config something", validate=False.
683 """
684 options = Options(argumentString="--config something", validate=False)
685 self.assertEqual(False, options.help)
686 self.assertEqual(False, options.version)
687 self.assertEqual(False, options.verbose)
688 self.assertEqual(False, options.quiet)
689 self.assertEqual("something", options.config)
690 self.assertEqual(False, options.full)
691 self.assertEqual(False, options.managed)
692 self.assertEqual(False, options.managedOnly)
693 self.assertEqual(None, options.logfile)
694 self.assertEqual(None, options.owner)
695 self.assertEqual(None, options.mode)
696 self.assertEqual(False, options.output)
697 self.assertEqual(False, options.debug)
698 self.assertEqual(False, options.stacktrace)
699 self.assertEqual(False, options.diagnostics)
700 self.assertEqual([], options.actions)
701
702 def testConstructor_027(self):
703 """
704 Test constructor with argumentList=["-c", "something", ], validate=False.
705 """
706 options = Options(argumentList=["-c", "something"], validate=False)
707 self.assertEqual(False, options.help)
708 self.assertEqual(False, options.version)
709 self.assertEqual(False, options.verbose)
710 self.assertEqual(False, options.quiet)
711 self.assertEqual("something", options.config)
712 self.assertEqual(False, options.full)
713 self.assertEqual(False, options.managed)
714 self.assertEqual(False, options.managedOnly)
715 self.assertEqual(None, options.logfile)
716 self.assertEqual(None, options.owner)
717 self.assertEqual(None, options.mode)
718 self.assertEqual(False, options.output)
719 self.assertEqual(False, options.debug)
720 self.assertEqual(False, options.stacktrace)
721 self.assertEqual(False, options.diagnostics)
722 self.assertEqual([], options.actions)
723
724 def testConstructor_028(self):
725 """
726 Test constructor with argumentString="-c something", validate=False.
727 """
728 options = Options(argumentString="-c something", validate=False)
729 self.assertEqual(False, options.help)
730 self.assertEqual(False, options.version)
731 self.assertEqual(False, options.verbose)
732 self.assertEqual(False, options.quiet)
733 self.assertEqual("something", options.config)
734 self.assertEqual(False, options.full)
735 self.assertEqual(False, options.managed)
736 self.assertEqual(False, options.managedOnly)
737 self.assertEqual(None, options.logfile)
738 self.assertEqual(None, options.owner)
739 self.assertEqual(None, options.mode)
740 self.assertEqual(False, options.output)
741 self.assertEqual(False, options.debug)
742 self.assertEqual(False, options.stacktrace)
743 self.assertEqual(False, options.diagnostics)
744 self.assertEqual([], options.actions)
745
746 def testConstructor_029(self):
747 """
748 Test constructor with argumentList=["--full", ], validate=False.
749 """
750 options = Options(argumentList=["--full"], validate=False)
751 self.assertEqual(False, options.help)
752 self.assertEqual(False, options.version)
753 self.assertEqual(False, options.verbose)
754 self.assertEqual(False, options.quiet)
755 self.assertEqual(None, options.config)
756 self.assertEqual(True, options.full)
757 self.assertEqual(False, options.managed)
758 self.assertEqual(False, options.managedOnly)
759 self.assertEqual(None, options.logfile)
760 self.assertEqual(None, options.owner)
761 self.assertEqual(None, options.mode)
762 self.assertEqual(False, options.output)
763 self.assertEqual(False, options.debug)
764 self.assertEqual(False, options.stacktrace)
765 self.assertEqual(False, options.diagnostics)
766 self.assertEqual(False, options.stacktrace)
767 self.assertEqual(False, options.diagnostics)
768 self.assertEqual([], options.actions)
769
770 def testConstructor_030(self):
771 """
772 Test constructor with argumentString="--full", validate=False.
773 """
774 options = Options(argumentString="--full", validate=False)
775 self.assertEqual(False, options.help)
776 self.assertEqual(False, options.version)
777 self.assertEqual(False, options.verbose)
778 self.assertEqual(False, options.quiet)
779 self.assertEqual(None, options.config)
780 self.assertEqual(True, options.full)
781 self.assertEqual(False, options.managed)
782 self.assertEqual(False, options.managedOnly)
783 self.assertEqual(None, options.logfile)
784 self.assertEqual(None, options.owner)
785 self.assertEqual(None, options.mode)
786 self.assertEqual(False, options.output)
787 self.assertEqual(False, options.debug)
788 self.assertEqual(False, options.stacktrace)
789 self.assertEqual(False, options.diagnostics)
790 self.assertEqual([], options.actions)
791
792 def testConstructor_031(self):
793 """
794 Test constructor with argumentList=["-f", ], validate=False.
795 """
796 options = Options(argumentList=["-f"], validate=False)
797 self.assertEqual(False, options.help)
798 self.assertEqual(False, options.version)
799 self.assertEqual(False, options.verbose)
800 self.assertEqual(False, options.quiet)
801 self.assertEqual(None, options.config)
802 self.assertEqual(True, options.full)
803 self.assertEqual(False, options.managed)
804 self.assertEqual(False, options.managedOnly)
805 self.assertEqual(None, options.logfile)
806 self.assertEqual(None, options.owner)
807 self.assertEqual(None, options.mode)
808 self.assertEqual(False, options.output)
809 self.assertEqual(False, options.debug)
810 self.assertEqual(False, options.stacktrace)
811 self.assertEqual(False, options.diagnostics)
812 self.assertEqual([], options.actions)
813
814 def testConstructor_032(self):
815 """
816 Test constructor with argumentString="-f", validate=False.
817 """
818 options = Options(argumentString="-f", validate=False)
819 self.assertEqual(False, options.help)
820 self.assertEqual(False, options.version)
821 self.assertEqual(False, options.verbose)
822 self.assertEqual(False, options.quiet)
823 self.assertEqual(None, options.config)
824 self.assertEqual(True, options.full)
825 self.assertEqual(False, options.managed)
826 self.assertEqual(False, options.managedOnly)
827 self.assertEqual(None, options.logfile)
828 self.assertEqual(None, options.owner)
829 self.assertEqual(None, options.mode)
830 self.assertEqual(False, options.output)
831 self.assertEqual(False, options.debug)
832 self.assertEqual(False, options.stacktrace)
833 self.assertEqual(False, options.diagnostics)
834 self.assertEqual([], options.actions)
835
836 def testConstructor_033(self):
837 """
838 Test constructor with argumentList=["--logfile", ], validate=False.
839 """
840 self.assertRaises(GetoptError, Options, argumentList=["--logfile"], validate=False)
841
842 def testConstructor_034(self):
843 """
844 Test constructor with argumentString="--logfile", validate=False.
845 """
846 self.assertRaises(GetoptError, Options, argumentString="--logfile", validate=False)
847
848 def testConstructor_035(self):
849 """
850 Test constructor with argumentList=["-l", ], validate=False.
851 """
852 self.assertRaises(GetoptError, Options, argumentList=["-l"], validate=False)
853
854 def testConstructor_036(self):
855 """
856 Test constructor with argumentString="-l", validate=False.
857 """
858 self.assertRaises(GetoptError, Options, argumentString="-l", validate=False)
859
860 def testConstructor_037(self):
861 """
862 Test constructor with argumentList=["--logfile", "something", ], validate=False.
863 """
864 options = Options(argumentList=["--logfile", "something"], validate=False)
865 self.assertEqual(False, options.help)
866 self.assertEqual(False, options.version)
867 self.assertEqual(False, options.verbose)
868 self.assertEqual(False, options.quiet)
869 self.assertEqual(None, options.config)
870 self.assertEqual(False, options.full)
871 self.assertEqual(False, options.managed)
872 self.assertEqual(False, options.managedOnly)
873 self.assertEqual("something", options.logfile)
874 self.assertEqual(None, options.owner)
875 self.assertEqual(None, options.mode)
876 self.assertEqual(False, options.output)
877 self.assertEqual(False, options.debug)
878 self.assertEqual(False, options.stacktrace)
879 self.assertEqual(False, options.diagnostics)
880 self.assertEqual([], options.actions)
881
882 def testConstructor_038(self):
883 """
884 Test constructor with argumentString="--logfile something", validate=False.
885 """
886 options = Options(argumentString="--logfile something", validate=False)
887 self.assertEqual(False, options.help)
888 self.assertEqual(False, options.version)
889 self.assertEqual(False, options.verbose)
890 self.assertEqual(False, options.quiet)
891 self.assertEqual(None, options.config)
892 self.assertEqual(False, options.full)
893 self.assertEqual(False, options.managed)
894 self.assertEqual(False, options.managedOnly)
895 self.assertEqual("something", options.logfile)
896 self.assertEqual(None, options.owner)
897 self.assertEqual(None, options.mode)
898 self.assertEqual(False, options.output)
899 self.assertEqual(False, options.debug)
900 self.assertEqual(False, options.stacktrace)
901 self.assertEqual(False, options.diagnostics)
902 self.assertEqual([], options.actions)
903
904 def testConstructor_039(self):
905 """
906 Test constructor with argumentList=["-l", "something", ], validate=False.
907 """
908 options = Options(argumentList=["-l", "something"], validate=False)
909 self.assertEqual(False, options.help)
910 self.assertEqual(False, options.version)
911 self.assertEqual(False, options.verbose)
912 self.assertEqual(False, options.quiet)
913 self.assertEqual(None, options.config)
914 self.assertEqual(False, options.full)
915 self.assertEqual(False, options.managed)
916 self.assertEqual(False, options.managedOnly)
917 self.assertEqual("something", options.logfile)
918 self.assertEqual(None, options.owner)
919 self.assertEqual(None, options.mode)
920 self.assertEqual(False, options.output)
921 self.assertEqual(False, options.debug)
922 self.assertEqual(False, options.stacktrace)
923 self.assertEqual(False, options.diagnostics)
924 self.assertEqual([], options.actions)
925
926 def testConstructor_040(self):
927 """
928 Test constructor with argumentString="-l something", validate=False.
929 """
930 options = Options(argumentString="-l something", validate=False)
931 self.assertEqual(False, options.help)
932 self.assertEqual(False, options.version)
933 self.assertEqual(False, options.verbose)
934 self.assertEqual(False, options.quiet)
935 self.assertEqual(None, options.config)
936 self.assertEqual(False, options.full)
937 self.assertEqual(False, options.managed)
938 self.assertEqual(False, options.managedOnly)
939 self.assertEqual("something", options.logfile)
940 self.assertEqual(None, options.owner)
941 self.assertEqual(None, options.mode)
942 self.assertEqual(False, options.output)
943 self.assertEqual(False, options.debug)
944 self.assertEqual(False, options.stacktrace)
945 self.assertEqual(False, options.diagnostics)
946 self.assertEqual([], options.actions)
947
948 def testConstructor_041(self):
949 """
950 Test constructor with argumentList=["--owner", ], validate=False.
951 """
952 self.assertRaises(GetoptError, Options, argumentList=["--owner"], validate=False)
953
954 def testConstructor_042(self):
955 """
956 Test constructor with argumentString="--owner", validate=False.
957 """
958 self.assertRaises(GetoptError, Options, argumentString="--owner", validate=False)
959
960 def testConstructor_043(self):
961 """
962 Test constructor with argumentList=["-o", ], validate=False.
963 """
964 self.assertRaises(GetoptError, Options, argumentList=["-o"], validate=False)
965
966 def testConstructor_044(self):
967 """
968 Test constructor with argumentString="-o", validate=False.
969 """
970 self.assertRaises(GetoptError, Options, argumentString="-o", validate=False)
971
972 def testConstructor_045(self):
973 """
974 Test constructor with argumentList=["--owner", "something", ], validate=False.
975 """
976 self.assertRaises(ValueError, Options, argumentList=["--owner", "something"], validate=False)
977
978 def testConstructor_046(self):
979 """
980 Test constructor with argumentString="--owner something", validate=False.
981 """
982 self.assertRaises(ValueError, Options, argumentString="--owner something", validate=False)
983
984 def testConstructor_047(self):
985 """
986 Test constructor with argumentList=["-o", "something", ], validate=False.
987 """
988 self.assertRaises(ValueError, Options, argumentList=["-o", "something"], validate=False)
989
990 def testConstructor_048(self):
991 """
992 Test constructor with argumentString="-o something", validate=False.
993 """
994 self.assertRaises(ValueError, Options, argumentString="-o something", validate=False)
995
996 def testConstructor_049(self):
997 """
998 Test constructor with argumentList=["--owner", "a:b", ], validate=False.
999 """
1000 options = Options(argumentList=["--owner", "a:b"], validate=False)
1001 self.assertEqual(False, options.help)
1002 self.assertEqual(False, options.version)
1003 self.assertEqual(False, options.verbose)
1004 self.assertEqual(False, options.quiet)
1005 self.assertEqual(None, options.config)
1006 self.assertEqual(False, options.full)
1007 self.assertEqual(False, options.managed)
1008 self.assertEqual(False, options.managedOnly)
1009 self.assertEqual(None, options.logfile)
1010 self.assertEqual(("a", "b"), options.owner)
1011 self.assertEqual(None, options.mode)
1012 self.assertEqual(False, options.output)
1013 self.assertEqual(False, options.debug)
1014 self.assertEqual(False, options.stacktrace)
1015 self.assertEqual(False, options.diagnostics)
1016 self.assertEqual([], options.actions)
1017
1018 def testConstructor_050(self):
1019 """
1020 Test constructor with argumentString="--owner a:b", validate=False.
1021 """
1022 options = Options(argumentString="--owner a:b", validate=False)
1023 self.assertEqual(False, options.help)
1024 self.assertEqual(False, options.version)
1025 self.assertEqual(False, options.verbose)
1026 self.assertEqual(False, options.quiet)
1027 self.assertEqual(None, options.config)
1028 self.assertEqual(False, options.full)
1029 self.assertEqual(False, options.managed)
1030 self.assertEqual(False, options.managedOnly)
1031 self.assertEqual(None, options.logfile)
1032 self.assertEqual(("a", "b"), options.owner)
1033 self.assertEqual(None, options.mode)
1034 self.assertEqual(False, options.output)
1035 self.assertEqual(False, options.debug)
1036 self.assertEqual(False, options.stacktrace)
1037 self.assertEqual(False, options.diagnostics)
1038 self.assertEqual([], options.actions)
1039
1040 def testConstructor_051(self):
1041 """
1042 Test constructor with argumentList=["-o", "a:b", ], validate=False.
1043 """
1044 options = Options(argumentList=["-o", "a:b"], validate=False)
1045 self.assertEqual(False, options.help)
1046 self.assertEqual(False, options.version)
1047 self.assertEqual(False, options.verbose)
1048 self.assertEqual(False, options.quiet)
1049 self.assertEqual(None, options.config)
1050 self.assertEqual(False, options.full)
1051 self.assertEqual(False, options.managed)
1052 self.assertEqual(False, options.managedOnly)
1053 self.assertEqual(None, options.logfile)
1054 self.assertEqual(("a", "b"), options.owner)
1055 self.assertEqual(None, options.mode)
1056 self.assertEqual(False, options.output)
1057 self.assertEqual(False, options.debug)
1058 self.assertEqual(False, options.stacktrace)
1059 self.assertEqual(False, options.diagnostics)
1060 self.assertEqual([], options.actions)
1061
1062 def testConstructor_052(self):
1063 """
1064 Test constructor with argumentString="-o a:b", validate=False.
1065 """
1066 options = Options(argumentString="-o a:b", validate=False)
1067 self.assertEqual(False, options.help)
1068 self.assertEqual(False, options.version)
1069 self.assertEqual(False, options.verbose)
1070 self.assertEqual(False, options.quiet)
1071 self.assertEqual(None, options.config)
1072 self.assertEqual(False, options.full)
1073 self.assertEqual(False, options.managed)
1074 self.assertEqual(False, options.managedOnly)
1075 self.assertEqual(None, options.logfile)
1076 self.assertEqual(("a", "b"), options.owner)
1077 self.assertEqual(None, options.mode)
1078 self.assertEqual(False, options.output)
1079 self.assertEqual(False, options.debug)
1080 self.assertEqual(False, options.stacktrace)
1081 self.assertEqual(False, options.diagnostics)
1082 self.assertEqual([], options.actions)
1083
1084 def testConstructor_053(self):
1085 """
1086 Test constructor with argumentList=["--mode", ], validate=False.
1087 """
1088 self.assertRaises(GetoptError, Options, argumentList=["--mode"], validate=False)
1089
1090 def testConstructor_054(self):
1091 """
1092 Test constructor with argumentString="--mode", validate=False.
1093 """
1094 self.assertRaises(GetoptError, Options, argumentString="--mode", validate=False)
1095
1096 def testConstructor_055(self):
1097 """
1098 Test constructor with argumentList=["-m", ], validate=False.
1099 """
1100 self.assertRaises(GetoptError, Options, argumentList=["-m"], validate=False)
1101
1102 def testConstructor_056(self):
1103 """
1104 Test constructor with argumentString="-m", validate=False.
1105 """
1106 self.assertRaises(GetoptError, Options, argumentString="-m", validate=False)
1107
1108 def testConstructor_057(self):
1109 """
1110 Test constructor with argumentList=["--mode", "something", ], validate=False.
1111 """
1112 self.assertRaises(ValueError, Options, argumentList=["--mode", "something"], validate=False)
1113
1114 def testConstructor_058(self):
1115 """
1116 Test constructor with argumentString="--mode something", validate=False.
1117 """
1118 self.assertRaises(ValueError, Options, argumentString="--mode something", validate=False)
1119
1120 def testConstructor_059(self):
1121 """
1122 Test constructor with argumentList=["-m", "something", ], validate=False.
1123 """
1124 self.assertRaises(ValueError, Options, argumentList=["-m", "something"], validate=False)
1125
1126 def testConstructor_060(self):
1127 """
1128 Test constructor with argumentString="-m something", validate=False.
1129 """
1130 self.assertRaises(ValueError, Options, argumentString="-m something", validate=False)
1131
1132 def testConstructor_061(self):
1133 """
1134 Test constructor with argumentList=["--mode", "631", ], validate=False.
1135 """
1136 options = Options(argumentList=["--mode", "631"], validate=False)
1137 self.assertEqual(False, options.help)
1138 self.assertEqual(False, options.version)
1139 self.assertEqual(False, options.verbose)
1140 self.assertEqual(False, options.quiet)
1141 self.assertEqual(None, options.config)
1142 self.assertEqual(False, options.full)
1143 self.assertEqual(False, options.managed)
1144 self.assertEqual(False, options.managedOnly)
1145 self.assertEqual(None, options.logfile)
1146 self.assertEqual(None, options.owner)
1147 self.assertEqual(0o631, options.mode)
1148 self.assertEqual(False, options.output)
1149 self.assertEqual(False, options.debug)
1150 self.assertEqual(False, options.stacktrace)
1151 self.assertEqual(False, options.diagnostics)
1152 self.assertEqual([], options.actions)
1153
1154 def testConstructor_062(self):
1155 """
1156 Test constructor with argumentString="--mode 631", validate=False.
1157 """
1158 options = Options(argumentString="--mode 631", validate=False)
1159 self.assertEqual(False, options.help)
1160 self.assertEqual(False, options.version)
1161 self.assertEqual(False, options.verbose)
1162 self.assertEqual(False, options.quiet)
1163 self.assertEqual(None, options.config)
1164 self.assertEqual(False, options.full)
1165 self.assertEqual(False, options.managed)
1166 self.assertEqual(False, options.managedOnly)
1167 self.assertEqual(None, options.logfile)
1168 self.assertEqual(None, options.owner)
1169 self.assertEqual(0o631, options.mode)
1170 self.assertEqual(False, options.output)
1171 self.assertEqual(False, options.debug)
1172 self.assertEqual(False, options.stacktrace)
1173 self.assertEqual(False, options.diagnostics)
1174 self.assertEqual([], options.actions)
1175
1176 def testConstructor_063(self):
1177 """
1178 Test constructor with argumentList=["-m", "631", ], validate=False.
1179 """
1180 options = Options(argumentList=["-m", "631"], validate=False)
1181 self.assertEqual(False, options.help)
1182 self.assertEqual(False, options.version)
1183 self.assertEqual(False, options.verbose)
1184 self.assertEqual(False, options.quiet)
1185 self.assertEqual(None, options.config)
1186 self.assertEqual(False, options.full)
1187 self.assertEqual(False, options.managed)
1188 self.assertEqual(False, options.managedOnly)
1189 self.assertEqual(None, options.logfile)
1190 self.assertEqual(None, options.owner)
1191 self.assertEqual(0o631, options.mode)
1192 self.assertEqual(False, options.output)
1193 self.assertEqual(False, options.debug)
1194 self.assertEqual(False, options.stacktrace)
1195 self.assertEqual(False, options.diagnostics)
1196 self.assertEqual([], options.actions)
1197
1198 def testConstructor_064(self):
1199 """
1200 Test constructor with argumentString="-m 631", validate=False.
1201 """
1202 options = Options(argumentString="-m 631", validate=False)
1203 self.assertEqual(False, options.help)
1204 self.assertEqual(False, options.version)
1205 self.assertEqual(False, options.verbose)
1206 self.assertEqual(False, options.quiet)
1207 self.assertEqual(None, options.config)
1208 self.assertEqual(False, options.full)
1209 self.assertEqual(False, options.managed)
1210 self.assertEqual(False, options.managedOnly)
1211 self.assertEqual(None, options.logfile)
1212 self.assertEqual(None, options.owner)
1213 self.assertEqual(0o631, options.mode)
1214 self.assertEqual(False, options.output)
1215 self.assertEqual(False, options.debug)
1216 self.assertEqual(False, options.stacktrace)
1217 self.assertEqual(False, options.diagnostics)
1218 self.assertEqual([], options.actions)
1219
1220 def testConstructor_065(self):
1221 """
1222 Test constructor with argumentList=["--output", ], validate=False.
1223 """
1224 options = Options(argumentList=["--output"], validate=False)
1225 self.assertEqual(False, options.help)
1226 self.assertEqual(False, options.version)
1227 self.assertEqual(False, options.verbose)
1228 self.assertEqual(False, options.quiet)
1229 self.assertEqual(None, options.config)
1230 self.assertEqual(False, options.full)
1231 self.assertEqual(False, options.managed)
1232 self.assertEqual(False, options.managedOnly)
1233 self.assertEqual(None, options.logfile)
1234 self.assertEqual(None, options.owner)
1235 self.assertEqual(None, options.mode)
1236 self.assertEqual(True, options.output)
1237 self.assertEqual(False, options.debug)
1238 self.assertEqual(False, options.stacktrace)
1239 self.assertEqual(False, options.diagnostics)
1240 self.assertEqual([], options.actions)
1241
1242 def testConstructor_066(self):
1243 """
1244 Test constructor with argumentString="--output", validate=False.
1245 """
1246 options = Options(argumentString="--output", validate=False)
1247 self.assertEqual(False, options.help)
1248 self.assertEqual(False, options.version)
1249 self.assertEqual(False, options.verbose)
1250 self.assertEqual(False, options.quiet)
1251 self.assertEqual(None, options.config)
1252 self.assertEqual(False, options.full)
1253 self.assertEqual(False, options.managed)
1254 self.assertEqual(False, options.managedOnly)
1255 self.assertEqual(None, options.logfile)
1256 self.assertEqual(None, options.owner)
1257 self.assertEqual(None, options.mode)
1258 self.assertEqual(True, options.output)
1259 self.assertEqual(False, options.debug)
1260 self.assertEqual(False, options.stacktrace)
1261 self.assertEqual(False, options.diagnostics)
1262 self.assertEqual([], options.actions)
1263
1264 def testConstructor_067(self):
1265 """
1266 Test constructor with argumentList=["-O", ], validate=False.
1267 """
1268 options = Options(argumentList=["-O"], validate=False)
1269 self.assertEqual(False, options.help)
1270 self.assertEqual(False, options.version)
1271 self.assertEqual(False, options.verbose)
1272 self.assertEqual(False, options.quiet)
1273 self.assertEqual(None, options.config)
1274 self.assertEqual(False, options.full)
1275 self.assertEqual(False, options.managed)
1276 self.assertEqual(False, options.managedOnly)
1277 self.assertEqual(None, options.logfile)
1278 self.assertEqual(None, options.owner)
1279 self.assertEqual(None, options.mode)
1280 self.assertEqual(True, options.output)
1281 self.assertEqual(False, options.debug)
1282 self.assertEqual(False, options.stacktrace)
1283 self.assertEqual(False, options.diagnostics)
1284 self.assertEqual([], options.actions)
1285
1286 def testConstructor_068(self):
1287 """
1288 Test constructor with argumentString="-O", validate=False.
1289 """
1290 options = Options(argumentString="-O", validate=False)
1291 self.assertEqual(False, options.help)
1292 self.assertEqual(False, options.version)
1293 self.assertEqual(False, options.verbose)
1294 self.assertEqual(False, options.quiet)
1295 self.assertEqual(None, options.config)
1296 self.assertEqual(False, options.full)
1297 self.assertEqual(False, options.managed)
1298 self.assertEqual(False, options.managedOnly)
1299 self.assertEqual(None, options.logfile)
1300 self.assertEqual(None, options.owner)
1301 self.assertEqual(None, options.mode)
1302 self.assertEqual(True, options.output)
1303 self.assertEqual(False, options.debug)
1304 self.assertEqual(False, options.stacktrace)
1305 self.assertEqual(False, options.diagnostics)
1306 self.assertEqual([], options.actions)
1307
1308 def testConstructor_069(self):
1309 """
1310 Test constructor with argumentList=["--debug", ], validate=False.
1311 """
1312 options = Options(argumentList=["--debug"], validate=False)
1313 self.assertEqual(False, options.help)
1314 self.assertEqual(False, options.version)
1315 self.assertEqual(False, options.verbose)
1316 self.assertEqual(False, options.quiet)
1317 self.assertEqual(None, options.config)
1318 self.assertEqual(False, options.full)
1319 self.assertEqual(False, options.managed)
1320 self.assertEqual(False, options.managedOnly)
1321 self.assertEqual(None, options.logfile)
1322 self.assertEqual(None, options.owner)
1323 self.assertEqual(None, options.mode)
1324 self.assertEqual(False, options.output)
1325 self.assertEqual(True, options.debug)
1326 self.assertEqual(False, options.stacktrace)
1327 self.assertEqual(False, options.diagnostics)
1328 self.assertEqual([], options.actions)
1329
1330 def testConstructor_070(self):
1331 """
1332 Test constructor with argumentString="--debug", validate=False.
1333 """
1334 options = Options(argumentString="--debug", validate=False)
1335 self.assertEqual(False, options.help)
1336 self.assertEqual(False, options.version)
1337 self.assertEqual(False, options.verbose)
1338 self.assertEqual(False, options.quiet)
1339 self.assertEqual(None, options.config)
1340 self.assertEqual(False, options.full)
1341 self.assertEqual(False, options.managed)
1342 self.assertEqual(False, options.managedOnly)
1343 self.assertEqual(None, options.logfile)
1344 self.assertEqual(None, options.owner)
1345 self.assertEqual(None, options.mode)
1346 self.assertEqual(False, options.output)
1347 self.assertEqual(True, options.debug)
1348 self.assertEqual(False, options.stacktrace)
1349 self.assertEqual(False, options.diagnostics)
1350 self.assertEqual([], options.actions)
1351
1352 def testConstructor_071(self):
1353 """
1354 Test constructor with argumentList=["-d", ], validate=False.
1355 """
1356 options = Options(argumentList=["-d"], validate=False)
1357 self.assertEqual(False, options.help)
1358 self.assertEqual(False, options.version)
1359 self.assertEqual(False, options.verbose)
1360 self.assertEqual(False, options.quiet)
1361 self.assertEqual(None, options.config)
1362 self.assertEqual(False, options.full)
1363 self.assertEqual(False, options.managed)
1364 self.assertEqual(False, options.managedOnly)
1365 self.assertEqual(None, options.logfile)
1366 self.assertEqual(None, options.owner)
1367 self.assertEqual(None, options.mode)
1368 self.assertEqual(False, options.output)
1369 self.assertEqual(True, options.debug)
1370 self.assertEqual(False, options.stacktrace)
1371 self.assertEqual(False, options.diagnostics)
1372 self.assertEqual([], options.actions)
1373
1374 def testConstructor_072(self):
1375 """
1376 Test constructor with argumentString="-d", validate=False.
1377 """
1378 options = Options(argumentString="-d", validate=False)
1379 self.assertEqual(False, options.help)
1380 self.assertEqual(False, options.version)
1381 self.assertEqual(False, options.verbose)
1382 self.assertEqual(False, options.quiet)
1383 self.assertEqual(None, options.config)
1384 self.assertEqual(False, options.full)
1385 self.assertEqual(False, options.managed)
1386 self.assertEqual(False, options.managedOnly)
1387 self.assertEqual(None, options.logfile)
1388 self.assertEqual(None, options.owner)
1389 self.assertEqual(None, options.mode)
1390 self.assertEqual(False, options.output)
1391 self.assertEqual(True, options.debug)
1392 self.assertEqual(False, options.stacktrace)
1393 self.assertEqual(False, options.diagnostics)
1394 self.assertEqual([], options.actions)
1395
1396 def testConstructor_073(self):
1397 """
1398 Test constructor with argumentList=["--stack", ], validate=False.
1399 """
1400 options = Options(argumentList=["--stack"], validate=False)
1401 self.assertEqual(False, options.help)
1402 self.assertEqual(False, options.version)
1403 self.assertEqual(False, options.verbose)
1404 self.assertEqual(False, options.quiet)
1405 self.assertEqual(None, options.config)
1406 self.assertEqual(False, options.full)
1407 self.assertEqual(False, options.managed)
1408 self.assertEqual(False, options.managedOnly)
1409 self.assertEqual(None, options.logfile)
1410 self.assertEqual(None, options.owner)
1411 self.assertEqual(None, options.mode)
1412 self.assertEqual(False, options.output)
1413 self.assertEqual(False, options.debug)
1414 self.assertEqual(True, options.stacktrace)
1415 self.assertEqual(False, options.diagnostics)
1416 self.assertEqual([], options.actions)
1417
1418 def testConstructor_074(self):
1419 """
1420 Test constructor with argumentString="--stack", validate=False.
1421 """
1422 options = Options(argumentString="--stack", validate=False)
1423 self.assertEqual(False, options.help)
1424 self.assertEqual(False, options.version)
1425 self.assertEqual(False, options.verbose)
1426 self.assertEqual(False, options.quiet)
1427 self.assertEqual(None, options.config)
1428 self.assertEqual(False, options.full)
1429 self.assertEqual(False, options.managed)
1430 self.assertEqual(False, options.managedOnly)
1431 self.assertEqual(None, options.logfile)
1432 self.assertEqual(None, options.owner)
1433 self.assertEqual(None, options.mode)
1434 self.assertEqual(False, options.output)
1435 self.assertEqual(False, options.debug)
1436 self.assertEqual(True, options.stacktrace)
1437 self.assertEqual(False, options.diagnostics)
1438 self.assertEqual([], options.actions)
1439
1440 def testConstructor_075(self):
1441 """
1442 Test constructor with argumentList=["-s", ], validate=False.
1443 """
1444 options = Options(argumentList=["-s"], validate=False)
1445 self.assertEqual(False, options.help)
1446 self.assertEqual(False, options.version)
1447 self.assertEqual(False, options.verbose)
1448 self.assertEqual(False, options.quiet)
1449 self.assertEqual(None, options.config)
1450 self.assertEqual(False, options.full)
1451 self.assertEqual(False, options.managed)
1452 self.assertEqual(False, options.managedOnly)
1453 self.assertEqual(None, options.logfile)
1454 self.assertEqual(None, options.owner)
1455 self.assertEqual(None, options.mode)
1456 self.assertEqual(False, options.output)
1457 self.assertEqual(False, options.debug)
1458 self.assertEqual(True, options.stacktrace)
1459 self.assertEqual([], options.actions)
1460
1461 def testConstructor_076(self):
1462 """
1463 Test constructor with argumentString="-s", validate=False.
1464 """
1465 options = Options(argumentString="-s", validate=False)
1466 self.assertEqual(False, options.help)
1467 self.assertEqual(False, options.version)
1468 self.assertEqual(False, options.verbose)
1469 self.assertEqual(False, options.quiet)
1470 self.assertEqual(None, options.config)
1471 self.assertEqual(False, options.full)
1472 self.assertEqual(False, options.managed)
1473 self.assertEqual(False, options.managedOnly)
1474 self.assertEqual(None, options.logfile)
1475 self.assertEqual(None, options.owner)
1476 self.assertEqual(None, options.mode)
1477 self.assertEqual(False, options.output)
1478 self.assertEqual(False, options.debug)
1479 self.assertEqual(True, options.stacktrace)
1480 self.assertEqual(False, options.diagnostics)
1481 self.assertEqual([], options.actions)
1482
1483 def testConstructor_077(self):
1484 """
1485 Test constructor with argumentList=["all", ], validate=False.
1486 """
1487 options = Options(argumentList=["all"], validate=False)
1488 self.assertEqual(False, options.help)
1489 self.assertEqual(False, options.version)
1490 self.assertEqual(False, options.verbose)
1491 self.assertEqual(False, options.quiet)
1492 self.assertEqual(None, options.config)
1493 self.assertEqual(False, options.full)
1494 self.assertEqual(False, options.managed)
1495 self.assertEqual(False, options.managedOnly)
1496 self.assertEqual(None, options.logfile)
1497 self.assertEqual(None, options.owner)
1498 self.assertEqual(None, options.mode)
1499 self.assertEqual(False, options.output)
1500 self.assertEqual(False, options.debug)
1501 self.assertEqual(False, options.stacktrace)
1502 self.assertEqual(False, options.diagnostics)
1503 self.assertEqual(["all"], options.actions)
1504
1505 def testConstructor_078(self):
1506 """
1507 Test constructor with argumentString="all", validate=False.
1508 """
1509 options = Options(argumentString="all", validate=False)
1510 self.assertEqual(False, options.help)
1511 self.assertEqual(False, options.version)
1512 self.assertEqual(False, options.verbose)
1513 self.assertEqual(False, options.quiet)
1514 self.assertEqual(None, options.config)
1515 self.assertEqual(False, options.full)
1516 self.assertEqual(False, options.managed)
1517 self.assertEqual(False, options.managedOnly)
1518 self.assertEqual(None, options.logfile)
1519 self.assertEqual(None, options.owner)
1520 self.assertEqual(None, options.mode)
1521 self.assertEqual(False, options.output)
1522 self.assertEqual(False, options.debug)
1523 self.assertEqual(False, options.stacktrace)
1524 self.assertEqual(False, options.diagnostics)
1525 self.assertEqual(["all"], options.actions)
1526
1527 def testConstructor_079(self):
1528 """
1529 Test constructor with argumentList=["collect", ], validate=False.
1530 """
1531 options = Options(argumentList=["collect"], validate=False)
1532 self.assertEqual(False, options.help)
1533 self.assertEqual(False, options.version)
1534 self.assertEqual(False, options.verbose)
1535 self.assertEqual(False, options.quiet)
1536 self.assertEqual(None, options.config)
1537 self.assertEqual(False, options.full)
1538 self.assertEqual(False, options.managed)
1539 self.assertEqual(False, options.managedOnly)
1540 self.assertEqual(None, options.logfile)
1541 self.assertEqual(None, options.owner)
1542 self.assertEqual(None, options.mode)
1543 self.assertEqual(False, options.output)
1544 self.assertEqual(False, options.debug)
1545 self.assertEqual(False, options.stacktrace)
1546 self.assertEqual(False, options.diagnostics)
1547 self.assertEqual(["collect"], options.actions)
1548
1549 def testConstructor_080(self):
1550 """
1551 Test constructor with argumentString="collect", validate=False.
1552 """
1553 options = Options(argumentString="collect", validate=False)
1554 self.assertEqual(False, options.help)
1555 self.assertEqual(False, options.version)
1556 self.assertEqual(False, options.verbose)
1557 self.assertEqual(False, options.quiet)
1558 self.assertEqual(None, options.config)
1559 self.assertEqual(False, options.full)
1560 self.assertEqual(False, options.managed)
1561 self.assertEqual(False, options.managedOnly)
1562 self.assertEqual(None, options.logfile)
1563 self.assertEqual(None, options.owner)
1564 self.assertEqual(None, options.mode)
1565 self.assertEqual(False, options.output)
1566 self.assertEqual(False, options.debug)
1567 self.assertEqual(False, options.stacktrace)
1568 self.assertEqual(False, options.diagnostics)
1569 self.assertEqual(["collect"], options.actions)
1570
1571 def testConstructor_081(self):
1572 """
1573 Test constructor with argumentList=["stage", ], validate=False.
1574 """
1575 options = Options(argumentList=["stage"], validate=False)
1576 self.assertEqual(False, options.help)
1577 self.assertEqual(False, options.version)
1578 self.assertEqual(False, options.verbose)
1579 self.assertEqual(False, options.quiet)
1580 self.assertEqual(None, options.config)
1581 self.assertEqual(False, options.full)
1582 self.assertEqual(False, options.managed)
1583 self.assertEqual(False, options.managedOnly)
1584 self.assertEqual(None, options.logfile)
1585 self.assertEqual(None, options.owner)
1586 self.assertEqual(None, options.mode)
1587 self.assertEqual(False, options.output)
1588 self.assertEqual(False, options.debug)
1589 self.assertEqual(False, options.stacktrace)
1590 self.assertEqual(False, options.diagnostics)
1591 self.assertEqual(["stage"], options.actions)
1592
1593 def testConstructor_082(self):
1594 """
1595 Test constructor with argumentString="stage", validate=False.
1596 """
1597 options = Options(argumentString="stage", validate=False)
1598 self.assertEqual(False, options.help)
1599 self.assertEqual(False, options.version)
1600 self.assertEqual(False, options.verbose)
1601 self.assertEqual(False, options.quiet)
1602 self.assertEqual(None, options.config)
1603 self.assertEqual(False, options.full)
1604 self.assertEqual(False, options.managed)
1605 self.assertEqual(False, options.managedOnly)
1606 self.assertEqual(None, options.logfile)
1607 self.assertEqual(None, options.owner)
1608 self.assertEqual(None, options.mode)
1609 self.assertEqual(False, options.output)
1610 self.assertEqual(False, options.debug)
1611 self.assertEqual(False, options.stacktrace)
1612 self.assertEqual(False, options.diagnostics)
1613 self.assertEqual(["stage"], options.actions)
1614
1615 def testConstructor_083(self):
1616 """
1617 Test constructor with argumentList=["store", ], validate=False.
1618 """
1619 options = Options(argumentList=["store"], validate=False)
1620 self.assertEqual(False, options.help)
1621 self.assertEqual(False, options.version)
1622 self.assertEqual(False, options.verbose)
1623 self.assertEqual(False, options.quiet)
1624 self.assertEqual(None, options.config)
1625 self.assertEqual(False, options.full)
1626 self.assertEqual(False, options.managed)
1627 self.assertEqual(False, options.managedOnly)
1628 self.assertEqual(None, options.logfile)
1629 self.assertEqual(None, options.owner)
1630 self.assertEqual(None, options.mode)
1631 self.assertEqual(False, options.output)
1632 self.assertEqual(False, options.debug)
1633 self.assertEqual(False, options.stacktrace)
1634 self.assertEqual(False, options.diagnostics)
1635 self.assertEqual(["store"], options.actions)
1636
1637 def testConstructor_084(self):
1638 """
1639 Test constructor with argumentString="store", validate=False.
1640 """
1641 options = Options(argumentString="store", validate=False)
1642 self.assertEqual(False, options.help)
1643 self.assertEqual(False, options.version)
1644 self.assertEqual(False, options.verbose)
1645 self.assertEqual(False, options.quiet)
1646 self.assertEqual(None, options.config)
1647 self.assertEqual(False, options.full)
1648 self.assertEqual(False, options.managed)
1649 self.assertEqual(False, options.managedOnly)
1650 self.assertEqual(None, options.logfile)
1651 self.assertEqual(None, options.owner)
1652 self.assertEqual(None, options.mode)
1653 self.assertEqual(False, options.output)
1654 self.assertEqual(False, options.debug)
1655 self.assertEqual(False, options.stacktrace)
1656 self.assertEqual(False, options.diagnostics)
1657 self.assertEqual(["store"], options.actions)
1658
1659 def testConstructor_085(self):
1660 """
1661 Test constructor with argumentList=["purge", ], validate=False.
1662 """
1663 options = Options(argumentList=["purge"], validate=False)
1664 self.assertEqual(False, options.help)
1665 self.assertEqual(False, options.version)
1666 self.assertEqual(False, options.verbose)
1667 self.assertEqual(False, options.quiet)
1668 self.assertEqual(None, options.config)
1669 self.assertEqual(False, options.full)
1670 self.assertEqual(False, options.managed)
1671 self.assertEqual(False, options.managedOnly)
1672 self.assertEqual(None, options.logfile)
1673 self.assertEqual(None, options.owner)
1674 self.assertEqual(None, options.mode)
1675 self.assertEqual(False, options.output)
1676 self.assertEqual(False, options.debug)
1677 self.assertEqual(False, options.stacktrace)
1678 self.assertEqual(False, options.diagnostics)
1679 self.assertEqual(["purge"], options.actions)
1680
1681 def testConstructor_086(self):
1682 """
1683 Test constructor with argumentString="purge", validate=False.
1684 """
1685 options = Options(argumentString="purge", validate=False)
1686 self.assertEqual(False, options.help)
1687 self.assertEqual(False, options.version)
1688 self.assertEqual(False, options.verbose)
1689 self.assertEqual(False, options.quiet)
1690 self.assertEqual(None, options.config)
1691 self.assertEqual(False, options.full)
1692 self.assertEqual(False, options.managed)
1693 self.assertEqual(False, options.managedOnly)
1694 self.assertEqual(None, options.logfile)
1695 self.assertEqual(None, options.owner)
1696 self.assertEqual(None, options.mode)
1697 self.assertEqual(False, options.output)
1698 self.assertEqual(False, options.debug)
1699 self.assertEqual(False, options.stacktrace)
1700 self.assertEqual(False, options.diagnostics)
1701 self.assertEqual(["purge"], options.actions)
1702
1703 def testConstructor_087(self):
1704 """
1705 Test constructor with argumentList=["rebuild", ], validate=False.
1706 """
1707 options = Options(argumentList=["rebuild"], validate=False)
1708 self.assertEqual(False, options.help)
1709 self.assertEqual(False, options.version)
1710 self.assertEqual(False, options.verbose)
1711 self.assertEqual(False, options.quiet)
1712 self.assertEqual(None, options.config)
1713 self.assertEqual(False, options.full)
1714 self.assertEqual(False, options.managed)
1715 self.assertEqual(False, options.managedOnly)
1716 self.assertEqual(None, options.logfile)
1717 self.assertEqual(None, options.owner)
1718 self.assertEqual(None, options.mode)
1719 self.assertEqual(False, options.output)
1720 self.assertEqual(False, options.debug)
1721 self.assertEqual(False, options.stacktrace)
1722 self.assertEqual(False, options.diagnostics)
1723 self.assertEqual(["rebuild"], options.actions)
1724
1725 def testConstructor_088(self):
1726 """
1727 Test constructor with argumentString="rebuild", validate=False.
1728 """
1729 options = Options(argumentString="rebuild", validate=False)
1730 self.assertEqual(False, options.help)
1731 self.assertEqual(False, options.version)
1732 self.assertEqual(False, options.verbose)
1733 self.assertEqual(False, options.quiet)
1734 self.assertEqual(None, options.config)
1735 self.assertEqual(False, options.full)
1736 self.assertEqual(False, options.managed)
1737 self.assertEqual(False, options.managedOnly)
1738 self.assertEqual(None, options.logfile)
1739 self.assertEqual(None, options.owner)
1740 self.assertEqual(None, options.mode)
1741 self.assertEqual(False, options.output)
1742 self.assertEqual(False, options.debug)
1743 self.assertEqual(False, options.stacktrace)
1744 self.assertEqual(False, options.diagnostics)
1745 self.assertEqual(["rebuild"], options.actions)
1746
1747 def testConstructor_089(self):
1748 """
1749 Test constructor with argumentList=["validate", ], validate=False.
1750 """
1751 options = Options(argumentList=["validate"], validate=False)
1752 self.assertEqual(False, options.help)
1753 self.assertEqual(False, options.version)
1754 self.assertEqual(False, options.verbose)
1755 self.assertEqual(False, options.quiet)
1756 self.assertEqual(None, options.config)
1757 self.assertEqual(False, options.full)
1758 self.assertEqual(False, options.managed)
1759 self.assertEqual(False, options.managedOnly)
1760 self.assertEqual(None, options.logfile)
1761 self.assertEqual(None, options.owner)
1762 self.assertEqual(None, options.mode)
1763 self.assertEqual(False, options.output)
1764 self.assertEqual(False, options.debug)
1765 self.assertEqual(False, options.stacktrace)
1766 self.assertEqual(False, options.diagnostics)
1767 self.assertEqual(["validate"], options.actions)
1768
1769 def testConstructor_090(self):
1770 """
1771 Test constructor with argumentString="validate", validate=False.
1772 """
1773 options = Options(argumentString="validate", validate=False)
1774 self.assertEqual(False, options.help)
1775 self.assertEqual(False, options.version)
1776 self.assertEqual(False, options.verbose)
1777 self.assertEqual(False, options.quiet)
1778 self.assertEqual(None, options.config)
1779 self.assertEqual(False, options.full)
1780 self.assertEqual(False, options.managed)
1781 self.assertEqual(False, options.managedOnly)
1782 self.assertEqual(None, options.logfile)
1783 self.assertEqual(None, options.owner)
1784 self.assertEqual(None, options.mode)
1785 self.assertEqual(False, options.output)
1786 self.assertEqual(False, options.debug)
1787 self.assertEqual(False, options.stacktrace)
1788 self.assertEqual(False, options.diagnostics)
1789 self.assertEqual(["validate"], options.actions)
1790
1791 def testConstructor_091(self):
1792 """
1793 Test constructor with argumentList=["collect", "all", ], validate=False.
1794 """
1795 options = Options(argumentList=["collect", "all"], validate=False)
1796 self.assertEqual(False, options.help)
1797 self.assertEqual(False, options.version)
1798 self.assertEqual(False, options.verbose)
1799 self.assertEqual(False, options.quiet)
1800 self.assertEqual(None, options.config)
1801 self.assertEqual(False, options.full)
1802 self.assertEqual(False, options.managed)
1803 self.assertEqual(False, options.managedOnly)
1804 self.assertEqual(None, options.logfile)
1805 self.assertEqual(None, options.owner)
1806 self.assertEqual(None, options.mode)
1807 self.assertEqual(False, options.output)
1808 self.assertEqual(False, options.debug)
1809 self.assertEqual(False, options.stacktrace)
1810 self.assertEqual(False, options.diagnostics)
1811 self.assertEqual(["collect", "all"], options.actions)
1812
1813 def testConstructor_092(self):
1814 """
1815 Test constructor with argumentString="collect all", validate=False.
1816 """
1817 options = Options(argumentString="collect all", validate=False)
1818 self.assertEqual(False, options.help)
1819 self.assertEqual(False, options.version)
1820 self.assertEqual(False, options.verbose)
1821 self.assertEqual(False, options.quiet)
1822 self.assertEqual(None, options.config)
1823 self.assertEqual(False, options.full)
1824 self.assertEqual(False, options.managed)
1825 self.assertEqual(False, options.managedOnly)
1826 self.assertEqual(None, options.logfile)
1827 self.assertEqual(None, options.owner)
1828 self.assertEqual(None, options.mode)
1829 self.assertEqual(False, options.output)
1830 self.assertEqual(False, options.debug)
1831 self.assertEqual(False, options.stacktrace)
1832 self.assertEqual(False, options.diagnostics)
1833 self.assertEqual(["collect", "all"], options.actions)
1834
1835 def testConstructor_093(self):
1836 """
1837 Test constructor with argumentList=["collect", "rebuild", ], validate=False.
1838 """
1839 options = Options(argumentList=["collect", "rebuild"], validate=False)
1840 self.assertEqual(False, options.help)
1841 self.assertEqual(False, options.version)
1842 self.assertEqual(False, options.verbose)
1843 self.assertEqual(False, options.quiet)
1844 self.assertEqual(None, options.config)
1845 self.assertEqual(False, options.full)
1846 self.assertEqual(False, options.managed)
1847 self.assertEqual(False, options.managedOnly)
1848 self.assertEqual(None, options.logfile)
1849 self.assertEqual(None, options.owner)
1850 self.assertEqual(None, options.mode)
1851 self.assertEqual(False, options.output)
1852 self.assertEqual(False, options.debug)
1853 self.assertEqual(False, options.stacktrace)
1854 self.assertEqual(False, options.diagnostics)
1855 self.assertEqual(["collect", "rebuild"], options.actions)
1856
1857 def testConstructor_094(self):
1858 """
1859 Test constructor with argumentString="collect rebuild", validate=False.
1860 """
1861 options = Options(argumentString="collect rebuild", validate=False)
1862 self.assertEqual(False, options.help)
1863 self.assertEqual(False, options.version)
1864 self.assertEqual(False, options.verbose)
1865 self.assertEqual(False, options.quiet)
1866 self.assertEqual(None, options.config)
1867 self.assertEqual(False, options.full)
1868 self.assertEqual(False, options.managed)
1869 self.assertEqual(False, options.managedOnly)
1870 self.assertEqual(None, options.logfile)
1871 self.assertEqual(None, options.owner)
1872 self.assertEqual(None, options.mode)
1873 self.assertEqual(False, options.output)
1874 self.assertEqual(False, options.debug)
1875 self.assertEqual(False, options.stacktrace)
1876 self.assertEqual(False, options.diagnostics)
1877 self.assertEqual(["collect", "rebuild"], options.actions)
1878
1879 def testConstructor_095(self):
1880 """
1881 Test constructor with argumentList=["collect", "validate", ], validate=False.
1882 """
1883 options = Options(argumentList=["collect", "validate"], validate=False)
1884 self.assertEqual(False, options.help)
1885 self.assertEqual(False, options.version)
1886 self.assertEqual(False, options.verbose)
1887 self.assertEqual(False, options.quiet)
1888 self.assertEqual(None, options.config)
1889 self.assertEqual(False, options.full)
1890 self.assertEqual(False, options.managed)
1891 self.assertEqual(False, options.managedOnly)
1892 self.assertEqual(None, options.logfile)
1893 self.assertEqual(None, options.owner)
1894 self.assertEqual(None, options.mode)
1895 self.assertEqual(False, options.output)
1896 self.assertEqual(False, options.debug)
1897 self.assertEqual(False, options.stacktrace)
1898 self.assertEqual(False, options.diagnostics)
1899 self.assertEqual(["collect", "validate"], options.actions)
1900
1901 def testConstructor_096(self):
1902 """
1903 Test constructor with argumentString="collect validate", validate=False.
1904 """
1905 options = Options(argumentString="collect validate", validate=False)
1906 self.assertEqual(False, options.help)
1907 self.assertEqual(False, options.version)
1908 self.assertEqual(False, options.verbose)
1909 self.assertEqual(False, options.quiet)
1910 self.assertEqual(None, options.config)
1911 self.assertEqual(False, options.full)
1912 self.assertEqual(False, options.managed)
1913 self.assertEqual(False, options.managedOnly)
1914 self.assertEqual(None, options.logfile)
1915 self.assertEqual(None, options.owner)
1916 self.assertEqual(None, options.mode)
1917 self.assertEqual(False, options.output)
1918 self.assertEqual(False, options.debug)
1919 self.assertEqual(False, options.stacktrace)
1920 self.assertEqual(False, options.diagnostics)
1921 self.assertEqual(["collect", "validate"], options.actions)
1922
1923 def testConstructor_097(self):
1924 """
1925 Test constructor with argumentList=["-d", "--verbose", "-O", "--mode", "600", "collect", "stage", ], validate=False.
1926 """
1927 options = Options(argumentList=["-d", "--verbose", "-O", "--mode", "600", "collect", "stage"], validate=False)
1928 self.assertEqual(False, options.help)
1929 self.assertEqual(False, options.version)
1930 self.assertEqual(True, options.verbose)
1931 self.assertEqual(False, options.quiet)
1932 self.assertEqual(None, options.config)
1933 self.assertEqual(False, options.full)
1934 self.assertEqual(False, options.managed)
1935 self.assertEqual(False, options.managedOnly)
1936 self.assertEqual(None, options.logfile)
1937 self.assertEqual(None, options.owner)
1938 self.assertEqual(0o600, options.mode)
1939 self.assertEqual(True, options.output)
1940 self.assertEqual(True, options.debug)
1941 self.assertEqual(False, options.stacktrace)
1942 self.assertEqual(False, options.diagnostics)
1943 self.assertEqual(["collect", "stage"], options.actions)
1944
1945 def testConstructor_098(self):
1946 """
1947 Test constructor with argumentString="-d --verbose -O --mode 600 collect stage", validate=False.
1948 """
1949 options = Options(argumentString="-d --verbose -O --mode 600 collect stage", validate=False)
1950 self.assertEqual(False, options.help)
1951 self.assertEqual(False, options.version)
1952 self.assertEqual(True, options.verbose)
1953 self.assertEqual(False, options.quiet)
1954 self.assertEqual(None, options.config)
1955 self.assertEqual(False, options.full)
1956 self.assertEqual(False, options.managed)
1957 self.assertEqual(False, options.managedOnly)
1958 self.assertEqual(None, options.logfile)
1959 self.assertEqual(None, options.owner)
1960 self.assertEqual(0o600, options.mode)
1961 self.assertEqual(True, options.output)
1962 self.assertEqual(True, options.debug)
1963 self.assertEqual(False, options.stacktrace)
1964 self.assertEqual(False, options.diagnostics)
1965 self.assertEqual(["collect", "stage"], options.actions)
1966
1967 def testConstructor_099(self):
1968 """
1969 Test constructor with argumentList=[], validate=True.
1970 """
1971 self.assertRaises(ValueError, Options, argumentList=[], validate=True)
1972
1973 def testConstructor_100(self):
1974 """
1975 Test constructor with argumentString="", validate=True.
1976 """
1977 self.assertRaises(ValueError, Options, argumentString="", validate=True)
1978
1979 def testConstructor_101(self):
1980 """
1981 Test constructor with argumentList=["--help", ], validate=True.
1982 """
1983 options = Options(argumentList=["--help"], validate=True)
1984 self.assertEqual(True, options.help)
1985 self.assertEqual(False, options.version)
1986 self.assertEqual(False, options.verbose)
1987 self.assertEqual(False, options.quiet)
1988 self.assertEqual(None, options.config)
1989 self.assertEqual(False, options.full)
1990 self.assertEqual(False, options.managed)
1991 self.assertEqual(False, options.managedOnly)
1992 self.assertEqual(None, options.logfile)
1993 self.assertEqual(None, options.owner)
1994 self.assertEqual(None, options.mode)
1995 self.assertEqual(False, options.output)
1996 self.assertEqual(False, options.debug)
1997 self.assertEqual(False, options.stacktrace)
1998 self.assertEqual(False, options.diagnostics)
1999 self.assertEqual([], options.actions)
2000
2001 def testConstructor_102(self):
2002 """
2003 Test constructor with argumentString="--help", validate=True.
2004 """
2005 options = Options(argumentString="--help", validate=True)
2006 self.assertEqual(True, options.help)
2007 self.assertEqual(False, options.version)
2008 self.assertEqual(False, options.verbose)
2009 self.assertEqual(False, options.quiet)
2010 self.assertEqual(None, options.config)
2011 self.assertEqual(False, options.full)
2012 self.assertEqual(False, options.managed)
2013 self.assertEqual(False, options.managedOnly)
2014 self.assertEqual(None, options.logfile)
2015 self.assertEqual(None, options.owner)
2016 self.assertEqual(None, options.mode)
2017 self.assertEqual(False, options.output)
2018 self.assertEqual(False, options.debug)
2019 self.assertEqual(False, options.stacktrace)
2020 self.assertEqual(False, options.diagnostics)
2021 self.assertEqual([], options.actions)
2022
2023 def testConstructor_103(self):
2024 """
2025 Test constructor with argumentList=["-h", ], validate=True.
2026 """
2027 options = Options(argumentList=["-h"], validate=True)
2028 self.assertEqual(True, options.help)
2029 self.assertEqual(False, options.version)
2030 self.assertEqual(False, options.verbose)
2031 self.assertEqual(False, options.quiet)
2032 self.assertEqual(None, options.config)
2033 self.assertEqual(False, options.full)
2034 self.assertEqual(False, options.managed)
2035 self.assertEqual(False, options.managedOnly)
2036 self.assertEqual(None, options.logfile)
2037 self.assertEqual(None, options.owner)
2038 self.assertEqual(None, options.mode)
2039 self.assertEqual(False, options.output)
2040 self.assertEqual(False, options.debug)
2041 self.assertEqual(False, options.stacktrace)
2042 self.assertEqual(False, options.diagnostics)
2043 self.assertEqual([], options.actions)
2044
2045 def testConstructor_104(self):
2046 """
2047 Test constructor with argumentString="-h", validate=True.
2048 """
2049 options = Options(argumentString="-h", validate=True)
2050 self.assertEqual(True, options.help)
2051 self.assertEqual(False, options.version)
2052 self.assertEqual(False, options.verbose)
2053 self.assertEqual(False, options.quiet)
2054 self.assertEqual(None, options.config)
2055 self.assertEqual(False, options.full)
2056 self.assertEqual(False, options.managed)
2057 self.assertEqual(False, options.managedOnly)
2058 self.assertEqual(None, options.logfile)
2059 self.assertEqual(None, options.owner)
2060 self.assertEqual(None, options.mode)
2061 self.assertEqual(False, options.output)
2062 self.assertEqual(False, options.debug)
2063 self.assertEqual(False, options.stacktrace)
2064 self.assertEqual(False, options.diagnostics)
2065 self.assertEqual([], options.actions)
2066
2067 def testConstructor_105(self):
2068 """
2069 Test constructor with argumentList=["--version", ], validate=True.
2070 """
2071 options = Options(argumentList=["--version"], validate=True)
2072 self.assertEqual(False, options.help)
2073 self.assertEqual(True, options.version)
2074 self.assertEqual(False, options.verbose)
2075 self.assertEqual(False, options.quiet)
2076 self.assertEqual(None, options.config)
2077 self.assertEqual(False, options.full)
2078 self.assertEqual(False, options.managed)
2079 self.assertEqual(False, options.managedOnly)
2080 self.assertEqual(None, options.logfile)
2081 self.assertEqual(None, options.owner)
2082 self.assertEqual(None, options.mode)
2083 self.assertEqual(False, options.output)
2084 self.assertEqual(False, options.debug)
2085 self.assertEqual(False, options.stacktrace)
2086 self.assertEqual(False, options.diagnostics)
2087 self.assertEqual([], options.actions)
2088
2089 def testConstructor_106(self):
2090 """
2091 Test constructor with argumentString="--version", validate=True.
2092 """
2093 options = Options(argumentString="--version", validate=True)
2094 self.assertEqual(False, options.help)
2095 self.assertEqual(True, options.version)
2096 self.assertEqual(False, options.verbose)
2097 self.assertEqual(False, options.quiet)
2098 self.assertEqual(None, options.config)
2099 self.assertEqual(False, options.full)
2100 self.assertEqual(False, options.managed)
2101 self.assertEqual(False, options.managedOnly)
2102 self.assertEqual(None, options.logfile)
2103 self.assertEqual(None, options.owner)
2104 self.assertEqual(None, options.mode)
2105 self.assertEqual(False, options.output)
2106 self.assertEqual(False, options.debug)
2107 self.assertEqual(False, options.stacktrace)
2108 self.assertEqual(False, options.diagnostics)
2109 self.assertEqual([], options.actions)
2110
2111 def testConstructor_107(self):
2112 """
2113 Test constructor with argumentList=["-V", ], validate=True.
2114 """
2115 options = Options(argumentList=["-V"], validate=True)
2116 self.assertEqual(False, options.help)
2117 self.assertEqual(True, options.version)
2118 self.assertEqual(False, options.verbose)
2119 self.assertEqual(False, options.quiet)
2120 self.assertEqual(None, options.config)
2121 self.assertEqual(False, options.full)
2122 self.assertEqual(False, options.managed)
2123 self.assertEqual(False, options.managedOnly)
2124 self.assertEqual(None, options.logfile)
2125 self.assertEqual(None, options.owner)
2126 self.assertEqual(None, options.mode)
2127 self.assertEqual(False, options.output)
2128 self.assertEqual(False, options.debug)
2129 self.assertEqual(False, options.stacktrace)
2130 self.assertEqual(False, options.diagnostics)
2131 self.assertEqual([], options.actions)
2132
2133 def testConstructor_108(self):
2134 """
2135 Test constructor with argumentString="-V", validate=True.
2136 """
2137 options = Options(argumentString="-V", validate=True)
2138 self.assertEqual(False, options.help)
2139 self.assertEqual(True, options.version)
2140 self.assertEqual(False, options.verbose)
2141 self.assertEqual(False, options.quiet)
2142 self.assertEqual(None, options.config)
2143 self.assertEqual(False, options.full)
2144 self.assertEqual(False, options.managed)
2145 self.assertEqual(False, options.managedOnly)
2146 self.assertEqual(None, options.logfile)
2147 self.assertEqual(None, options.owner)
2148 self.assertEqual(None, options.mode)
2149 self.assertEqual(False, options.output)
2150 self.assertEqual(False, options.debug)
2151 self.assertEqual(False, options.stacktrace)
2152 self.assertEqual(False, options.diagnostics)
2153 self.assertEqual([], options.actions)
2154
2155 def testConstructor_109(self):
2156 """
2157 Test constructor with argumentList=["--verbose", ], validate=True.
2158 """
2159 self.assertRaises(ValueError, Options, argumentList=["--verbose"], validate=True)
2160
2161 def testConstructor_110(self):
2162 """
2163 Test constructor with argumentString="--verbose", validate=True.
2164 """
2165 self.assertRaises(ValueError, Options, argumentString="--verbose", validate=True)
2166
2167 def testConstructor_111(self):
2168 """
2169 Test constructor with argumentList=["-b", ], validate=True.
2170 """
2171 self.assertRaises(ValueError, Options, argumentList=["-b"], validate=True)
2172
2173 def testConstructor_112(self):
2174 """
2175 Test constructor with argumentString="-b", validate=True.
2176 """
2177 self.assertRaises(ValueError, Options, argumentString="-b", validate=True)
2178
2179 def testConstructor_113(self):
2180 """
2181 Test constructor with argumentList=["--quiet", ], validate=True.
2182 """
2183 self.assertRaises(ValueError, Options, argumentList=["--quiet"], validate=True)
2184
2185 def testConstructor_114(self):
2186 """
2187 Test constructor with argumentString="--quiet", validate=True.
2188 """
2189 self.assertRaises(ValueError, Options, argumentString="--quiet", validate=True)
2190
2191 def testConstructor_115(self):
2192 """
2193 Test constructor with argumentList=["-q", ], validate=True.
2194 """
2195 self.assertRaises(ValueError, Options, argumentList=["-q"], validate=True)
2196
2197 def testConstructor_116(self):
2198 """
2199 Test constructor with argumentString="-q", validate=True.
2200 """
2201 self.assertRaises(ValueError, Options, argumentString="-q", validate=True)
2202
2203 def testConstructor_117(self):
2204 """
2205 Test constructor with argumentList=["--config", ], validate=True.
2206 """
2207 self.assertRaises(GetoptError, Options, argumentList=["--config"], validate=True)
2208
2209 def testConstructor_118(self):
2210 """
2211 Test constructor with argumentString="--config", validate=True.
2212 """
2213 self.assertRaises(GetoptError, Options, argumentString="--config", validate=True)
2214
2215 def testConstructor_119(self):
2216 """
2217 Test constructor with argumentList=["-c", ], validate=True.
2218 """
2219 self.assertRaises(GetoptError, Options, argumentList=["-c"], validate=True)
2220
2221 def testConstructor_120(self):
2222 """
2223 Test constructor with argumentString="-c", validate=True.
2224 """
2225 self.assertRaises(GetoptError, Options, argumentString="-c", validate=True)
2226
2227 def testConstructor_121(self):
2228 """
2229 Test constructor with argumentList=["--config", "something", ], validate=True.
2230 """
2231 self.assertRaises(ValueError, Options, argumentList=["--config", "something"], validate=True)
2232
2233 def testConstructor_122(self):
2234 """
2235 Test constructor with argumentString="--config something", validate=True.
2236 """
2237 self.assertRaises(ValueError, Options, argumentString="--config something", validate=True)
2238
2239 def testConstructor_123(self):
2240 """
2241 Test constructor with argumentList=["-c", "something", ], validate=True.
2242 """
2243 self.assertRaises(ValueError, Options, argumentList=["-c", "something"], validate=True)
2244
2245 def testConstructor_124(self):
2246 """
2247 Test constructor with argumentString="-c something", validate=True.
2248 """
2249 self.assertRaises(ValueError, Options, argumentString="-c something", validate=True)
2250
2251 def testConstructor_125(self):
2252 """
2253 Test constructor with argumentList=["--full", ], validate=True.
2254 """
2255 self.assertRaises(ValueError, Options, argumentList=["--full"], validate=True)
2256
2257 def testConstructor_126(self):
2258 """
2259 Test constructor with argumentString="--full", validate=True.
2260 """
2261 self.assertRaises(ValueError, Options, argumentString="--full", validate=True)
2262
2263 def testConstructor_127(self):
2264 """
2265 Test constructor with argumentList=["-f", ], validate=True.
2266 """
2267 self.assertRaises(ValueError, Options, argumentList=["-f"], validate=True)
2268
2269 def testConstructor_128(self):
2270 """
2271 Test constructor with argumentString="-f", validate=True.
2272 """
2273 self.assertRaises(ValueError, Options, argumentString="-f", validate=True)
2274
2275 def testConstructor_129(self):
2276 """
2277 Test constructor with argumentList=["--logfile", ], validate=True.
2278 """
2279 self.assertRaises(GetoptError, Options, argumentList=["--logfile"], validate=True)
2280
2281 def testConstructor_130(self):
2282 """
2283 Test constructor with argumentString="--logfile", validate=True.
2284 """
2285 self.assertRaises(GetoptError, Options, argumentString="--logfile", validate=True)
2286
2287 def testConstructor_131(self):
2288 """
2289 Test constructor with argumentList=["-l", ], validate=True.
2290 """
2291 self.assertRaises(GetoptError, Options, argumentList=["-l"], validate=True)
2292
2293 def testConstructor_132(self):
2294 """
2295 Test constructor with argumentString="-l", validate=True.
2296 """
2297 self.assertRaises(GetoptError, Options, argumentString="-l", validate=True)
2298
2299 def testConstructor_133(self):
2300 """
2301 Test constructor with argumentList=["--logfile", "something", ], validate=True.
2302 """
2303 self.assertRaises(ValueError, Options, argumentList=["--logfile", "something"], validate=True)
2304
2305 def testConstructor_134(self):
2306 """
2307 Test constructor with argumentString="--logfile something", validate=True.
2308 """
2309 self.assertRaises(ValueError, Options, argumentString="--logfile something", validate=True)
2310
2311 def testConstructor_135(self):
2312 """
2313 Test constructor with argumentList=["-l", "something", ], validate=True.
2314 """
2315 self.assertRaises(ValueError, Options, argumentList=["-l", "something"], validate=True)
2316
2317 def testConstructor_136(self):
2318 """
2319 Test constructor with argumentString="-l something", validate=True.
2320 """
2321 self.assertRaises(ValueError, Options, argumentString="-l something", validate=True)
2322
2323 def testConstructor_137(self):
2324 """
2325 Test constructor with argumentList=["--owner", ], validate=True.
2326 """
2327 self.assertRaises(GetoptError, Options, argumentList=["--owner"], validate=True)
2328
2329 def testConstructor_138(self):
2330 """
2331 Test constructor with argumentString="--owner", validate=True.
2332 """
2333 self.assertRaises(GetoptError, Options, argumentString="--owner", validate=True)
2334
2335 def testConstructor_139(self):
2336 """
2337 Test constructor with argumentList=["-o", ], validate=True.
2338 """
2339 self.assertRaises(GetoptError, Options, argumentList=["-o"], validate=True)
2340
2341 def testConstructor_140(self):
2342 """
2343 Test constructor with argumentString="-o", validate=True.
2344 """
2345 self.assertRaises(GetoptError, Options, argumentString="-o", validate=True)
2346
2347 def testConstructor_141(self):
2348 """
2349 Test constructor with argumentList=["--owner", "something", ], validate=True.
2350 """
2351 self.assertRaises(ValueError, Options, argumentList=["--owner", "something"], validate=True)
2352
2353 def testConstructor_142(self):
2354 """
2355 Test constructor with argumentString="--owner something", validate=True.
2356 """
2357 self.assertRaises(ValueError, Options, argumentString="--owner something", validate=True)
2358
2359 def testConstructor_143(self):
2360 """
2361 Test constructor with argumentList=["-o", "something", ], validate=True.
2362 """
2363 self.assertRaises(ValueError, Options, argumentList=["-o", "something"], validate=True)
2364
2365 def testConstructor_144(self):
2366 """
2367 Test constructor with argumentString="-o something", validate=True.
2368 """
2369 self.assertRaises(ValueError, Options, argumentString="-o something", validate=True)
2370
2371 def testConstructor_145(self):
2372 """
2373 Test constructor with argumentList=["--owner", "a:b", ], validate=True.
2374 """
2375 self.assertRaises(ValueError, Options, argumentList=["--owner", "a:b"], validate=True)
2376
2377 def testConstructor_146(self):
2378 """
2379 Test constructor with argumentString="--owner a:b", validate=True.
2380 """
2381 self.assertRaises(ValueError, Options, argumentString="--owner a:b", validate=True)
2382
2383 def testConstructor_147(self):
2384 """
2385 Test constructor with argumentList=["-o", "a:b", ], validate=True.
2386 """
2387 self.assertRaises(ValueError, Options, argumentList=["-o", "a:b"], validate=True)
2388
2389 def testConstructor_148(self):
2390 """
2391 Test constructor with argumentString="-o a:b", validate=True.
2392 """
2393 self.assertRaises(ValueError, Options, argumentString="-o a:b", validate=True)
2394
2395 def testConstructor_149(self):
2396 """
2397 Test constructor with argumentList=["--mode", ], validate=True.
2398 """
2399 self.assertRaises(GetoptError, Options, argumentList=["--mode"], validate=True)
2400
2401 def testConstructor_150(self):
2402 """
2403 Test constructor with argumentString="--mode", validate=True.
2404 """
2405 self.assertRaises(GetoptError, Options, argumentString="--mode", validate=True)
2406
2407 def testConstructor_151(self):
2408 """
2409 Test constructor with argumentList=["-m", ], validate=True.
2410 """
2411 self.assertRaises(GetoptError, Options, argumentList=["-m"], validate=True)
2412
2413 def testConstructor_152(self):
2414 """
2415 Test constructor with argumentString="-m", validate=True.
2416 """
2417 self.assertRaises(GetoptError, Options, argumentString="-m", validate=True)
2418
2419 def testConstructor_153(self):
2420 """
2421 Test constructor with argumentList=["--mode", "something", ], validate=True.
2422 """
2423 self.assertRaises(ValueError, Options, argumentList=["--mode", "something"], validate=True)
2424
2425 def testConstructor_154(self):
2426 """
2427 Test constructor with argumentString="--mode something", validate=True.
2428 """
2429 self.assertRaises(ValueError, Options, argumentString="--mode something", validate=True)
2430
2431 def testConstructor_155(self):
2432 """
2433 Test constructor with argumentList=["-m", "something", ], validate=True.
2434 """
2435 self.assertRaises(ValueError, Options, argumentList=["-m", "something"], validate=True)
2436
2437 def testConstructor_156(self):
2438 """
2439 Test constructor with argumentString="-m something", validate=True.
2440 """
2441 self.assertRaises(ValueError, Options, argumentString="-m something", validate=True)
2442
2443 def testConstructor_157(self):
2444 """
2445 Test constructor with argumentList=["--mode", "631", ], validate=True.
2446 """
2447 self.assertRaises(ValueError, Options, argumentList=["--mode", "631"], validate=True)
2448
2449 def testConstructor_158(self):
2450 """
2451 Test constructor with argumentString="--mode 631", validate=True.
2452 """
2453 self.assertRaises(ValueError, Options, argumentString="--mode 631", validate=True)
2454
2455 def testConstructor_159(self):
2456 """
2457 Test constructor with argumentList=["-m", "631", ], validate=True.
2458 """
2459 self.assertRaises(ValueError, Options, argumentList=["-m", "631"], validate=True)
2460
2461 def testConstructor_160(self):
2462 """
2463 Test constructor with argumentString="-m 631", validate=True.
2464 """
2465 self.assertRaises(ValueError, Options, argumentString="-m 631", validate=True)
2466
2467 def testConstructor_161(self):
2468 """
2469 Test constructor with argumentList=["--output", ], validate=True.
2470 """
2471 self.assertRaises(ValueError, Options, argumentList=["--output"], validate=True)
2472
2473 def testConstructor_162(self):
2474 """
2475 Test constructor with argumentString="--output", validate=True.
2476 """
2477 self.assertRaises(ValueError, Options, argumentString="--output", validate=True)
2478
2479 def testConstructor_163(self):
2480 """
2481 Test constructor with argumentList=["-O", ], validate=True.
2482 """
2483 self.assertRaises(ValueError, Options, argumentList=["-O"], validate=True)
2484
2485 def testConstructor_164(self):
2486 """
2487 Test constructor with argumentString="-O", validate=True.
2488 """
2489 self.assertRaises(ValueError, Options, argumentString="-O", validate=True)
2490
2491 def testConstructor_165(self):
2492 """
2493 Test constructor with argumentList=["--debug", ], validate=True.
2494 """
2495 self.assertRaises(ValueError, Options, argumentList=["--debug"], validate=True)
2496
2497 def testConstructor_166(self):
2498 """
2499 Test constructor with argumentString="--debug", validate=True.
2500 """
2501 self.assertRaises(ValueError, Options, argumentString="--debug", validate=True)
2502
2503 def testConstructor_167(self):
2504 """
2505 Test constructor with argumentList=["-d", ], validate=True.
2506 """
2507 self.assertRaises(ValueError, Options, argumentList=["-d"], validate=True)
2508
2509 def testConstructor_168(self):
2510 """
2511 Test constructor with argumentString="-d", validate=True.
2512 """
2513 self.assertRaises(ValueError, Options, argumentString="-d", validate=True)
2514
2515 def testConstructor_169(self):
2516 """
2517 Test constructor with argumentList=["--stack", ], validate=True.
2518 """
2519 self.assertRaises(ValueError, Options, argumentList=["--stack"], validate=True)
2520
2521 def testConstructor_170(self):
2522 """
2523 Test constructor with argumentString="--stack", validate=True.
2524 """
2525 self.assertRaises(ValueError, Options, argumentString="--stack", validate=True)
2526
2527 def testConstructor_171(self):
2528 """
2529 Test constructor with argumentList=["-s", ], validate=True.
2530 """
2531 self.assertRaises(ValueError, Options, argumentList=["-s"], validate=True)
2532
2533 def testConstructor_172(self):
2534 """
2535 Test constructor with argumentString="-s", validate=True.
2536 """
2537 self.assertRaises(ValueError, Options, argumentString="-s", validate=True)
2538
2539 def testConstructor_173(self):
2540 """
2541 Test constructor with argumentList=["all", ], validate=True.
2542 """
2543 options = Options(argumentList=["all"], validate=True)
2544 self.assertEqual(False, options.help)
2545 self.assertEqual(False, options.version)
2546 self.assertEqual(False, options.verbose)
2547 self.assertEqual(False, options.quiet)
2548 self.assertEqual(None, options.config)
2549 self.assertEqual(False, options.full)
2550 self.assertEqual(False, options.managed)
2551 self.assertEqual(False, options.managedOnly)
2552 self.assertEqual(None, options.logfile)
2553 self.assertEqual(None, options.owner)
2554 self.assertEqual(None, options.mode)
2555 self.assertEqual(False, options.output)
2556 self.assertEqual(False, options.debug)
2557 self.assertEqual(False, options.stacktrace)
2558 self.assertEqual(False, options.diagnostics)
2559 self.assertEqual(["all"], options.actions)
2560
2561 def testConstructor_174(self):
2562 """
2563 Test constructor with argumentString="all", validate=True.
2564 """
2565 options = Options(argumentString="all", validate=True)
2566 self.assertEqual(False, options.help)
2567 self.assertEqual(False, options.version)
2568 self.assertEqual(False, options.verbose)
2569 self.assertEqual(False, options.quiet)
2570 self.assertEqual(None, options.config)
2571 self.assertEqual(False, options.full)
2572 self.assertEqual(False, options.managed)
2573 self.assertEqual(False, options.managedOnly)
2574 self.assertEqual(None, options.logfile)
2575 self.assertEqual(None, options.owner)
2576 self.assertEqual(None, options.mode)
2577 self.assertEqual(False, options.output)
2578 self.assertEqual(False, options.debug)
2579 self.assertEqual(False, options.stacktrace)
2580 self.assertEqual(False, options.diagnostics)
2581 self.assertEqual(["all"], options.actions)
2582
2583 def testConstructor_175(self):
2584 """
2585 Test constructor with argumentList=["collect", ], validate=True.
2586 """
2587 options = Options(argumentList=["collect"], validate=True)
2588 self.assertEqual(False, options.help)
2589 self.assertEqual(False, options.version)
2590 self.assertEqual(False, options.verbose)
2591 self.assertEqual(False, options.quiet)
2592 self.assertEqual(None, options.config)
2593 self.assertEqual(False, options.full)
2594 self.assertEqual(False, options.managed)
2595 self.assertEqual(False, options.managedOnly)
2596 self.assertEqual(None, options.logfile)
2597 self.assertEqual(None, options.owner)
2598 self.assertEqual(None, options.mode)
2599 self.assertEqual(False, options.output)
2600 self.assertEqual(False, options.debug)
2601 self.assertEqual(False, options.stacktrace)
2602 self.assertEqual(False, options.diagnostics)
2603 self.assertEqual(["collect"], options.actions)
2604
2605 def testConstructor_176(self):
2606 """
2607 Test constructor with argumentString="collect", validate=True.
2608 """
2609 options = Options(argumentString="collect", validate=True)
2610 self.assertEqual(False, options.help)
2611 self.assertEqual(False, options.version)
2612 self.assertEqual(False, options.verbose)
2613 self.assertEqual(False, options.quiet)
2614 self.assertEqual(None, options.config)
2615 self.assertEqual(False, options.full)
2616 self.assertEqual(False, options.managed)
2617 self.assertEqual(False, options.managedOnly)
2618 self.assertEqual(None, options.logfile)
2619 self.assertEqual(None, options.owner)
2620 self.assertEqual(None, options.mode)
2621 self.assertEqual(False, options.output)
2622 self.assertEqual(False, options.debug)
2623 self.assertEqual(False, options.stacktrace)
2624 self.assertEqual(False, options.diagnostics)
2625 self.assertEqual(["collect"], options.actions)
2626
2627 def testConstructor_177(self):
2628 """
2629 Test constructor with argumentList=["stage", ], validate=True.
2630 """
2631 options = Options(argumentList=["stage"], validate=True)
2632 self.assertEqual(False, options.help)
2633 self.assertEqual(False, options.version)
2634 self.assertEqual(False, options.verbose)
2635 self.assertEqual(False, options.quiet)
2636 self.assertEqual(None, options.config)
2637 self.assertEqual(False, options.full)
2638 self.assertEqual(False, options.managed)
2639 self.assertEqual(False, options.managedOnly)
2640 self.assertEqual(None, options.logfile)
2641 self.assertEqual(None, options.owner)
2642 self.assertEqual(None, options.mode)
2643 self.assertEqual(False, options.output)
2644 self.assertEqual(False, options.debug)
2645 self.assertEqual(False, options.stacktrace)
2646 self.assertEqual(False, options.diagnostics)
2647 self.assertEqual(["stage"], options.actions)
2648
2649 def testConstructor_178(self):
2650 """
2651 Test constructor with argumentString="stage", validate=True.
2652 """
2653 options = Options(argumentString="stage", validate=True)
2654 self.assertEqual(False, options.help)
2655 self.assertEqual(False, options.version)
2656 self.assertEqual(False, options.verbose)
2657 self.assertEqual(False, options.quiet)
2658 self.assertEqual(None, options.config)
2659 self.assertEqual(False, options.full)
2660 self.assertEqual(False, options.managed)
2661 self.assertEqual(False, options.managedOnly)
2662 self.assertEqual(None, options.logfile)
2663 self.assertEqual(None, options.owner)
2664 self.assertEqual(None, options.mode)
2665 self.assertEqual(False, options.output)
2666 self.assertEqual(False, options.debug)
2667 self.assertEqual(False, options.stacktrace)
2668 self.assertEqual(False, options.diagnostics)
2669 self.assertEqual(["stage"], options.actions)
2670
2671 def testConstructor_179(self):
2672 """
2673 Test constructor with argumentList=["store", ], validate=True.
2674 """
2675 options = Options(argumentList=["store"], validate=True)
2676 self.assertEqual(False, options.help)
2677 self.assertEqual(False, options.version)
2678 self.assertEqual(False, options.verbose)
2679 self.assertEqual(False, options.quiet)
2680 self.assertEqual(None, options.config)
2681 self.assertEqual(False, options.full)
2682 self.assertEqual(False, options.managed)
2683 self.assertEqual(False, options.managedOnly)
2684 self.assertEqual(None, options.logfile)
2685 self.assertEqual(None, options.owner)
2686 self.assertEqual(None, options.mode)
2687 self.assertEqual(False, options.output)
2688 self.assertEqual(False, options.debug)
2689 self.assertEqual(False, options.stacktrace)
2690 self.assertEqual(False, options.diagnostics)
2691 self.assertEqual(["store"], options.actions)
2692
2693 def testConstructor_180(self):
2694 """
2695 Test constructor with argumentString="store", validate=True.
2696 """
2697 options = Options(argumentString="store", validate=True)
2698 self.assertEqual(False, options.help)
2699 self.assertEqual(False, options.version)
2700 self.assertEqual(False, options.verbose)
2701 self.assertEqual(False, options.quiet)
2702 self.assertEqual(None, options.config)
2703 self.assertEqual(False, options.full)
2704 self.assertEqual(False, options.managed)
2705 self.assertEqual(False, options.managedOnly)
2706 self.assertEqual(None, options.logfile)
2707 self.assertEqual(None, options.owner)
2708 self.assertEqual(None, options.mode)
2709 self.assertEqual(False, options.output)
2710 self.assertEqual(False, options.debug)
2711 self.assertEqual(False, options.stacktrace)
2712 self.assertEqual(False, options.diagnostics)
2713 self.assertEqual(["store"], options.actions)
2714
2715 def testConstructor_181(self):
2716 """
2717 Test constructor with argumentList=["purge", ], validate=True.
2718 """
2719 options = Options(argumentList=["purge"], validate=True)
2720 self.assertEqual(False, options.help)
2721 self.assertEqual(False, options.version)
2722 self.assertEqual(False, options.verbose)
2723 self.assertEqual(False, options.quiet)
2724 self.assertEqual(None, options.config)
2725 self.assertEqual(False, options.full)
2726 self.assertEqual(False, options.managed)
2727 self.assertEqual(False, options.managedOnly)
2728 self.assertEqual(None, options.logfile)
2729 self.assertEqual(None, options.owner)
2730 self.assertEqual(None, options.mode)
2731 self.assertEqual(False, options.output)
2732 self.assertEqual(False, options.debug)
2733 self.assertEqual(False, options.stacktrace)
2734 self.assertEqual(False, options.diagnostics)
2735 self.assertEqual(["purge"], options.actions)
2736
2737 def testConstructor_182(self):
2738 """
2739 Test constructor with argumentString="purge", validate=True.
2740 """
2741 options = Options(argumentString="purge", validate=True)
2742 self.assertEqual(False, options.help)
2743 self.assertEqual(False, options.version)
2744 self.assertEqual(False, options.verbose)
2745 self.assertEqual(False, options.quiet)
2746 self.assertEqual(None, options.config)
2747 self.assertEqual(False, options.full)
2748 self.assertEqual(None, options.logfile)
2749 self.assertEqual(None, options.owner)
2750 self.assertEqual(None, options.mode)
2751 self.assertEqual(False, options.output)
2752 self.assertEqual(False, options.debug)
2753 self.assertEqual(False, options.stacktrace)
2754 self.assertEqual(False, options.diagnostics)
2755 self.assertEqual(["purge"], options.actions)
2756
2757 def testConstructor_183(self):
2758 """
2759 Test constructor with argumentList=["rebuild", ], validate=True.
2760 """
2761 options = Options(argumentList=["rebuild"], validate=True)
2762 self.assertEqual(False, options.help)
2763 self.assertEqual(False, options.version)
2764 self.assertEqual(False, options.verbose)
2765 self.assertEqual(False, options.quiet)
2766 self.assertEqual(None, options.config)
2767 self.assertEqual(False, options.full)
2768 self.assertEqual(False, options.managed)
2769 self.assertEqual(False, options.managedOnly)
2770 self.assertEqual(None, options.logfile)
2771 self.assertEqual(None, options.owner)
2772 self.assertEqual(None, options.mode)
2773 self.assertEqual(False, options.output)
2774 self.assertEqual(False, options.debug)
2775 self.assertEqual(False, options.stacktrace)
2776 self.assertEqual(False, options.diagnostics)
2777 self.assertEqual(["rebuild"], options.actions)
2778
2779 def testConstructor_184(self):
2780 """
2781 Test constructor with argumentString="rebuild", validate=True.
2782 """
2783 options = Options(argumentString="rebuild", validate=True)
2784 self.assertEqual(False, options.help)
2785 self.assertEqual(False, options.version)
2786 self.assertEqual(False, options.verbose)
2787 self.assertEqual(False, options.quiet)
2788 self.assertEqual(None, options.config)
2789 self.assertEqual(False, options.full)
2790 self.assertEqual(False, options.managed)
2791 self.assertEqual(False, options.managedOnly)
2792 self.assertEqual(None, options.logfile)
2793 self.assertEqual(None, options.owner)
2794 self.assertEqual(None, options.mode)
2795 self.assertEqual(False, options.output)
2796 self.assertEqual(False, options.debug)
2797 self.assertEqual(False, options.stacktrace)
2798 self.assertEqual(False, options.diagnostics)
2799 self.assertEqual(["rebuild"], options.actions)
2800
2801 def testConstructor_185(self):
2802 """
2803 Test constructor with argumentList=["validate", ], validate=True.
2804 """
2805 options = Options(argumentList=["validate"], validate=True)
2806 self.assertEqual(False, options.help)
2807 self.assertEqual(False, options.version)
2808 self.assertEqual(False, options.verbose)
2809 self.assertEqual(False, options.quiet)
2810 self.assertEqual(None, options.config)
2811 self.assertEqual(False, options.full)
2812 self.assertEqual(False, options.managed)
2813 self.assertEqual(False, options.managedOnly)
2814 self.assertEqual(None, options.logfile)
2815 self.assertEqual(None, options.owner)
2816 self.assertEqual(None, options.mode)
2817 self.assertEqual(False, options.output)
2818 self.assertEqual(False, options.debug)
2819 self.assertEqual(False, options.stacktrace)
2820 self.assertEqual(False, options.diagnostics)
2821 self.assertEqual(["validate"], options.actions)
2822
2823 def testConstructor_186(self):
2824 """
2825 Test constructor with argumentString="validate", validate=True.
2826 """
2827 options = Options(argumentString="validate", validate=True)
2828 self.assertEqual(False, options.help)
2829 self.assertEqual(False, options.version)
2830 self.assertEqual(False, options.verbose)
2831 self.assertEqual(False, options.quiet)
2832 self.assertEqual(None, options.config)
2833 self.assertEqual(False, options.full)
2834 self.assertEqual(False, options.managed)
2835 self.assertEqual(False, options.managedOnly)
2836 self.assertEqual(None, options.logfile)
2837 self.assertEqual(None, options.owner)
2838 self.assertEqual(None, options.mode)
2839 self.assertEqual(False, options.output)
2840 self.assertEqual(False, options.debug)
2841 self.assertEqual(False, options.stacktrace)
2842 self.assertEqual(False, options.diagnostics)
2843 self.assertEqual(["validate"], options.actions)
2844
2845 def testConstructor_187(self):
2846 """
2847 Test constructor with argumentList=["-d", "--verbose", "-O", "--mode", "600", "collect", "stage", ], validate=True.
2848 """
2849 options = Options(argumentList=["-d", "--verbose", "-O", "--mode", "600", "collect", "stage"], validate=True)
2850 self.assertEqual(False, options.help)
2851 self.assertEqual(False, options.version)
2852 self.assertEqual(True, options.verbose)
2853 self.assertEqual(False, options.quiet)
2854 self.assertEqual(None, options.config)
2855 self.assertEqual(False, options.full)
2856 self.assertEqual(False, options.managed)
2857 self.assertEqual(False, options.managedOnly)
2858 self.assertEqual(None, options.logfile)
2859 self.assertEqual(None, options.owner)
2860 self.assertEqual(0o600, options.mode)
2861 self.assertEqual(True, options.output)
2862 self.assertEqual(True, options.debug)
2863 self.assertEqual(False, options.stacktrace)
2864 self.assertEqual(False, options.diagnostics)
2865 self.assertEqual(["collect", "stage"], options.actions)
2866
2867 def testConstructor_188(self):
2868 """
2869 Test constructor with argumentString="-d --verbose -O --mode 600 collect stage", validate=True.
2870 """
2871 options = Options(argumentString="-d --verbose -O --mode 600 collect stage", validate=True)
2872 self.assertEqual(False, options.help)
2873 self.assertEqual(False, options.version)
2874 self.assertEqual(True, options.verbose)
2875 self.assertEqual(False, options.quiet)
2876 self.assertEqual(None, options.config)
2877 self.assertEqual(False, options.full)
2878 self.assertEqual(False, options.managed)
2879 self.assertEqual(False, options.managedOnly)
2880 self.assertEqual(None, options.logfile)
2881 self.assertEqual(None, options.owner)
2882 self.assertEqual(0o600, options.mode)
2883 self.assertEqual(True, options.output)
2884 self.assertEqual(True, options.debug)
2885 self.assertEqual(False, options.stacktrace)
2886 self.assertEqual(False, options.diagnostics)
2887 self.assertEqual(["collect", "stage"], options.actions)
2888
2889 def testConstructor_189(self):
2890 """
2891 Test constructor with argumentList=["--managed", ], validate=False.
2892 """
2893 options = Options(argumentList=["--managed"], validate=False)
2894 self.assertEqual(False, options.help)
2895 self.assertEqual(False, options.version)
2896 self.assertEqual(False, options.verbose)
2897 self.assertEqual(False, options.quiet)
2898 self.assertEqual(None, options.config)
2899 self.assertEqual(False, options.full)
2900 self.assertEqual(True, options.managed)
2901 self.assertEqual(False, options.managedOnly)
2902 self.assertEqual(None, options.logfile)
2903 self.assertEqual(None, options.owner)
2904 self.assertEqual(None, options.mode)
2905 self.assertEqual(False, options.output)
2906 self.assertEqual(False, options.debug)
2907 self.assertEqual(False, options.stacktrace)
2908 self.assertEqual(False, options.diagnostics)
2909 self.assertEqual([], options.actions)
2910
2911 def testConstructor_190(self):
2912 """
2913 Test constructor with argumentString="--managed", validate=False.
2914 """
2915 options = Options(argumentString="--managed", validate=False)
2916 self.assertEqual(False, options.help)
2917 self.assertEqual(False, options.version)
2918 self.assertEqual(False, options.verbose)
2919 self.assertEqual(False, options.quiet)
2920 self.assertEqual(None, options.config)
2921 self.assertEqual(False, options.full)
2922 self.assertEqual(True, options.managed)
2923 self.assertEqual(False, options.managedOnly)
2924 self.assertEqual(None, options.logfile)
2925 self.assertEqual(None, options.owner)
2926 self.assertEqual(None, options.mode)
2927 self.assertEqual(False, options.output)
2928 self.assertEqual(False, options.debug)
2929 self.assertEqual(False, options.stacktrace)
2930 self.assertEqual(False, options.diagnostics)
2931 self.assertEqual([], options.actions)
2932
2933 def testConstructor_191(self):
2934 """
2935 Test constructor with argumentList=["-M", ], validate=False.
2936 """
2937 options = Options(argumentList=["-M"], validate=False)
2938 self.assertEqual(False, options.help)
2939 self.assertEqual(False, options.version)
2940 self.assertEqual(False, options.verbose)
2941 self.assertEqual(False, options.quiet)
2942 self.assertEqual(None, options.config)
2943 self.assertEqual(False, options.full)
2944 self.assertEqual(True, options.managed)
2945 self.assertEqual(False, options.managedOnly)
2946 self.assertEqual(None, options.logfile)
2947 self.assertEqual(None, options.owner)
2948 self.assertEqual(None, options.mode)
2949 self.assertEqual(False, options.output)
2950 self.assertEqual(False, options.debug)
2951 self.assertEqual(False, options.stacktrace)
2952 self.assertEqual(False, options.diagnostics)
2953 self.assertEqual([], options.actions)
2954
2955 def testConstructor_192(self):
2956 """
2957 Test constructor with argumentString="-M", validate=False.
2958 """
2959 options = Options(argumentString="-M", validate=False)
2960 self.assertEqual(False, options.help)
2961 self.assertEqual(False, options.version)
2962 self.assertEqual(False, options.verbose)
2963 self.assertEqual(False, options.quiet)
2964 self.assertEqual(None, options.config)
2965 self.assertEqual(False, options.full)
2966 self.assertEqual(True, options.managed)
2967 self.assertEqual(False, options.managedOnly)
2968 self.assertEqual(None, options.logfile)
2969 self.assertEqual(None, options.owner)
2970 self.assertEqual(None, options.mode)
2971 self.assertEqual(False, options.output)
2972 self.assertEqual(False, options.debug)
2973 self.assertEqual(False, options.stacktrace)
2974 self.assertEqual(False, options.diagnostics)
2975 self.assertEqual([], options.actions)
2976
2977 def testConstructor_193(self):
2978 """
2979 Test constructor with argumentList=["--managed-only", ], validate=False.
2980 """
2981 options = Options(argumentList=["--managed-only"], validate=False)
2982 self.assertEqual(False, options.help)
2983 self.assertEqual(False, options.version)
2984 self.assertEqual(False, options.verbose)
2985 self.assertEqual(False, options.quiet)
2986 self.assertEqual(None, options.config)
2987 self.assertEqual(False, options.full)
2988 self.assertEqual(False, options.managed)
2989 self.assertEqual(True, options.managedOnly)
2990 self.assertEqual(None, options.logfile)
2991 self.assertEqual(None, options.owner)
2992 self.assertEqual(None, options.mode)
2993 self.assertEqual(False, options.output)
2994 self.assertEqual(False, options.debug)
2995 self.assertEqual(False, options.stacktrace)
2996 self.assertEqual(False, options.diagnostics)
2997 self.assertEqual([], options.actions)
2998
2999 def testConstructor_194(self):
3000 """
3001 Test constructor with argumentString="--managed-only", validate=False.
3002 """
3003 options = Options(argumentString="--managed-only", validate=False)
3004 self.assertEqual(False, options.help)
3005 self.assertEqual(False, options.version)
3006 self.assertEqual(False, options.verbose)
3007 self.assertEqual(False, options.quiet)
3008 self.assertEqual(None, options.config)
3009 self.assertEqual(False, options.full)
3010 self.assertEqual(False, options.managed)
3011 self.assertEqual(True, options.managedOnly)
3012 self.assertEqual(None, options.logfile)
3013 self.assertEqual(None, options.owner)
3014 self.assertEqual(None, options.mode)
3015 self.assertEqual(False, options.output)
3016 self.assertEqual(False, options.debug)
3017 self.assertEqual(False, options.stacktrace)
3018 self.assertEqual(False, options.diagnostics)
3019 self.assertEqual([], options.actions)
3020
3021 def testConstructor_195(self):
3022 """
3023 Test constructor with argumentList=["-N", ], validate=False.
3024 """
3025 options = Options(argumentList=["-N"], validate=False)
3026 self.assertEqual(False, options.help)
3027 self.assertEqual(False, options.version)
3028 self.assertEqual(False, options.verbose)
3029 self.assertEqual(False, options.quiet)
3030 self.assertEqual(None, options.config)
3031 self.assertEqual(False, options.full)
3032 self.assertEqual(False, options.managed)
3033 self.assertEqual(True, options.managedOnly)
3034 self.assertEqual(None, options.logfile)
3035 self.assertEqual(None, options.owner)
3036 self.assertEqual(None, options.mode)
3037 self.assertEqual(False, options.output)
3038 self.assertEqual(False, options.debug)
3039 self.assertEqual(False, options.stacktrace)
3040 self.assertEqual(False, options.diagnostics)
3041 self.assertEqual([], options.actions)
3042
3043 def testConstructor_196(self):
3044 """
3045 Test constructor with argumentString="-N", validate=False.
3046 """
3047 options = Options(argumentString="-N", validate=False)
3048 self.assertEqual(False, options.help)
3049 self.assertEqual(False, options.version)
3050 self.assertEqual(False, options.verbose)
3051 self.assertEqual(False, options.quiet)
3052 self.assertEqual(None, options.config)
3053 self.assertEqual(False, options.full)
3054 self.assertEqual(False, options.managed)
3055 self.assertEqual(True, options.managedOnly)
3056 self.assertEqual(None, options.logfile)
3057 self.assertEqual(None, options.owner)
3058 self.assertEqual(None, options.mode)
3059 self.assertEqual(False, options.output)
3060 self.assertEqual(False, options.debug)
3061 self.assertEqual(False, options.stacktrace)
3062 self.assertEqual(False, options.diagnostics)
3063 self.assertEqual([], options.actions)
3064
3065 def testConstructor_197(self):
3066 """
3067 Test constructor with argumentList=["--managed", ], validate=True.
3068 """
3069 self.assertRaises(ValueError, Options, argumentList=["--managed"], validate=True)
3070
3071 def testConstructor_198(self):
3072 """
3073 Test constructor with argumentString="--managed", validate=True.
3074 """
3075 self.assertRaises(ValueError, Options, argumentString="--managed", validate=True)
3076
3077 def testConstructor_199(self):
3078 """
3079 Test constructor with argumentList=["-M", ], validate=True.
3080 """
3081 self.assertRaises(ValueError, Options, argumentList=["-M"], validate=True)
3082
3083 def testConstructor_200(self):
3084 """
3085 Test constructor with argumentString="-M", validate=True.
3086 """
3087 self.assertRaises(ValueError, Options, argumentString="-M", validate=True)
3088
3089 def testConstructor_201(self):
3090 """
3091 Test constructor with argumentList=["--managed-only", ], validate=True.
3092 """
3093 self.assertRaises(ValueError, Options, argumentList=["--managed-only"], validate=True)
3094
3095 def testConstructor_202(self):
3096 """
3097 Test constructor with argumentString="--managed-only", validate=True.
3098 """
3099 self.assertRaises(ValueError, Options, argumentString="--managed-only", validate=True)
3100
3101 def testConstructor_203(self):
3102 """
3103 Test constructor with argumentList=["-N", ], validate=True.
3104 """
3105 self.assertRaises(ValueError, Options, argumentList=["-N"], validate=True)
3106
3107 def testConstructor_204(self):
3108 """
3109 Test constructor with argumentString="-N", validate=True.
3110 """
3111 self.assertRaises(ValueError, Options, argumentString="-N", validate=True)
3112
3113 def testConstructor_205(self):
3114 """
3115 Test constructor with argumentList=["--diagnostics", ], validate=False.
3116 """
3117 options = Options(argumentList=["--diagnostics"], validate=False)
3118 self.assertEqual(False, options.help)
3119 self.assertEqual(False, options.version)
3120 self.assertEqual(False, options.verbose)
3121 self.assertEqual(False, options.quiet)
3122 self.assertEqual(None, options.config)
3123 self.assertEqual(False, options.full)
3124 self.assertEqual(False, options.managed)
3125 self.assertEqual(False, options.managedOnly)
3126 self.assertEqual(None, options.logfile)
3127 self.assertEqual(None, options.owner)
3128 self.assertEqual(None, options.mode)
3129 self.assertEqual(False, options.output)
3130 self.assertEqual(False, options.debug)
3131 self.assertEqual(False, options.stacktrace)
3132 self.assertEqual(True, options.diagnostics)
3133 self.assertEqual([], options.actions)
3134
3135 def testConstructor_206(self):
3136 """
3137 Test constructor with argumentString="--diagnostics", validate=False.
3138 """
3139 options = Options(argumentString="--diagnostics", validate=False)
3140 self.assertEqual(False, options.help)
3141 self.assertEqual(False, options.version)
3142 self.assertEqual(False, options.verbose)
3143 self.assertEqual(False, options.quiet)
3144 self.assertEqual(None, options.config)
3145 self.assertEqual(False, options.full)
3146 self.assertEqual(False, options.managed)
3147 self.assertEqual(False, options.managedOnly)
3148 self.assertEqual(None, options.logfile)
3149 self.assertEqual(None, options.owner)
3150 self.assertEqual(None, options.mode)
3151 self.assertEqual(False, options.output)
3152 self.assertEqual(False, options.debug)
3153 self.assertEqual(False, options.stacktrace)
3154 self.assertEqual(True, options.diagnostics)
3155 self.assertEqual([], options.actions)
3156
3157 def testConstructor_207(self):
3158 """
3159 Test constructor with argumentList=["-D", ], validate=False.
3160 """
3161 options = Options(argumentList=["-D"], validate=False)
3162 self.assertEqual(False, options.help)
3163 self.assertEqual(False, options.version)
3164 self.assertEqual(False, options.verbose)
3165 self.assertEqual(False, options.quiet)
3166 self.assertEqual(None, options.config)
3167 self.assertEqual(False, options.full)
3168 self.assertEqual(False, options.managed)
3169 self.assertEqual(False, options.managedOnly)
3170 self.assertEqual(None, options.logfile)
3171 self.assertEqual(None, options.owner)
3172 self.assertEqual(None, options.mode)
3173 self.assertEqual(False, options.output)
3174 self.assertEqual(False, options.debug)
3175 self.assertEqual(False, options.stacktrace)
3176 self.assertEqual(True, options.diagnostics)
3177 self.assertEqual([], options.actions)
3178
3179 def testConstructor_208(self):
3180 """
3181 Test constructor with argumentString="-D", validate=False.
3182 """
3183 options = Options(argumentString="-D", validate=False)
3184 self.assertEqual(False, options.help)
3185 self.assertEqual(False, options.version)
3186 self.assertEqual(False, options.verbose)
3187 self.assertEqual(False, options.quiet)
3188 self.assertEqual(None, options.config)
3189 self.assertEqual(False, options.full)
3190 self.assertEqual(False, options.managed)
3191 self.assertEqual(False, options.managedOnly)
3192 self.assertEqual(None, options.logfile)
3193 self.assertEqual(None, options.owner)
3194 self.assertEqual(None, options.mode)
3195 self.assertEqual(False, options.output)
3196 self.assertEqual(False, options.debug)
3197 self.assertEqual(False, options.stacktrace)
3198 self.assertEqual(True, options.diagnostics)
3199 self.assertEqual([], options.actions)
3200
3201 def testConstructor_209(self):
3202 """
3203 Test constructor with argumentList=["--diagnostics", ], validate=True.
3204 """
3205 options = Options(argumentList=["--diagnostics"], validate=True)
3206 self.assertEqual(False, options.help)
3207 self.assertEqual(False, options.version)
3208 self.assertEqual(False, options.verbose)
3209 self.assertEqual(False, options.quiet)
3210 self.assertEqual(None, options.config)
3211 self.assertEqual(False, options.full)
3212 self.assertEqual(False, options.managed)
3213 self.assertEqual(False, options.managedOnly)
3214 self.assertEqual(None, options.logfile)
3215 self.assertEqual(None, options.owner)
3216 self.assertEqual(None, options.mode)
3217 self.assertEqual(False, options.output)
3218 self.assertEqual(False, options.debug)
3219 self.assertEqual(False, options.stacktrace)
3220 self.assertEqual(True, options.diagnostics)
3221 self.assertEqual([], options.actions)
3222
3223 def testConstructor_210(self):
3224 """
3225 Test constructor with argumentString="--diagnostics", validate=True.
3226 """
3227 options = Options(argumentString="--diagnostics", validate=True)
3228 self.assertEqual(False, options.help)
3229 self.assertEqual(False, options.version)
3230 self.assertEqual(False, options.verbose)
3231 self.assertEqual(False, options.quiet)
3232 self.assertEqual(None, options.config)
3233 self.assertEqual(False, options.full)
3234 self.assertEqual(False, options.managed)
3235 self.assertEqual(False, options.managedOnly)
3236 self.assertEqual(None, options.logfile)
3237 self.assertEqual(None, options.owner)
3238 self.assertEqual(None, options.mode)
3239 self.assertEqual(False, options.output)
3240 self.assertEqual(False, options.debug)
3241 self.assertEqual(False, options.stacktrace)
3242 self.assertEqual(True, options.diagnostics)
3243 self.assertEqual([], options.actions)
3244
3245 def testConstructor_211(self):
3246 """
3247 Test constructor with argumentList=["-D", ], validate=True.
3248 """
3249 options = Options(argumentList=["-D"], validate=True)
3250 self.assertEqual(False, options.help)
3251 self.assertEqual(False, options.version)
3252 self.assertEqual(False, options.verbose)
3253 self.assertEqual(False, options.quiet)
3254 self.assertEqual(None, options.config)
3255 self.assertEqual(False, options.full)
3256 self.assertEqual(False, options.managed)
3257 self.assertEqual(False, options.managedOnly)
3258 self.assertEqual(None, options.logfile)
3259 self.assertEqual(None, options.owner)
3260 self.assertEqual(None, options.mode)
3261 self.assertEqual(False, options.output)
3262 self.assertEqual(False, options.debug)
3263 self.assertEqual(False, options.stacktrace)
3264 self.assertEqual(True, options.diagnostics)
3265 self.assertEqual([], options.actions)
3266
3267 def testConstructor_212(self):
3268 """
3269 Test constructor with argumentString="-D", validate=True.
3270 """
3271 options = Options(argumentString="-D", validate=True)
3272 self.assertEqual(False, options.help)
3273 self.assertEqual(False, options.version)
3274 self.assertEqual(False, options.verbose)
3275 self.assertEqual(False, options.quiet)
3276 self.assertEqual(None, options.config)
3277 self.assertEqual(False, options.full)
3278 self.assertEqual(False, options.managed)
3279 self.assertEqual(False, options.managedOnly)
3280 self.assertEqual(None, options.logfile)
3281 self.assertEqual(None, options.owner)
3282 self.assertEqual(None, options.mode)
3283 self.assertEqual(False, options.output)
3284 self.assertEqual(False, options.debug)
3285 self.assertEqual(False, options.stacktrace)
3286 self.assertEqual(True, options.diagnostics)
3287 self.assertEqual([], options.actions)
3288
3289 ############################
3290 # Test comparison operators
3291 ############################
3292
3293 def testComparison_001(self):
3294 """
3295 Test comparison of two identical objects, all attributes at defaults.
3296 """
3297 options1 = Options()
3298 options2 = Options()
3299 self.assertEqual(options1, options2)
3300 self.assertTrue(options1 == options2)
3301 self.assertTrue(not options1 < options2)
3302 self.assertTrue(options1 <= options2)
3303 self.assertTrue(not options1 > options2)
3304 self.assertTrue(options1 >= options2)
3305 self.assertTrue(not options1 != options2)
3306
3307 def testComparison_002(self):
3308 """
3309 Test comparison of two identical objects, all attributes filled in and same.
3310 """
3311 options1 = Options()
3312 options2 = Options()
3313
3314 options1.help = True
3315 options1.version = True
3316 options1.verbose = True
3317 options1.quiet = True
3318 options1.config = "config"
3319 options1.full = True
3320 options1.managed = True
3321 options1.managedOnly = True
3322 options1.logfile = "logfile"
3323 options1.owner = ("a", "b")
3324 options1.mode = "631"
3325 options1.output = True
3326 options1.debug = True
3327 options1.stacktrace = False
3328 options1.diagnostics = False
3329 options1.actions = [
3330 "collect",
3331 ]
3332
3333 options2.help = True
3334 options2.version = True
3335 options2.verbose = True
3336 options2.quiet = True
3337 options2.config = "config"
3338 options2.full = True
3339 options2.managed = True
3340 options2.managedOnly = True
3341 options2.logfile = "logfile"
3342 options2.owner = ("a", "b")
3343 options2.mode = 0o631
3344 options2.output = True
3345 options2.debug = True
3346 options2.stacktrace = False
3347 options2.diagnostics = False
3348 options2.actions = [
3349 "collect",
3350 ]
3351
3352 self.assertEqual(options1, options2)
3353 self.assertTrue(options1 == options2)
3354 self.assertTrue(not options1 < options2)
3355 self.assertTrue(options1 <= options2)
3356 self.assertTrue(not options1 > options2)
3357 self.assertTrue(options1 >= options2)
3358 self.assertTrue(not options1 != options2)
3359
3360 def testComparison_003(self):
3361 """
3362 Test comparison of two identical objects, all attributes filled in, help different.
3363 """
3364 options1 = Options()
3365 options2 = Options()
3366
3367 options1.help = True
3368 options1.version = True
3369 options1.verbose = True
3370 options1.quiet = True
3371 options1.config = "config"
3372 options1.full = True
3373 options1.managed = True
3374 options1.managedOnly = True
3375 options1.logfile = "logfile"
3376 options1.owner = ("a", "b")
3377 options1.mode = "631"
3378 options1.output = True
3379 options1.debug = True
3380 options1.stacktrace = False
3381 options1.diagnostics = False
3382 options1.actions = [
3383 "collect",
3384 ]
3385
3386 options2.help = False
3387 options2.version = True
3388 options2.verbose = True
3389 options2.quiet = True
3390 options2.config = "config"
3391 options2.full = True
3392 options2.managed = True
3393 options2.managedOnly = True
3394 options2.logfile = "logfile"
3395 options2.owner = ("a", "b")
3396 options2.mode = 0o631
3397 options2.output = True
3398 options2.debug = True
3399 options2.stacktrace = False
3400 options2.diagnostics = False
3401 options2.actions = [
3402 "collect",
3403 ]
3404
3405 self.assertNotEqual(options1, options2)
3406 self.assertTrue(not options1 == options2)
3407 self.assertTrue(not options1 < options2)
3408 self.assertTrue(not options1 <= options2)
3409 self.assertTrue(options1 > options2)
3410 self.assertTrue(options1 >= options2)
3411 self.assertTrue(options1 != options2)
3412
3413 def testComparison_004(self):
3414 """
3415 Test comparison of two identical objects, all attributes filled in, version different.
3416 """
3417 options1 = Options()
3418 options2 = Options()
3419
3420 options1.help = True
3421 options1.version = False
3422 options1.verbose = True
3423 options1.quiet = True
3424 options1.config = "config"
3425 options1.full = True
3426 options1.managed = True
3427 options1.managedOnly = True
3428 options1.logfile = "logfile"
3429 options1.owner = ("a", "b")
3430 options1.mode = "631"
3431 options1.output = True
3432 options1.debug = True
3433 options1.stacktrace = False
3434 options1.diagnostics = False
3435 options1.actions = [
3436 "collect",
3437 ]
3438
3439 options2.help = True
3440 options2.version = True
3441 options2.verbose = True
3442 options2.quiet = True
3443 options2.config = "config"
3444 options2.full = True
3445 options2.managed = True
3446 options2.managedOnly = True
3447 options2.logfile = "logfile"
3448 options2.owner = ("a", "b")
3449 options2.mode = 0o631
3450 options2.output = True
3451 options2.debug = True
3452 options2.stacktrace = False
3453 options2.diagnostics = False
3454 options2.actions = [
3455 "collect",
3456 ]
3457
3458 self.assertNotEqual(options1, options2)
3459 self.assertTrue(not options1 == options2)
3460 self.assertTrue(options1 < options2)
3461 self.assertTrue(options1 <= options2)
3462 self.assertTrue(not options1 > options2)
3463 self.assertTrue(not options1 >= options2)
3464 self.assertTrue(options1 != options2)
3465
3466 def testComparison_005(self):
3467 """
3468 Test comparison of two identical objects, all attributes filled in, verbose different.
3469 """
3470 options1 = Options()
3471 options2 = Options()
3472
3473 options1.help = True
3474 options1.version = True
3475 options1.verbose = False
3476 options1.quiet = True
3477 options1.config = "config"
3478 options1.full = True
3479 options1.managed = True
3480 options1.managedOnly = True
3481 options1.logfile = "logfile"
3482 options1.owner = ("a", "b")
3483 options1.mode = "631"
3484 options1.output = True
3485 options1.debug = True
3486 options1.stacktrace = False
3487 options1.diagnostics = False
3488 options1.actions = [
3489 "collect",
3490 ]
3491
3492 options2.help = True
3493 options2.version = True
3494 options2.verbose = True
3495 options2.quiet = True
3496 options2.config = "config"
3497 options2.full = True
3498 options2.managed = True
3499 options2.managedOnly = True
3500 options2.logfile = "logfile"
3501 options2.owner = ("a", "b")
3502 options2.mode = 0o631
3503 options2.output = True
3504 options2.debug = True
3505 options2.stacktrace = False
3506 options2.diagnostics = False
3507 options2.actions = [
3508 "collect",
3509 ]
3510
3511 self.assertNotEqual(options1, options2)
3512 self.assertTrue(not options1 == options2)
3513 self.assertTrue(options1 < options2)
3514 self.assertTrue(options1 <= options2)
3515 self.assertTrue(not options1 > options2)
3516 self.assertTrue(not options1 >= options2)
3517 self.assertTrue(options1 != options2)
3518
3519 def testComparison_006(self):
3520 """
3521 Test comparison of two identical objects, all attributes filled in, quiet different.
3522 """
3523 options1 = Options()
3524 options2 = Options()
3525
3526 options1.help = True
3527 options1.version = True
3528 options1.verbose = True
3529 options1.quiet = True
3530 options1.config = "config"
3531 options1.full = True
3532 options1.managed = True
3533 options1.managedOnly = True
3534 options1.logfile = "logfile"
3535 options1.owner = ("a", "b")
3536 options1.mode = "631"
3537 options1.output = True
3538 options1.debug = True
3539 options1.stacktrace = False
3540 options1.diagnostics = False
3541 options1.actions = [
3542 "collect",
3543 ]
3544
3545 options2.help = True
3546 options2.version = True
3547 options2.verbose = True
3548 options2.quiet = False
3549 options2.config = "config"
3550 options2.full = True
3551 options2.managed = True
3552 options2.managedOnly = True
3553 options2.logfile = "logfile"
3554 options2.owner = ("a", "b")
3555 options2.mode = 0o631
3556 options2.output = True
3557 options2.debug = True
3558 options2.stacktrace = False
3559 options2.diagnostics = False
3560 options2.actions = [
3561 "collect",
3562 ]
3563
3564 self.assertNotEqual(options1, options2)
3565 self.assertTrue(not options1 == options2)
3566 self.assertTrue(not options1 < options2)
3567 self.assertTrue(not options1 <= options2)
3568 self.assertTrue(options1 > options2)
3569 self.assertTrue(options1 >= options2)
3570 self.assertTrue(options1 != options2)
3571
3572 def testComparison_007(self):
3573 """
3574 Test comparison of two identical objects, all attributes filled in, config different.
3575 """
3576 options1 = Options()
3577 options2 = Options()
3578
3579 options1.help = True
3580 options1.version = True
3581 options1.verbose = True
3582 options1.quiet = True
3583 options1.config = "whatever"
3584 options1.full = True
3585 options1.managed = True
3586 options1.managedOnly = True
3587 options1.logfile = "logfile"
3588 options1.owner = ("a", "b")
3589 options1.mode = "631"
3590 options1.output = True
3591 options1.debug = True
3592 options1.stacktrace = False
3593 options1.diagnostics = False
3594 options1.actions = [
3595 "collect",
3596 ]
3597
3598 options2.help = True
3599 options2.version = True
3600 options2.verbose = True
3601 options2.quiet = True
3602 options2.config = "config"
3603 options2.full = True
3604 options2.managed = True
3605 options2.managedOnly = True
3606 options2.logfile = "logfile"
3607 options2.owner = ("a", "b")
3608 options2.mode = 0o631
3609 options2.output = True
3610 options2.debug = True
3611 options2.stacktrace = False
3612 options2.diagnostics = False
3613 options2.actions = [
3614 "collect",
3615 ]
3616
3617 self.assertNotEqual(options1, options2)
3618 self.assertTrue(not options1 == options2)
3619 self.assertTrue(not options1 < options2)
3620 self.assertTrue(not options1 <= options2)
3621 self.assertTrue(options1 > options2)
3622 self.assertTrue(options1 >= options2)
3623 self.assertTrue(options1 != options2)
3624
3625 def testComparison_008(self):
3626 """
3627 Test comparison of two identical objects, all attributes filled in, full different.
3628 """
3629 options1 = Options()
3630 options2 = Options()
3631
3632 options1.help = True
3633 options1.version = True
3634 options1.verbose = True
3635 options1.quiet = True
3636 options1.config = "config"
3637 options1.full = False
3638 options1.managed = True
3639 options1.managedOnly = True
3640 options1.logfile = "logfile"
3641 options1.owner = ("a", "b")
3642 options1.mode = "631"
3643 options1.output = True
3644 options1.debug = True
3645 options1.stacktrace = False
3646 options1.diagnostics = False
3647 options1.actions = [
3648 "collect",
3649 ]
3650
3651 options2.help = True
3652 options2.version = True
3653 options2.verbose = True
3654 options2.quiet = True
3655 options2.config = "config"
3656 options2.full = True
3657 options2.managed = True
3658 options2.managedOnly = True
3659 options2.logfile = "logfile"
3660 options2.owner = ("a", "b")
3661 options2.mode = 0o631
3662 options2.output = True
3663 options2.debug = True
3664 options2.stacktrace = False
3665 options2.diagnostics = False
3666 options2.actions = [
3667 "collect",
3668 ]
3669
3670 self.assertNotEqual(options1, options2)
3671 self.assertTrue(not options1 == options2)
3672 self.assertTrue(options1 < options2)
3673 self.assertTrue(options1 <= options2)
3674 self.assertTrue(not options1 > options2)
3675 self.assertTrue(not options1 >= options2)
3676 self.assertTrue(options1 != options2)
3677
3678 def testComparison_009(self):
3679 """
3680 Test comparison of two identical objects, all attributes filled in, logfile different.
3681 """
3682 options1 = Options()
3683 options2 = Options()
3684
3685 options1.help = True
3686 options1.version = True
3687 options1.verbose = True
3688 options1.quiet = True
3689 options1.config = "config"
3690 options1.full = True
3691 options1.managed = True
3692 options1.managedOnly = True
3693 options1.logfile = "logfile"
3694 options1.owner = ("a", "b")
3695 options1.mode = "631"
3696 options1.output = True
3697 options1.debug = True
3698 options1.stacktrace = False
3699 options1.diagnostics = False
3700 options1.actions = [
3701 "collect",
3702 ]
3703
3704 options2.help = True
3705 options2.version = True
3706 options2.verbose = True
3707 options2.quiet = True
3708 options2.config = "config"
3709 options2.full = True
3710 options2.managed = True
3711 options2.managedOnly = True
3712 options2.logfile = "stuff"
3713 options2.owner = ("a", "b")
3714 options2.mode = 0o631
3715 options2.output = True
3716 options2.debug = True
3717 options2.stacktrace = False
3718 options2.diagnostics = False
3719 options2.actions = [
3720 "collect",
3721 ]
3722
3723 self.assertNotEqual(options1, options2)
3724 self.assertTrue(not options1 == options2)
3725 self.assertTrue(options1 < options2)
3726 self.assertTrue(options1 <= options2)
3727 self.assertTrue(not options1 > options2)
3728 self.assertTrue(not options1 >= options2)
3729 self.assertTrue(options1 != options2)
3730
3731 def testComparison_010(self):
3732 """
3733 Test comparison of two identical objects, all attributes filled in, owner different.
3734 """
3735 options1 = Options()
3736 options2 = Options()
3737
3738 options1.help = True
3739 options1.version = True
3740 options1.verbose = True
3741 options1.quiet = True
3742 options1.config = "config"
3743 options1.full = True
3744 options1.managed = True
3745 options1.managedOnly = True
3746 options1.logfile = "logfile"
3747 options1.owner = ("a", "b")
3748 options1.mode = "631"
3749 options1.output = True
3750 options1.debug = True
3751 options1.stacktrace = False
3752 options1.diagnostics = False
3753 options1.actions = [
3754 "collect",
3755 ]
3756
3757 options2.help = True
3758 options2.version = True
3759 options2.verbose = True
3760 options2.quiet = True
3761 options2.config = "config"
3762 options2.full = True
3763 options2.managed = True
3764 options2.managedOnly = True
3765 options2.logfile = "logfile"
3766 options2.owner = ("c", "d")
3767 options2.mode = 0o631
3768 options2.output = True
3769 options2.debug = True
3770 options2.stacktrace = False
3771 options2.diagnostics = False
3772 options2.actions = [
3773 "collect",
3774 ]
3775
3776 self.assertNotEqual(options1, options2)
3777 self.assertTrue(not options1 == options2)
3778 self.assertTrue(options1 < options2)
3779 self.assertTrue(options1 <= options2)
3780 self.assertTrue(not options1 > options2)
3781 self.assertTrue(not options1 >= options2)
3782 self.assertTrue(options1 != options2)
3783
3784 def testComparison_011(self):
3785 """
3786 Test comparison of two identical objects, all attributes filled in, mode different.
3787 """
3788 options1 = Options()
3789 options2 = Options()
3790
3791 options1.help = True
3792 options1.version = True
3793 options1.verbose = True
3794 options1.quiet = True
3795 options1.config = "config"
3796 options1.full = True
3797 options1.managed = True
3798 options1.managedOnly = True
3799 options1.logfile = "logfile"
3800 options1.owner = ("a", "b")
3801 options1.mode = 0o600
3802 options1.output = True
3803 options1.debug = True
3804 options1.stacktrace = False
3805 options1.diagnostics = False
3806 options1.actions = [
3807 "collect",
3808 ]
3809
3810 options2.help = True
3811 options2.version = True
3812 options2.verbose = True
3813 options2.quiet = True
3814 options2.config = "config"
3815 options2.full = True
3816 options2.managed = True
3817 options2.managedOnly = True
3818 options2.logfile = "logfile"
3819 options2.owner = ("a", "b")
3820 options2.mode = 0o631
3821 options2.output = True
3822 options2.debug = True
3823 options2.stacktrace = False
3824 options2.diagnostics = False
3825 options2.actions = [
3826 "collect",
3827 ]
3828
3829 self.assertNotEqual(options1, options2)
3830 self.assertTrue(not options1 == options2)
3831 self.assertTrue(options1 < options2)
3832 self.assertTrue(options1 <= options2)
3833 self.assertTrue(not options1 > options2)
3834 self.assertTrue(not options1 >= options2)
3835 self.assertTrue(options1 != options2)
3836
3837 def testComparison_012(self):
3838 """
3839 Test comparison of two identical objects, all attributes filled in, output different.
3840 """
3841 options1 = Options()
3842 options2 = Options()
3843
3844 options1.help = True
3845 options1.version = True
3846 options1.verbose = True
3847 options1.quiet = True
3848 options1.config = "config"
3849 options1.full = True
3850 options1.managed = True
3851 options1.managedOnly = True
3852 options1.logfile = "logfile"
3853 options1.owner = ("a", "b")
3854 options1.mode = "631"
3855 options1.output = False
3856 options1.debug = True
3857 options1.stacktrace = False
3858 options1.diagnostics = False
3859 options1.actions = [
3860 "collect",
3861 ]
3862
3863 options2.help = True
3864 options2.version = True
3865 options2.verbose = True
3866 options2.quiet = True
3867 options2.config = "config"
3868 options2.full = True
3869 options2.managed = True
3870 options2.managedOnly = True
3871 options2.logfile = "logfile"
3872 options2.owner = ("a", "b")
3873 options2.mode = 0o631
3874 options2.output = True
3875 options2.debug = True
3876 options2.stacktrace = False
3877 options2.diagnostics = False
3878 options2.actions = [
3879 "collect",
3880 ]
3881
3882 self.assertNotEqual(options1, options2)
3883 self.assertTrue(not options1 == options2)
3884 self.assertTrue(options1 < options2)
3885 self.assertTrue(options1 <= options2)
3886 self.assertTrue(not options1 > options2)
3887 self.assertTrue(not options1 >= options2)
3888 self.assertTrue(options1 != options2)
3889
3890 def testComparison_013(self):
3891 """
3892 Test comparison of two identical objects, all attributes filled in, debug different.
3893 """
3894 options1 = Options()
3895 options2 = Options()
3896
3897 options1.help = True
3898 options1.version = True
3899 options1.verbose = True
3900 options1.quiet = True
3901 options1.config = "config"
3902 options1.full = True
3903 options1.managed = True
3904 options1.managedOnly = True
3905 options1.logfile = "logfile"
3906 options1.owner = ("a", "b")
3907 options1.mode = "631"
3908 options1.output = True
3909 options1.debug = True
3910 options1.stacktrace = False
3911 options1.diagnostics = False
3912 options1.actions = [
3913 "collect",
3914 ]
3915
3916 options2.help = True
3917 options2.version = True
3918 options2.verbose = True
3919 options2.quiet = True
3920 options2.config = "config"
3921 options2.full = True
3922 options2.managed = True
3923 options2.managedOnly = True
3924 options2.logfile = "logfile"
3925 options2.owner = ("a", "b")
3926 options2.mode = 0o631
3927 options2.output = True
3928 options2.debug = False
3929 options1.stacktrace = False
3930 options2.diagnostics = False
3931 options2.actions = [
3932 "collect",
3933 ]
3934
3935 self.assertNotEqual(options1, options2)
3936 self.assertTrue(not options1 == options2)
3937 self.assertTrue(not options1 < options2)
3938 self.assertTrue(not options1 <= options2)
3939 self.assertTrue(options1 > options2)
3940 self.assertTrue(options1 >= options2)
3941 self.assertTrue(options1 != options2)
3942
3943 def testComparison_014(self):
3944 """
3945 Test comparison of two identical objects, all attributes filled in, stacktrace different.
3946 """
3947 options1 = Options()
3948 options2 = Options()
3949
3950 options1.help = True
3951 options1.version = True
3952 options1.verbose = True
3953 options1.quiet = True
3954 options1.config = "config"
3955 options1.full = True
3956 options1.managed = True
3957 options1.managedOnly = True
3958 options1.logfile = "logfile"
3959 options1.owner = ("a", "b")
3960 options1.mode = "631"
3961 options1.output = True
3962 options1.debug = True
3963 options1.stacktrace = False
3964 options1.diagnostics = False
3965 options1.actions = [
3966 "collect",
3967 ]
3968
3969 options2.help = True
3970 options2.version = True
3971 options2.verbose = True
3972 options2.quiet = True
3973 options2.config = "config"
3974 options2.full = True
3975 options2.managed = True
3976 options2.managedOnly = True
3977 options2.logfile = "logfile"
3978 options2.owner = ("a", "b")
3979 options2.mode = 0o631
3980 options2.output = True
3981 options2.debug = True
3982 options2.stacktrace = True
3983 options2.diagnostics = False
3984 options2.actions = [
3985 "collect",
3986 ]
3987
3988 self.assertNotEqual(options1, options2)
3989 self.assertTrue(not options1 == options2)
3990 self.assertTrue(options1 < options2)
3991 self.assertTrue(options1 <= options2)
3992 self.assertTrue(not options1 > options2)
3993 self.assertTrue(not options1 >= options2)
3994 self.assertTrue(options1 != options2)
3995
3996 def testComparison_015(self):
3997 """
3998 Test comparison of two identical objects, all attributes filled in, managed different.
3999 """
4000 options1 = Options()
4001 options2 = Options()
4002
4003 options1.help = True
4004 options1.version = True
4005 options1.verbose = True
4006 options1.quiet = True
4007 options1.config = "config"
4008 options1.full = True
4009 options1.managed = False
4010 options1.managedOnly = True
4011 options1.logfile = "logfile"
4012 options1.owner = ("a", "b")
4013 options1.mode = "631"
4014 options1.output = True
4015 options1.debug = True
4016 options1.stacktrace = False
4017 options1.diagnostics = False
4018 options1.actions = [
4019 "collect",
4020 ]
4021
4022 options2.help = True
4023 options2.version = True
4024 options2.verbose = True
4025 options2.quiet = True
4026 options2.config = "config"
4027 options2.full = True
4028 options2.managed = True
4029 options2.managedOnly = True
4030 options2.logfile = "logfile"
4031 options2.owner = ("a", "b")
4032 options2.mode = 0o631
4033 options2.output = True
4034 options2.debug = True
4035 options2.stacktrace = False
4036 options2.diagnostics = False
4037 options2.actions = [
4038 "collect",
4039 ]
4040
4041 self.assertNotEqual(options1, options2)
4042 self.assertTrue(not options1 == options2)
4043 self.assertTrue(options1 < options2)
4044 self.assertTrue(options1 <= options2)
4045 self.assertTrue(not options1 > options2)
4046 self.assertTrue(not options1 >= options2)
4047 self.assertTrue(options1 != options2)
4048
4049 def testComparison_016(self):
4050 """
4051 Test comparison of two identical objects, all attributes filled in, managedOnly different.
4052 """
4053 options1 = Options()
4054 options2 = Options()
4055
4056 options1.help = True
4057 options1.version = True
4058 options1.verbose = True
4059 options1.quiet = True
4060 options1.config = "config"
4061 options1.full = True
4062 options1.managed = True
4063 options1.managedOnly = False
4064 options1.logfile = "logfile"
4065 options1.owner = ("a", "b")
4066 options1.mode = "631"
4067 options1.output = True
4068 options1.debug = True
4069 options1.stacktrace = False
4070 options1.diagnostics = False
4071 options1.actions = [
4072 "collect",
4073 ]
4074
4075 options2.help = True
4076 options2.version = True
4077 options2.verbose = True
4078 options2.quiet = True
4079 options2.config = "config"
4080 options2.full = True
4081 options2.managed = True
4082 options2.managedOnly = True
4083 options2.logfile = "logfile"
4084 options2.owner = ("a", "b")
4085 options2.mode = 0o631
4086 options2.output = True
4087 options2.debug = True
4088 options2.stacktrace = False
4089 options2.diagnostics = False
4090 options2.actions = [
4091 "collect",
4092 ]
4093
4094 self.assertNotEqual(options1, options2)
4095 self.assertTrue(not options1 == options2)
4096 self.assertTrue(options1 < options2)
4097 self.assertTrue(options1 <= options2)
4098 self.assertTrue(not options1 > options2)
4099 self.assertTrue(not options1 >= options2)
4100 self.assertTrue(options1 != options2)
4101
4102 def testComparison_017(self):
4103 """
4104 Test comparison of two identical objects, all attributes filled in, diagnostics different.
4105 """
4106 options1 = Options()
4107 options2 = Options()
4108
4109 options1.help = True
4110 options1.version = True
4111 options1.verbose = True
4112 options1.quiet = True
4113 options1.config = "config"
4114 options1.full = True
4115 options1.managed = True
4116 options1.managedOnly = True
4117 options1.logfile = "logfile"
4118 options1.owner = ("a", "b")
4119 options1.mode = 0o631
4120 options1.output = True
4121 options1.debug = True
4122 options1.stacktrace = False
4123 options1.diagnostics = False
4124 options1.actions = [
4125 "collect",
4126 ]
4127
4128 options2.help = True
4129 options2.version = True
4130 options2.verbose = True
4131 options2.quiet = True
4132 options2.config = "config"
4133 options2.full = True
4134 options2.managed = True
4135 options2.managedOnly = True
4136 options2.logfile = "logfile"
4137 options2.owner = ("a", "b")
4138 options2.mode = 0o631
4139 options2.output = True
4140 options2.debug = True
4141 options2.stacktrace = False
4142 options2.diagnostics = True
4143 options2.actions = [
4144 "collect",
4145 ]
4146
4147 self.assertNotEqual(options1, options2)
4148 self.assertTrue(not options1 == options2)
4149 self.assertTrue(options1 < options2)
4150 self.assertTrue(options1 <= options2)
4151 self.assertTrue(not options1 > options2)
4152 self.assertTrue(not options1 >= options2)
4153 self.assertTrue(options1 != options2)
4154
4155 ###########################
4156 # Test buildArgumentList()
4157 ###########################
4158
4159 def testBuildArgumentList_001(self):
4160 """Test with no values set, validate=False."""
4161 options = Options()
4162 argumentList = options.buildArgumentList(validate=False)
4163 self.assertEqual([], argumentList)
4164
4165 def testBuildArgumentList_002(self):
4166 """Test with help set, validate=False."""
4167 options = Options()
4168 options.help = True
4169 argumentList = options.buildArgumentList(validate=False)
4170 self.assertEqual(["--help"], argumentList)
4171
4172 def testBuildArgumentList_003(self):
4173 """Test with version set, validate=False."""
4174 options = Options()
4175 options.version = True
4176 argumentList = options.buildArgumentList(validate=False)
4177 self.assertEqual(["--version"], argumentList)
4178
4179 def testBuildArgumentList_004(self):
4180 """Test with verbose set, validate=False."""
4181 options = Options()
4182 options.verbose = True
4183 argumentList = options.buildArgumentList(validate=False)
4184 self.assertEqual(["--verbose"], argumentList)
4185
4186 def testBuildArgumentList_005(self):
4187 """Test with quiet set, validate=False."""
4188 options = Options()
4189 options.quiet = True
4190 argumentList = options.buildArgumentList(validate=False)
4191 self.assertEqual(["--quiet"], argumentList)
4192
4193 def testBuildArgumentList_006(self):
4194 """Test with config set, validate=False."""
4195 options = Options()
4196 options.config = "stuff"
4197 argumentList = options.buildArgumentList(validate=False)
4198 self.assertEqual(["--config", "stuff"], argumentList)
4199
4200 def testBuildArgumentList_007(self):
4201 """Test with full set, validate=False."""
4202 options = Options()
4203 options.full = True
4204 argumentList = options.buildArgumentList(validate=False)
4205 self.assertEqual(["--full"], argumentList)
4206
4207 def testBuildArgumentList_008(self):
4208 """Test with logfile set, validate=False."""
4209 options = Options()
4210 options.logfile = "bogus"
4211 argumentList = options.buildArgumentList(validate=False)
4212 self.assertEqual(["--logfile", "bogus"], argumentList)
4213
4214 def testBuildArgumentList_009(self):
4215 """Test with owner set, validate=False."""
4216 options = Options()
4217 options.owner = ("ken", "group")
4218 argumentList = options.buildArgumentList(validate=False)
4219 self.assertEqual(["--owner", "ken:group"], argumentList)
4220
4221 def testBuildArgumentList_010(self):
4222 """Test with mode set, validate=False."""
4223 options = Options()
4224 options.mode = 0o644
4225 argumentList = options.buildArgumentList(validate=False)
4226 self.assertEqual(["--mode", "644"], argumentList)
4227
4228 def testBuildArgumentList_011(self):
4229 """Test with output set, validate=False."""
4230 options = Options()
4231 options.output = True
4232 argumentList = options.buildArgumentList(validate=False)
4233 self.assertEqual(["--output"], argumentList)
4234
4235 def testBuildArgumentList_012(self):
4236 """Test with debug set, validate=False."""
4237 options = Options()
4238 options.debug = True
4239 argumentList = options.buildArgumentList(validate=False)
4240 self.assertEqual(["--debug"], argumentList)
4241
4242 def testBuildArgumentList_013(self):
4243 """Test with stacktrace set, validate=False."""
4244 options = Options()
4245 options.stacktrace = True
4246 argumentList = options.buildArgumentList(validate=False)
4247 self.assertEqual(["--stack"], argumentList)
4248
4249 def testBuildArgumentList_014(self):
4250 """Test with actions containing one item, validate=False."""
4251 options = Options()
4252 options.actions = [
4253 "collect",
4254 ]
4255 argumentList = options.buildArgumentList(validate=False)
4256 self.assertEqual(["collect"], argumentList)
4257
4258 def testBuildArgumentList_015(self):
4259 """Test with actions containing multiple items, validate=False."""
4260 options = Options()
4261 options.actions = [
4262 "collect",
4263 "stage",
4264 "store",
4265 "purge",
4266 ]
4267 argumentList = options.buildArgumentList(validate=False)
4268 self.assertEqual(["collect", "stage", "store", "purge"], argumentList)
4269
4270 def testBuildArgumentList_016(self):
4271 """Test with all values set, actions containing one item, validate=False."""
4272 options = Options()
4273 options.help = True
4274 options.version = True
4275 options.verbose = True
4276 options.quiet = True
4277 options.config = "config"
4278 options.full = True
4279 options.managed = True
4280 options.managedOnly = True
4281 options.logfile = "logfile"
4282 options.owner = ("a", "b")
4283 options.mode = "631"
4284 options.output = True
4285 options.debug = True
4286 options.stacktrace = True
4287 options.diagnostics = True
4288 options.actions = [
4289 "collect",
4290 ]
4291 argumentList = options.buildArgumentList(validate=False)
4292 self.assertEqual(
4293 [
4294 "--help",
4295 "--version",
4296 "--verbose",
4297 "--quiet",
4298 "--config",
4299 "config",
4300 "--full",
4301 "--managed",
4302 "--managed-only",
4303 "--logfile",
4304 "logfile",
4305 "--owner",
4306 "a:b",
4307 "--mode",
4308 "631",
4309 "--output",
4310 "--debug",
4311 "--stack",
4312 "--diagnostics",
4313 "collect",
4314 ],
4315 argumentList,
4316 )
4317
4318 def testBuildArgumentList_017(self):
4319 """Test with all values set, actions containing multiple items, validate=False."""
4320 options = Options()
4321 options.help = True
4322 options.version = True
4323 options.verbose = True
4324 options.quiet = True
4325 options.config = "config"
4326 options.full = True
4327 options.managed = True
4328 options.managedOnly = True
4329 options.logfile = "logfile"
4330 options.owner = ("a", "b")
4331 options.mode = "631"
4332 options.output = True
4333 options.debug = True
4334 options.stacktrace = True
4335 options.diagnostics = True
4336 options.actions = [
4337 "collect",
4338 "stage",
4339 ]
4340 argumentList = options.buildArgumentList(validate=False)
4341 self.assertEqual(
4342 [
4343 "--help",
4344 "--version",
4345 "--verbose",
4346 "--quiet",
4347 "--config",
4348 "config",
4349 "--full",
4350 "--managed",
4351 "--managed-only",
4352 "--logfile",
4353 "logfile",
4354 "--owner",
4355 "a:b",
4356 "--mode",
4357 "631",
4358 "--output",
4359 "--debug",
4360 "--stack",
4361 "--diagnostics",
4362 "collect",
4363 "stage",
4364 ],
4365 argumentList,
4366 )
4367
4368 def testBuildArgumentList_018(self):
4369 """Test with no values set, validate=True."""
4370 options = Options()
4371 self.assertRaises(ValueError, options.buildArgumentList, validate=True)
4372
4373 def testBuildArgumentList_019(self):
4374 """Test with help set, validate=True."""
4375 options = Options()
4376 options.help = True
4377 argumentList = options.buildArgumentList(validate=True)
4378 self.assertEqual(["--help"], argumentList)
4379
4380 def testBuildArgumentList_020(self):
4381 """Test with version set, validate=True."""
4382 options = Options()
4383 options.version = True
4384 argumentList = options.buildArgumentList(validate=True)
4385 self.assertEqual(["--version"], argumentList)
4386
4387 def testBuildArgumentList_021(self):
4388 """Test with verbose set, validate=True."""
4389 options = Options()
4390 options.verbose = True
4391 self.assertRaises(ValueError, options.buildArgumentList, validate=True)
4392
4393 def testBuildArgumentList_022(self):
4394 """Test with quiet set, validate=True."""
4395 options = Options()
4396 options.quiet = True
4397 self.assertRaises(ValueError, options.buildArgumentList, validate=True)
4398
4399 def testBuildArgumentList_023(self):
4400 """Test with config set, validate=True."""
4401 options = Options()
4402 options.config = "stuff"
4403 self.assertRaises(ValueError, options.buildArgumentList, validate=True)
4404
4405 def testBuildArgumentList_024(self):
4406 """Test with full set, validate=True."""
4407 options = Options()
4408 options.full = True
4409 self.assertRaises(ValueError, options.buildArgumentList, validate=True)
4410
4411 def testBuildArgumentList_025(self):
4412 """Test with logfile set, validate=True."""
4413 options = Options()
4414 options.logfile = "bogus"
4415 self.assertRaises(ValueError, options.buildArgumentList, validate=True)
4416
4417 def testBuildArgumentList_026(self):
4418 """Test with owner set, validate=True."""
4419 options = Options()
4420 options.owner = ("ken", "group")
4421 self.assertRaises(ValueError, options.buildArgumentList, validate=True)
4422
4423 def testBuildArgumentList_027(self):
4424 """Test with mode set, validate=True."""
4425 options = Options()
4426 options.mode = 0o644
4427 self.assertRaises(ValueError, options.buildArgumentList, validate=True)
4428
4429 def testBuildArgumentList_028(self):
4430 """Test with output set, validate=True."""
4431 options = Options()
4432 options.output = True
4433 self.assertRaises(ValueError, options.buildArgumentList, validate=True)
4434
4435 def testBuildArgumentList_029(self):
4436 """Test with debug set, validate=True."""
4437 options = Options()
4438 options.debug = True
4439 self.assertRaises(ValueError, options.buildArgumentList, validate=True)
4440
4441 def testBuildArgumentList_030(self):
4442 """Test with stacktrace set, validate=True."""
4443 options = Options()
4444 options.stacktrace = True
4445 self.assertRaises(ValueError, options.buildArgumentList, validate=True)
4446
4447 def testBuildArgumentList_031(self):
4448 """Test with actions containing one item, validate=True."""
4449 options = Options()
4450 options.actions = [
4451 "collect",
4452 ]
4453 argumentList = options.buildArgumentList(validate=True)
4454 self.assertEqual(["collect"], argumentList)
4455
4456 def testBuildArgumentList_032(self):
4457 """Test with actions containing multiple items, validate=True."""
4458 options = Options()
4459 options.actions = [
4460 "collect",
4461 "stage",
4462 "store",
4463 "purge",
4464 ]
4465 argumentList = options.buildArgumentList(validate=True)
4466 self.assertEqual(["collect", "stage", "store", "purge"], argumentList)
4467
4468 def testBuildArgumentList_033(self):
4469 """Test with all values set (except managed ones), actions containing one item, validate=True."""
4470 options = Options()
4471 options.help = True
4472 options.version = True
4473 options.verbose = True
4474 options.quiet = True
4475 options.config = "config"
4476 options.full = True
4477 options.logfile = "logfile"
4478 options.owner = ("a", "b")
4479 options.mode = "631"
4480 options.output = True
4481 options.debug = True
4482 options.stacktrace = True
4483 options.diagnostics = True
4484 options.actions = [
4485 "collect",
4486 ]
4487 argumentList = options.buildArgumentList(validate=True)
4488 self.assertEqual(
4489 [
4490 "--help",
4491 "--version",
4492 "--verbose",
4493 "--quiet",
4494 "--config",
4495 "config",
4496 "--full",
4497 "--logfile",
4498 "logfile",
4499 "--owner",
4500 "a:b",
4501 "--mode",
4502 "631",
4503 "--output",
4504 "--debug",
4505 "--stack",
4506 "--diagnostics",
4507 "collect",
4508 ],
4509 argumentList,
4510 )
4511
4512 def testBuildArgumentList_034(self):
4513 """Test with all values set (except managed ones), actions containing multiple items, validate=True."""
4514 options = Options()
4515 options.help = True
4516 options.version = True
4517 options.verbose = True
4518 options.quiet = True
4519 options.config = "config"
4520 options.full = True
4521 options.logfile = "logfile"
4522 options.owner = ("a", "b")
4523 options.mode = "631"
4524 options.output = True
4525 options.debug = True
4526 options.stacktrace = True
4527 options.diagnostics = True
4528 options.actions = [
4529 "collect",
4530 "stage",
4531 ]
4532 argumentList = options.buildArgumentList(validate=True)
4533 self.assertEqual(
4534 [
4535 "--help",
4536 "--version",
4537 "--verbose",
4538 "--quiet",
4539 "--config",
4540 "config",
4541 "--full",
4542 "--logfile",
4543 "logfile",
4544 "--owner",
4545 "a:b",
4546 "--mode",
4547 "631",
4548 "--output",
4549 "--debug",
4550 "--stack",
4551 "--diagnostics",
4552 "collect",
4553 "stage",
4554 ],
4555 argumentList,
4556 )
4557
4558 def testBuildArgumentList_035(self):
4559 """Test with managed set, validate=False."""
4560 options = Options()
4561 options.managed = True
4562 argumentList = options.buildArgumentList(validate=False)
4563 self.assertEqual(["--managed"], argumentList)
4564
4565 def testBuildArgumentList_036(self):
4566 """Test with managed set, validate=True."""
4567 options = Options()
4568 options.managed = True
4569 self.assertRaises(ValueError, options.buildArgumentList, validate=True)
4570
4571 def testBuildArgumentList_037(self):
4572 """Test with managedOnly set, validate=False."""
4573 options = Options()
4574 options.managedOnly = True
4575 argumentList = options.buildArgumentList(validate=False)
4576 self.assertEqual(["--managed-only"], argumentList)
4577
4578 def testBuildArgumentList_038(self):
4579 """Test with managedOnly set, validate=True."""
4580 options = Options()
4581 options.managedOnly = True
4582 self.assertRaises(ValueError, options.buildArgumentList, validate=True)
4583
4584 def testBuildArgumentList_039(self):
4585 """Test with all values set, actions containing one item, validate=True."""
4586 options = Options()
4587 options.help = True
4588 options.version = True
4589 options.verbose = True
4590 options.quiet = True
4591 options.config = "config"
4592 options.full = True
4593 options.managed = True
4594 options.managedOnly = True
4595 options.logfile = "logfile"
4596 options.owner = ("a", "b")
4597 options.mode = "631"
4598 options.output = True
4599 options.debug = True
4600 options.stacktrace = True
4601 options.diagnostics = True
4602 options.actions = [
4603 "collect",
4604 ]
4605 self.assertRaises(ValueError, options.buildArgumentList, validate=True)
4606
4607 def testBuildArgumentList_040(self):
4608 """Test with all values set, actions containing multiple items, validate=True."""
4609 options = Options()
4610 options.help = True
4611 options.version = True
4612 options.verbose = True
4613 options.quiet = True
4614 options.config = "config"
4615 options.full = True
4616 options.managed = True
4617 options.managedOnly = True
4618 options.logfile = "logfile"
4619 options.owner = ("a", "b")
4620 options.mode = "631"
4621 options.output = True
4622 options.debug = True
4623 options.stacktrace = True
4624 options.diagnostics = True
4625 options.actions = [
4626 "collect",
4627 "stage",
4628 ]
4629 self.assertRaises(ValueError, options.buildArgumentList, validate=True)
4630
4631 def testBuildArgumentList_041(self):
4632 """Test with diagnostics set, validate=False."""
4633 options = Options()
4634 options.diagnostics = True
4635 argumentList = options.buildArgumentList(validate=False)
4636 self.assertEqual(["--diagnostics"], argumentList)
4637
4638 def testBuildArgumentList_042(self):
4639 """Test with diagnostics set, validate=True."""
4640 options = Options()
4641 options.diagnostics = True
4642 argumentList = options.buildArgumentList(validate=True)
4643 self.assertEqual(["--diagnostics"], argumentList)
4644
4645 #############################
4646 # Test buildArgumentString()
4647 #############################
4648
4649 def testBuildArgumentString_001(self):
4650 """Test with no values set, validate=False."""
4651 options = Options()
4652 argumentString = options.buildArgumentString(validate=False)
4653 self.assertEqual("", argumentString)
4654
4655 def testBuildArgumentString_002(self):
4656 """Test with help set, validate=False."""
4657 options = Options()
4658 options.help = True
4659 argumentString = options.buildArgumentString(validate=False)
4660 self.assertEqual("--help ", argumentString)
4661
4662 def testBuildArgumentString_003(self):
4663 """Test with version set, validate=False."""
4664 options = Options()
4665 options.version = True
4666 argumentString = options.buildArgumentString(validate=False)
4667 self.assertEqual("--version ", argumentString)
4668
4669 def testBuildArgumentString_004(self):
4670 """Test with verbose set, validate=False."""
4671 options = Options()
4672 options.verbose = True
4673 argumentString = options.buildArgumentString(validate=False)
4674 self.assertEqual("--verbose ", argumentString)
4675
4676 def testBuildArgumentString_005(self):
4677 """Test with quiet set, validate=False."""
4678 options = Options()
4679 options.quiet = True
4680 argumentString = options.buildArgumentString(validate=False)
4681 self.assertEqual("--quiet ", argumentString)
4682
4683 def testBuildArgumentString_006(self):
4684 """Test with config set, validate=False."""
4685 options = Options()
4686 options.config = "stuff"
4687 argumentString = options.buildArgumentString(validate=False)
4688 self.assertEqual('--config "stuff" ', argumentString)
4689
4690 def testBuildArgumentString_007(self):
4691 """Test with full set, validate=False."""
4692 options = Options()
4693 options.full = True
4694 argumentString = options.buildArgumentString(validate=False)
4695 self.assertEqual("--full ", argumentString)
4696
4697 def testBuildArgumentString_008(self):
4698 """Test with logfile set, validate=False."""
4699 options = Options()
4700 options.logfile = "bogus"
4701 argumentString = options.buildArgumentString(validate=False)
4702 self.assertEqual('--logfile "bogus" ', argumentString)
4703
4704 def testBuildArgumentString_009(self):
4705 """Test with owner set, validate=False."""
4706 options = Options()
4707 options.owner = ("ken", "group")
4708 argumentString = options.buildArgumentString(validate=False)
4709 self.assertEqual('--owner "ken:group" ', argumentString)
4710
4711 def testBuildArgumentString_010(self):
4712 """Test with mode set, validate=False."""
4713 options = Options()
4714 options.mode = 0o644
4715 argumentString = options.buildArgumentString(validate=False)
4716 self.assertEqual("--mode 644 ", argumentString)
4717
4718 def testBuildArgumentString_011(self):
4719 """Test with output set, validate=False."""
4720 options = Options()
4721 options.output = True
4722 argumentString = options.buildArgumentString(validate=False)
4723 self.assertEqual("--output ", argumentString)
4724
4725 def testBuildArgumentString_012(self):
4726 """Test with debug set, validate=False."""
4727 options = Options()
4728 options.debug = True
4729 argumentString = options.buildArgumentString(validate=False)
4730 self.assertEqual("--debug ", argumentString)
4731
4732 def testBuildArgumentString_013(self):
4733 """Test with stacktrace set, validate=False."""
4734 options = Options()
4735 options.stacktrace = True
4736 argumentString = options.buildArgumentString(validate=False)
4737 self.assertEqual("--stack ", argumentString)
4738
4739 def testBuildArgumentString_014(self):
4740 """Test with actions containing one item, validate=False."""
4741 options = Options()
4742 options.actions = [
4743 "collect",
4744 ]
4745 argumentString = options.buildArgumentString(validate=False)
4746 self.assertEqual('"collect" ', argumentString)
4747
4748 def testBuildArgumentString_015(self):
4749 """Test with actions containing multiple items, validate=False."""
4750 options = Options()
4751 options.actions = [
4752 "collect",
4753 "stage",
4754 "store",
4755 "purge",
4756 ]
4757 argumentString = options.buildArgumentString(validate=False)
4758 self.assertEqual('"collect" "stage" "store" "purge" ', argumentString)
4759
4760 def testBuildArgumentString_016(self):
4761 """Test with all values set, actions containing one item, validate=False."""
4762 options = Options()
4763 options.help = True
4764 options.version = True
4765 options.verbose = True
4766 options.quiet = True
4767 options.config = "config"
4768 options.full = True
4769 options.managed = True
4770 options.managedOnly = True
4771 options.logfile = "logfile"
4772 options.owner = ("a", "b")
4773 options.mode = "631"
4774 options.output = True
4775 options.debug = True
4776 options.stacktrace = True
4777 options.diagnostics = True
4778 options.actions = [
4779 "collect",
4780 ]
4781 argumentString = options.buildArgumentString(validate=False)
4782 self.assertEqual(
4783 '--help --version --verbose --quiet --config "config" --full --managed --managed-only --logfile "logfile" --owner "a:b" --mode 631 --output --debug --stack --diagnostics "collect" ',
4784 argumentString,
4785 )
4786
4787 def testBuildArgumentString_017(self):
4788 """Test with all values set, actions containing multiple items, validate=False."""
4789 options = Options()
4790 options.help = True
4791 options.version = True
4792 options.verbose = True
4793 options.quiet = True
4794 options.config = "config"
4795 options.full = True
4796 options.logfile = "logfile"
4797 options.owner = ("a", "b")
4798 options.mode = "631"
4799 options.output = True
4800 options.debug = True
4801 options.stacktrace = True
4802 options.diagnostics = True
4803 options.actions = [
4804 "collect",
4805 "stage",
4806 ]
4807 argumentString = options.buildArgumentString(validate=False)
4808 self.assertEqual(
4809 '--help --version --verbose --quiet --config "config" --full --logfile "logfile" --owner "a:b" --mode 631 --output --debug --stack --diagnostics "collect" "stage" ',
4810 argumentString,
4811 )
4812
4813 def testBuildArgumentString_018(self):
4814 """Test with no values set, validate=True."""
4815 options = Options()
4816 self.assertRaises(ValueError, options.buildArgumentString, validate=True)
4817
4818 def testBuildArgumentString_019(self):
4819 """Test with help set, validate=True."""
4820 options = Options()
4821 options.help = True
4822 argumentString = options.buildArgumentString(validate=True)
4823 self.assertEqual("--help ", argumentString)
4824
4825 def testBuildArgumentString_020(self):
4826 """Test with version set, validate=True."""
4827 options = Options()
4828 options.version = True
4829 argumentString = options.buildArgumentString(validate=True)
4830 self.assertEqual("--version ", argumentString)
4831
4832 def testBuildArgumentString_021(self):
4833 """Test with verbose set, validate=True."""
4834 options = Options()
4835 options.verbose = True
4836 self.assertRaises(ValueError, options.buildArgumentString, validate=True)
4837
4838 def testBuildArgumentString_022(self):
4839 """Test with quiet set, validate=True."""
4840 options = Options()
4841 options.quiet = True
4842 self.assertRaises(ValueError, options.buildArgumentString, validate=True)
4843
4844 def testBuildArgumentString_023(self):
4845 """Test with config set, validate=True."""
4846 options = Options()
4847 options.config = "stuff"
4848 self.assertRaises(ValueError, options.buildArgumentString, validate=True)
4849
4850 def testBuildArgumentString_024(self):
4851 """Test with full set, validate=True."""
4852 options = Options()
4853 options.full = True
4854 self.assertRaises(ValueError, options.buildArgumentString, validate=True)
4855
4856 def testBuildArgumentString_025(self):
4857 """Test with logfile set, validate=True."""
4858 options = Options()
4859 options.logfile = "bogus"
4860 self.assertRaises(ValueError, options.buildArgumentString, validate=True)
4861
4862 def testBuildArgumentString_026(self):
4863 """Test with owner set, validate=True."""
4864 options = Options()
4865 options.owner = ("ken", "group")
4866 self.assertRaises(ValueError, options.buildArgumentString, validate=True)
4867
4868 def testBuildArgumentString_027(self):
4869 """Test with mode set, validate=True."""
4870 options = Options()
4871 options.mode = 0o644
4872 self.assertRaises(ValueError, options.buildArgumentString, validate=True)
4873
4874 def testBuildArgumentString_028(self):
4875 """Test with output set, validate=True."""
4876 options = Options()
4877 options.output = True
4878 self.assertRaises(ValueError, options.buildArgumentString, validate=True)
4879
4880 def testBuildArgumentString_029(self):
4881 """Test with debug set, validate=True."""
4882 options = Options()
4883 options.debug = True
4884 self.assertRaises(ValueError, options.buildArgumentString, validate=True)
4885
4886 def testBuildArgumentString_030(self):
4887 """Test with stacktrace set, validate=True."""
4888 options = Options()
4889 options.stacktrace = True
4890 self.assertRaises(ValueError, options.buildArgumentString, validate=True)
4891
4892 def testBuildArgumentString_031(self):
4893 """Test with actions containing one item, validate=True."""
4894 options = Options()
4895 options.actions = [
4896 "collect",
4897 ]
4898 argumentString = options.buildArgumentString(validate=True)
4899 self.assertEqual('"collect" ', argumentString)
4900
4901 def testBuildArgumentString_032(self):
4902 """Test with actions containing multiple items, validate=True."""
4903 options = Options()
4904 options.actions = [
4905 "collect",
4906 "stage",
4907 "store",
4908 "purge",
4909 ]
4910 argumentString = options.buildArgumentString(validate=True)
4911 self.assertEqual('"collect" "stage" "store" "purge" ', argumentString)
4912
4913 def testBuildArgumentString_033(self):
4914 """Test with all values set (except managed ones), actions containing one item, validate=True."""
4915 options = Options()
4916 options.help = True
4917 options.version = True
4918 options.verbose = True
4919 options.quiet = True
4920 options.config = "config"
4921 options.full = True
4922 options.logfile = "logfile"
4923 options.owner = ("a", "b")
4924 options.mode = "631"
4925 options.output = True
4926 options.debug = True
4927 options.stacktrace = True
4928 options.diagnostics = True
4929 options.actions = [
4930 "collect",
4931 ]
4932 argumentString = options.buildArgumentString(validate=True)
4933 self.assertEqual(
4934 '--help --version --verbose --quiet --config "config" --full --logfile "logfile" --owner "a:b" --mode 631 --output --debug --stack --diagnostics "collect" ',
4935 argumentString,
4936 )
4937
4938 def testBuildArgumentString_034(self):
4939 """Test with all values set (except managed ones), actions containing multiple items, validate=True."""
4940 options = Options()
4941 options.help = True
4942 options.version = True
4943 options.verbose = True
4944 options.quiet = True
4945 options.config = "config"
4946 options.full = True
4947 options.logfile = "logfile"
4948 options.owner = ("a", "b")
4949 options.mode = "631"
4950 options.output = True
4951 options.debug = True
4952 options.stacktrace = True
4953 options.diagnostics = True
4954 options.actions = [
4955 "collect",
4956 "stage",
4957 ]
4958 argumentString = options.buildArgumentString(validate=True)
4959 self.assertEqual(
4960 '--help --version --verbose --quiet --config "config" --full --logfile "logfile" --owner "a:b" --mode 631 --output --debug --stack --diagnostics "collect" "stage" ',
4961 argumentString,
4962 )
4963
4964 def testBuildArgumentString_035(self):
4965 """Test with managed set, validate=False."""
4966 options = Options()
4967 options.managed = True
4968 argumentString = options.buildArgumentString(validate=False)
4969 self.assertEqual("--managed ", argumentString)
4970
4971 def testBuildArgumentString_036(self):
4972 """Test with managed set, validate=True."""
4973 options = Options()
4974 options.managed = True
4975 self.assertRaises(ValueError, options.buildArgumentString, validate=True)
4976
4977 def testBuildArgumentString_037(self):
4978 """Test with full set, validate=False."""
4979 options = Options()
4980 options.managedOnly = True
4981 argumentString = options.buildArgumentString(validate=False)
4982 self.assertEqual("--managed-only ", argumentString)
4983
4984 def testBuildArgumentString_038(self):
4985 """Test with managedOnly set, validate=True."""
4986 options = Options()
4987 options.managedOnly = True
4988 self.assertRaises(ValueError, options.buildArgumentString, validate=True)
4989
4990 def testBuildArgumentString_039(self):
4991 """Test with all values set (except managed ones), actions containing one item, validate=True."""
4992 options = Options()
4993 options.help = True
4994 options.version = True
4995 options.verbose = True
4996 options.quiet = True
4997 options.config = "config"
4998 options.full = True
4999 options.managed = True
5000 options.managedOnly = True
5001 options.logfile = "logfile"
5002 options.owner = ("a", "b")
5003 options.mode = "631"
5004 options.output = True
5005 options.debug = True
5006 options.stacktrace = True
5007 options.diagnostics = True
5008 options.actions = [
5009 "collect",
5010 ]
5011 self.assertRaises(ValueError, options.buildArgumentString, validate=True)
5012
5013 def testBuildArgumentString_040(self):
5014 """Test with all values set (except managed ones), actions containing multiple items, validate=True."""
5015 options = Options()
5016 options.help = True
5017 options.version = True
5018 options.verbose = True
5019 options.quiet = True
5020 options.config = "config"
5021 options.full = True
5022 options.managed = True
5023 options.managedOnly = True
5024 options.logfile = "logfile"
5025 options.owner = ("a", "b")
5026 options.mode = "631"
5027 options.output = True
5028 options.debug = True
5029 options.stacktrace = True
5030 options.diagnostics = True
5031 options.actions = [
5032 "collect",
5033 "stage",
5034 ]
5035 self.assertRaises(ValueError, options.buildArgumentString, validate=True)
5036
5037 def testBuildArgumentString_041(self):
5038 """Test with diagnostics set, validate=False."""
5039 options = Options()
5040 options.diagnostics = True
5041 argumentString = options.buildArgumentString(validate=False)
5042 self.assertEqual("--diagnostics ", argumentString)
5043
5044 def testBuildArgumentString_042(self):
5045 """Test with diagnostics set, validate=True."""
5046 options = Options()
5047 options.diagnostics = True
5048 argumentString = options.buildArgumentString(validate=True)
5049 self.assertEqual("--diagnostics ", argumentString)
5050
5051
5052 ######################
5053 # TestActionSet class
5054 ######################
5055
5056
5057 class TestActionSet(unittest.TestCase):
5058 """Tests for the _ActionSet class."""
5059
5060 ################
5061 # Setup methods
5062 ################
5063
5064 @classmethod
5065 def setUpClass(cls):
5066 configureLogging()
5067
5068 def setUp(self):
5069 pass
5070
5071 def tearDown(self):
5072 pass
5073
5074 #######################################
5075 # Test constructor, "index" order mode
5076 #######################################
5077
5078 def testActionSet_001(self):
5079 """
5080 Test with actions=None, extensions=None.
5081 """
5082 actions = None
5083 extensions = ExtensionsConfig(None, None)
5084 options = OptionsConfig()
5085 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
5086
5087 def testActionSet_002(self):
5088 """
5089 Test with actions=[], extensions=None.
5090 """
5091 actions = []
5092 extensions = ExtensionsConfig(None, None)
5093 options = OptionsConfig()
5094 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
5095
5096 def testActionSet_003(self):
5097 """
5098 Test with actions=[], extensions=[].
5099 """
5100 actions = []
5101 extensions = ExtensionsConfig([], None)
5102 options = OptionsConfig()
5103 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
5104
5105 def testActionSet_004(self):
5106 """
5107 Test with actions=[ collect ], extensions=[].
5108 """
5109 actions = [
5110 "collect",
5111 ]
5112 extensions = ExtensionsConfig([], None)
5113 options = OptionsConfig()
5114 actionSet = _ActionSet(actions, extensions, options, None, False, True)
5115 self.assertFalse(actionSet.actionSet is None)
5116 self.assertTrue(len(actionSet.actionSet) == 1)
5117 self.assertEqual(100, actionSet.actionSet[0].index)
5118 self.assertEqual("collect", actionSet.actionSet[0].name)
5119 self.assertEqual(None, actionSet.actionSet[0].preHooks)
5120 self.assertEqual(None, actionSet.actionSet[0].postHooks)
5121 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
5122
5123 def testActionSet_005(self):
5124 """
5125 Test with actions=[ stage ], extensions=[].
5126 """
5127 actions = [
5128 "stage",
5129 ]
5130 extensions = ExtensionsConfig([], None)
5131 options = OptionsConfig()
5132 actionSet = _ActionSet(actions, extensions, options, None, False, True)
5133 self.assertFalse(actionSet.actionSet is None)
5134 self.assertTrue(len(actionSet.actionSet) == 1)
5135 self.assertEqual(200, actionSet.actionSet[0].index)
5136 self.assertEqual("stage", actionSet.actionSet[0].name)
5137 self.assertEqual(None, actionSet.actionSet[0].preHooks)
5138 self.assertEqual(None, actionSet.actionSet[0].postHooks)
5139 self.assertEqual(executeStage, actionSet.actionSet[0].function)
5140
5141 def testActionSet_006(self):
5142 """
5143 Test with actions=[ store ], extensions=[].
5144 """
5145 actions = [
5146 "store",
5147 ]
5148 extensions = ExtensionsConfig([], None)
5149 options = OptionsConfig()
5150 actionSet = _ActionSet(actions, extensions, options, None, False, True)
5151 self.assertFalse(actionSet.actionSet is None)
5152 self.assertTrue(len(actionSet.actionSet) == 1)
5153 self.assertEqual(300, actionSet.actionSet[0].index)
5154 self.assertEqual("store", actionSet.actionSet[0].name)
5155 self.assertEqual(None, actionSet.actionSet[0].preHooks)
5156 self.assertEqual(None, actionSet.actionSet[0].postHooks)
5157 self.assertEqual(executeStore, actionSet.actionSet[0].function)
5158
5159 def testActionSet_007(self):
5160 """
5161 Test with actions=[ purge ], extensions=[].
5162 """
5163 actions = [
5164 "purge",
5165 ]
5166 extensions = ExtensionsConfig([], None)
5167 options = OptionsConfig()
5168 actionSet = _ActionSet(actions, extensions, options, None, False, True)
5169 self.assertFalse(actionSet.actionSet is None)
5170 self.assertTrue(len(actionSet.actionSet) == 1)
5171 self.assertEqual(400, actionSet.actionSet[0].index)
5172 self.assertEqual("purge", actionSet.actionSet[0].name)
5173 self.assertEqual(None, actionSet.actionSet[0].preHooks)
5174 self.assertEqual(None, actionSet.actionSet[0].postHooks)
5175 self.assertEqual(executePurge, actionSet.actionSet[0].function)
5176
5177 def testActionSet_008(self):
5178 """
5179 Test with actions=[ all ], extensions=[].
5180 """
5181 actions = [
5182 "all",
5183 ]
5184 extensions = ExtensionsConfig([], None)
5185 options = OptionsConfig()
5186 actionSet = _ActionSet(actions, extensions, options, None, False, True)
5187 self.assertFalse(actionSet.actionSet is None)
5188 self.assertTrue(len(actionSet.actionSet) == 4)
5189 self.assertEqual(100, actionSet.actionSet[0].index)
5190 self.assertEqual("collect", actionSet.actionSet[0].name)
5191 self.assertEqual(None, actionSet.actionSet[0].preHooks)
5192 self.assertEqual(None, actionSet.actionSet[0].postHooks)
5193 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
5194 self.assertEqual(200, actionSet.actionSet[1].index)
5195 self.assertEqual("stage", actionSet.actionSet[1].name)
5196 self.assertEqual(None, actionSet.actionSet[1].preHooks)
5197 self.assertEqual(None, actionSet.actionSet[1].postHooks)
5198 self.assertEqual(executeStage, actionSet.actionSet[1].function)
5199 self.assertEqual(300, actionSet.actionSet[2].index)
5200 self.assertEqual("store", actionSet.actionSet[2].name)
5201 self.assertEqual(None, actionSet.actionSet[2].preHooks)
5202 self.assertEqual(None, actionSet.actionSet[2].postHooks)
5203 self.assertEqual(executeStore, actionSet.actionSet[2].function)
5204 self.assertEqual(400, actionSet.actionSet[3].index)
5205 self.assertEqual("purge", actionSet.actionSet[3].name)
5206 self.assertEqual(None, actionSet.actionSet[3].preHooks)
5207 self.assertEqual(None, actionSet.actionSet[3].postHooks)
5208 self.assertEqual(executePurge, actionSet.actionSet[3].function)
5209
5210 def testActionSet_009(self):
5211 """
5212 Test with actions=[ rebuild ], extensions=[].
5213 """
5214 actions = [
5215 "rebuild",
5216 ]
5217 extensions = ExtensionsConfig([], None)
5218 options = OptionsConfig()
5219 actionSet = _ActionSet(actions, extensions, options, None, False, True)
5220 self.assertTrue(len(actionSet.actionSet) == 1)
5221 self.assertEqual(0, actionSet.actionSet[0].index)
5222 self.assertEqual("rebuild", actionSet.actionSet[0].name)
5223 self.assertEqual(None, actionSet.actionSet[0].preHooks)
5224 self.assertEqual(None, actionSet.actionSet[0].postHooks)
5225 self.assertEqual(executeRebuild, actionSet.actionSet[0].function)
5226
5227 def testActionSet_010(self):
5228 """
5229 Test with actions=[ validate ], extensions=[].
5230 """
5231 actions = [
5232 "validate",
5233 ]
5234 extensions = ExtensionsConfig([], None)
5235 options = OptionsConfig()
5236 actionSet = _ActionSet(actions, extensions, options, None, False, True)
5237 self.assertTrue(len(actionSet.actionSet) == 1)
5238 self.assertEqual(0, actionSet.actionSet[0].index)
5239 self.assertEqual("validate", actionSet.actionSet[0].name)
5240 self.assertEqual(None, actionSet.actionSet[0].preHooks)
5241 self.assertEqual(None, actionSet.actionSet[0].postHooks)
5242 self.assertEqual(executeValidate, actionSet.actionSet[0].function)
5243
5244 def testActionSet_011(self):
5245 """
5246 Test with actions=[ collect, collect ], extensions=[].
5247 """
5248 actions = [
5249 "collect",
5250 "collect",
5251 ]
5252 extensions = ExtensionsConfig([], None)
5253 options = OptionsConfig()
5254 actionSet = _ActionSet(actions, extensions, options, None, False, True)
5255 self.assertTrue(len(actionSet.actionSet) == 2)
5256 self.assertEqual(100, actionSet.actionSet[0].index)
5257 self.assertEqual("collect", actionSet.actionSet[0].name)
5258 self.assertEqual(None, actionSet.actionSet[0].preHooks)
5259 self.assertEqual(None, actionSet.actionSet[0].postHooks)
5260 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
5261 self.assertEqual(100, actionSet.actionSet[1].index)
5262 self.assertEqual("collect", actionSet.actionSet[0].name)
5263 self.assertEqual(None, actionSet.actionSet[0].preHooks)
5264 self.assertEqual(None, actionSet.actionSet[0].postHooks)
5265 self.assertEqual(executeCollect, actionSet.actionSet[1].function)
5266
5267 def testActionSet_012(self):
5268 """
5269 Test with actions=[ collect, stage ], extensions=[].
5270 """
5271 actions = [
5272 "collect",
5273 "stage",
5274 ]
5275 extensions = ExtensionsConfig([], None)
5276 options = OptionsConfig()
5277 actionSet = _ActionSet(actions, extensions, options, None, False, True)
5278 self.assertTrue(len(actionSet.actionSet) == 2)
5279 self.assertEqual(100, actionSet.actionSet[0].index)
5280 self.assertEqual("collect", actionSet.actionSet[0].name)
5281 self.assertEqual(None, actionSet.actionSet[0].preHooks)
5282 self.assertEqual(None, actionSet.actionSet[0].postHooks)
5283 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
5284 self.assertEqual(200, actionSet.actionSet[1].index)
5285 self.assertEqual("stage", actionSet.actionSet[1].name)
5286 self.assertEqual(None, actionSet.actionSet[1].preHooks)
5287 self.assertEqual(None, actionSet.actionSet[1].postHooks)
5288 self.assertEqual(executeStage, actionSet.actionSet[1].function)
5289
5290 def testActionSet_013(self):
5291 """
5292 Test with actions=[ collect, store ], extensions=[].
5293 """
5294 actions = [
5295 "collect",
5296 "store",
5297 ]
5298 extensions = ExtensionsConfig([], None)
5299 options = OptionsConfig()
5300 actionSet = _ActionSet(actions, extensions, options, None, False, True)
5301 self.assertTrue(len(actionSet.actionSet) == 2)
5302 self.assertEqual(100, actionSet.actionSet[0].index)
5303 self.assertEqual("collect", actionSet.actionSet[0].name)
5304 self.assertEqual(None, actionSet.actionSet[0].preHooks)
5305 self.assertEqual(None, actionSet.actionSet[0].postHooks)
5306 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
5307 self.assertEqual(300, actionSet.actionSet[1].index)
5308 self.assertEqual("store", actionSet.actionSet[1].name)
5309 self.assertEqual(None, actionSet.actionSet[1].preHooks)
5310 self.assertEqual(None, actionSet.actionSet[1].postHooks)
5311 self.assertEqual(executeStore, actionSet.actionSet[1].function)
5312
5313 def testActionSet_014(self):
5314 """
5315 Test with actions=[ collect, purge ], extensions=[].
5316 """
5317 actions = [
5318 "collect",
5319 "purge",
5320 ]
5321 extensions = ExtensionsConfig([], None)
5322 options = OptionsConfig()
5323 actionSet = _ActionSet(actions, extensions, options, None, False, True)
5324 self.assertTrue(len(actionSet.actionSet) == 2)
5325 self.assertEqual(100, actionSet.actionSet[0].index)
5326 self.assertEqual("collect", actionSet.actionSet[0].name)
5327 self.assertEqual(None, actionSet.actionSet[0].preHooks)
5328 self.assertEqual(None, actionSet.actionSet[0].postHooks)
5329 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
5330 self.assertEqual(400, actionSet.actionSet[1].index)
5331 self.assertEqual("purge", actionSet.actionSet[1].name)
5332 self.assertEqual(None, actionSet.actionSet[1].preHooks)
5333 self.assertEqual(None, actionSet.actionSet[1].postHooks)
5334 self.assertEqual(executePurge, actionSet.actionSet[1].function)
5335
5336 def testActionSet_015(self):
5337 """
5338 Test with actions=[ collect, all ], extensions=[].
5339 """
5340 actions = [
5341 "collect",
5342 "all",
5343 ]
5344 extensions = ExtensionsConfig([], None)
5345 options = OptionsConfig()
5346 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
5347
5348 def testActionSet_016(self):
5349 """
5350 Test with actions=[ collect, rebuild ], extensions=[].
5351 """
5352 actions = [
5353 "collect",
5354 "rebuild",
5355 ]
5356 extensions = ExtensionsConfig([], None)
5357 options = OptionsConfig()
5358 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
5359
5360 def testActionSet_017(self):
5361 """
5362 Test with actions=[ collect, validate ], extensions=[].
5363 """
5364 actions = [
5365 "collect",
5366 "validate",
5367 ]
5368 extensions = ExtensionsConfig([], None)
5369 options = OptionsConfig()
5370 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
5371
5372 def testActionSet_018(self):
5373 """
5374 Test with actions=[ stage, collect ], extensions=[].
5375 """
5376 actions = [
5377 "stage",
5378 "collect",
5379 ]
5380 extensions = ExtensionsConfig([], None)
5381 options = OptionsConfig()
5382 actionSet = _ActionSet(actions, extensions, options, None, False, True)
5383 self.assertTrue(len(actionSet.actionSet) == 2)
5384 self.assertEqual(100, actionSet.actionSet[0].index)
5385 self.assertEqual("collect", actionSet.actionSet[0].name)
5386 self.assertEqual(None, actionSet.actionSet[0].preHooks)
5387 self.assertEqual(None, actionSet.actionSet[0].postHooks)
5388 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
5389 self.assertEqual(200, actionSet.actionSet[1].index)
5390 self.assertEqual("stage", actionSet.actionSet[1].name)
5391 self.assertEqual(None, actionSet.actionSet[1].preHooks)
5392 self.assertEqual(None, actionSet.actionSet[1].postHooks)
5393 self.assertEqual(executeStage, actionSet.actionSet[1].function)
5394
5395 def testActionSet_019(self):
5396 """
5397 Test with actions=[ stage, stage ], extensions=[].
5398 """
5399 actions = [
5400 "stage",
5401 "stage",
5402 ]
5403 extensions = ExtensionsConfig([], None)
5404 options = OptionsConfig()
5405 actionSet = _ActionSet(actions, extensions, options, None, False, True)
5406 self.assertTrue(len(actionSet.actionSet) == 2)
5407 self.assertEqual(200, actionSet.actionSet[0].index)
5408 self.assertEqual("stage", actionSet.actionSet[0].name)
5409 self.assertEqual(None, actionSet.actionSet[0].preHooks)
5410 self.assertEqual(None, actionSet.actionSet[0].postHooks)
5411 self.assertEqual(executeStage, actionSet.actionSet[0].function)
5412 self.assertEqual(200, actionSet.actionSet[1].index)
5413 self.assertEqual("stage", actionSet.actionSet[1].name)
5414 self.assertEqual(None, actionSet.actionSet[1].preHooks)
5415 self.assertEqual(None, actionSet.actionSet[1].postHooks)
5416 self.assertEqual(executeStage, actionSet.actionSet[1].function)
5417
5418 def testActionSet_020(self):
5419 """
5420 Test with actions=[ stage, store ], extensions=[].
5421 """
5422 actions = [
5423 "stage",
5424 "store",
5425 ]
5426 extensions = ExtensionsConfig([], None)
5427 options = OptionsConfig()
5428 actionSet = _ActionSet(actions, extensions, options, None, False, True)
5429 self.assertTrue(len(actionSet.actionSet) == 2)
5430 self.assertEqual(200, actionSet.actionSet[0].index)
5431 self.assertEqual("stage", actionSet.actionSet[0].name)
5432 self.assertEqual(None, actionSet.actionSet[0].preHooks)
5433 self.assertEqual(None, actionSet.actionSet[0].postHooks)
5434 self.assertEqual(executeStage, actionSet.actionSet[0].function)
5435 self.assertEqual(300, actionSet.actionSet[1].index)
5436 self.assertEqual("store", actionSet.actionSet[1].name)
5437 self.assertEqual(None, actionSet.actionSet[1].preHooks)
5438 self.assertEqual(None, actionSet.actionSet[1].postHooks)
5439 self.assertEqual(executeStore, actionSet.actionSet[1].function)
5440
5441 def testActionSet_021(self):
5442 """
5443 Test with actions=[ stage, purge ], extensions=[].
5444 """
5445 actions = [
5446 "stage",
5447 "purge",
5448 ]
5449 extensions = ExtensionsConfig([], None)
5450 options = OptionsConfig()
5451 actionSet = _ActionSet(actions, extensions, options, None, False, True)
5452 self.assertTrue(len(actionSet.actionSet) == 2)
5453 self.assertEqual(200, actionSet.actionSet[0].index)
5454 self.assertEqual("stage", actionSet.actionSet[0].name)
5455 self.assertEqual(None, actionSet.actionSet[0].preHooks)
5456 self.assertEqual(None, actionSet.actionSet[0].postHooks)
5457 self.assertEqual(executeStage, actionSet.actionSet[0].function)
5458 self.assertEqual(400, actionSet.actionSet[1].index)
5459 self.assertEqual("purge", actionSet.actionSet[1].name)
5460 self.assertEqual(None, actionSet.actionSet[1].preHooks)
5461 self.assertEqual(None, actionSet.actionSet[1].postHooks)
5462 self.assertEqual(executePurge, actionSet.actionSet[1].function)
5463
5464 def testActionSet_022(self):
5465 """
5466 Test with actions=[ stage, all ], extensions=[].
5467 """
5468 actions = [
5469 "stage",
5470 "all",
5471 ]
5472 extensions = ExtensionsConfig([], None)
5473 options = OptionsConfig()
5474 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
5475
5476 def testActionSet_023(self):
5477 """
5478 Test with actions=[ stage, rebuild ], extensions=[].
5479 """
5480 actions = [
5481 "stage",
5482 "rebuild",
5483 ]
5484 extensions = ExtensionsConfig([], None)
5485 options = OptionsConfig()
5486 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
5487
5488 def testActionSet_024(self):
5489 """
5490 Test with actions=[ stage, validate ], extensions=[].
5491 """
5492 actions = [
5493 "stage",
5494 "validate",
5495 ]
5496 extensions = ExtensionsConfig([], None)
5497 options = OptionsConfig()
5498 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
5499
5500 def testActionSet_025(self):
5501 """
5502 Test with actions=[ store, collect ], extensions=[].
5503 """
5504 actions = [
5505 "store",
5506 "collect",
5507 ]
5508 extensions = ExtensionsConfig([], None)
5509 options = OptionsConfig()
5510 actionSet = _ActionSet(actions, extensions, options, None, False, True)
5511 self.assertTrue(len(actionSet.actionSet) == 2)
5512 self.assertEqual(100, actionSet.actionSet[0].index)
5513 self.assertEqual("collect", actionSet.actionSet[0].name)
5514 self.assertEqual(None, actionSet.actionSet[0].preHooks)
5515 self.assertEqual(None, actionSet.actionSet[0].postHooks)
5516 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
5517 self.assertEqual(300, actionSet.actionSet[1].index)
5518 self.assertEqual("store", actionSet.actionSet[1].name)
5519 self.assertEqual(None, actionSet.actionSet[1].preHooks)
5520 self.assertEqual(None, actionSet.actionSet[1].postHooks)
5521 self.assertEqual(executeStore, actionSet.actionSet[1].function)
5522
5523 def testActionSet_026(self):
5524 """
5525 Test with actions=[ store, stage ], extensions=[].
5526 """
5527 actions = [
5528 "store",
5529 "stage",
5530 ]
5531 extensions = ExtensionsConfig([], None)
5532 options = OptionsConfig()
5533 actionSet = _ActionSet(actions, extensions, options, None, False, True)
5534 self.assertTrue(len(actionSet.actionSet) == 2)
5535 self.assertEqual(200, actionSet.actionSet[0].index)
5536 self.assertEqual("stage", actionSet.actionSet[0].name)
5537 self.assertEqual(None, actionSet.actionSet[0].preHooks)
5538 self.assertEqual(None, actionSet.actionSet[0].postHooks)
5539 self.assertEqual(executeStage, actionSet.actionSet[0].function)
5540 self.assertEqual(300, actionSet.actionSet[1].index)
5541 self.assertEqual("store", actionSet.actionSet[1].name)
5542 self.assertEqual(None, actionSet.actionSet[1].preHooks)
5543 self.assertEqual(None, actionSet.actionSet[1].postHooks)
5544 self.assertEqual(executeStore, actionSet.actionSet[1].function)
5545
5546 def testActionSet_027(self):
5547 """
5548 Test with actions=[ store, store ], extensions=[].
5549 """
5550 actions = [
5551 "store",
5552 "store",
5553 ]
5554 extensions = ExtensionsConfig([], None)
5555 options = OptionsConfig()
5556 actionSet = _ActionSet(actions, extensions, options, None, False, True)
5557 self.assertTrue(len(actionSet.actionSet) == 2)
5558 self.assertEqual(300, actionSet.actionSet[0].index)
5559 self.assertEqual("store", actionSet.actionSet[0].name)
5560 self.assertEqual(None, actionSet.actionSet[0].preHooks)
5561 self.assertEqual(None, actionSet.actionSet[0].postHooks)
5562 self.assertEqual(executeStore, actionSet.actionSet[0].function)
5563 self.assertEqual(300, actionSet.actionSet[1].index)
5564 self.assertEqual("store", actionSet.actionSet[1].name)
5565 self.assertEqual(None, actionSet.actionSet[1].preHooks)
5566 self.assertEqual(None, actionSet.actionSet[1].postHooks)
5567 self.assertEqual(executeStore, actionSet.actionSet[1].function)
5568
5569 def testActionSet_028(self):
5570 """
5571 Test with actions=[ store, purge ], extensions=[].
5572 """
5573 actions = [
5574 "store",
5575 "purge",
5576 ]
5577 extensions = ExtensionsConfig([], None)
5578 options = OptionsConfig()
5579 actionSet = _ActionSet(actions, extensions, options, None, False, True)
5580 self.assertTrue(len(actionSet.actionSet) == 2)
5581 self.assertEqual(300, actionSet.actionSet[0].index)
5582 self.assertEqual("store", actionSet.actionSet[0].name)
5583 self.assertEqual(None, actionSet.actionSet[0].preHooks)
5584 self.assertEqual(None, actionSet.actionSet[0].postHooks)
5585 self.assertEqual(executeStore, actionSet.actionSet[0].function)
5586 self.assertEqual(400, actionSet.actionSet[1].index)
5587 self.assertEqual("purge", actionSet.actionSet[1].name)
5588 self.assertEqual(None, actionSet.actionSet[1].preHooks)
5589 self.assertEqual(None, actionSet.actionSet[1].postHooks)
5590 self.assertEqual(executePurge, actionSet.actionSet[1].function)
5591
5592 def testActionSet_029(self):
5593 """
5594 Test with actions=[ store, all ], extensions=[].
5595 """
5596 actions = [
5597 "store",
5598 "all",
5599 ]
5600 extensions = ExtensionsConfig([], None)
5601 options = OptionsConfig()
5602 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
5603
5604 def testActionSet_030(self):
5605 """
5606 Test with actions=[ store, rebuild ], extensions=[].
5607 """
5608 actions = [
5609 "store",
5610 "rebuild",
5611 ]
5612 extensions = ExtensionsConfig([], None)
5613 options = OptionsConfig()
5614 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
5615
5616 def testActionSet_031(self):
5617 """
5618 Test with actions=[ store, validate ], extensions=[].
5619 """
5620 actions = [
5621 "store",
5622 "validate",
5623 ]
5624 extensions = ExtensionsConfig([], None)
5625 options = OptionsConfig()
5626 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
5627
5628 def testActionSet_032(self):
5629 """
5630 Test with actions=[ purge, collect ], extensions=[].
5631 """
5632 actions = [
5633 "purge",
5634 "collect",
5635 ]
5636 extensions = ExtensionsConfig([], None)
5637 options = OptionsConfig()
5638 actionSet = _ActionSet(actions, extensions, options, None, False, True)
5639 self.assertTrue(len(actionSet.actionSet) == 2)
5640 self.assertEqual(100, actionSet.actionSet[0].index)
5641 self.assertEqual("collect", actionSet.actionSet[0].name)
5642 self.assertEqual(None, actionSet.actionSet[0].preHooks)
5643 self.assertEqual(None, actionSet.actionSet[0].postHooks)
5644 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
5645 self.assertEqual(400, actionSet.actionSet[1].index)
5646 self.assertEqual("purge", actionSet.actionSet[1].name)
5647 self.assertEqual(None, actionSet.actionSet[1].preHooks)
5648 self.assertEqual(None, actionSet.actionSet[1].postHooks)
5649 self.assertEqual(executePurge, actionSet.actionSet[1].function)
5650
5651 def testActionSet_033(self):
5652 """
5653 Test with actions=[ purge, stage ], extensions=[].
5654 """
5655 actions = [
5656 "purge",
5657 "stage",
5658 ]
5659 extensions = ExtensionsConfig([], None)
5660 options = OptionsConfig()
5661 actionSet = _ActionSet(actions, extensions, options, None, False, True)
5662 self.assertTrue(len(actionSet.actionSet) == 2)
5663 self.assertEqual(200, actionSet.actionSet[0].index)
5664 self.assertEqual("stage", actionSet.actionSet[0].name)
5665 self.assertEqual(None, actionSet.actionSet[0].preHooks)
5666 self.assertEqual(None, actionSet.actionSet[0].postHooks)
5667 self.assertEqual(executeStage, actionSet.actionSet[0].function)
5668 self.assertEqual(400, actionSet.actionSet[1].index)
5669 self.assertEqual("purge", actionSet.actionSet[1].name)
5670 self.assertEqual(None, actionSet.actionSet[1].preHooks)
5671 self.assertEqual(None, actionSet.actionSet[1].postHooks)
5672 self.assertEqual(executePurge, actionSet.actionSet[1].function)
5673
5674 def testActionSet_034(self):
5675 """
5676 Test with actions=[ purge, store ], extensions=[].
5677 """
5678 actions = [
5679 "purge",
5680 "store",
5681 ]
5682 extensions = ExtensionsConfig([], None)
5683 options = OptionsConfig()
5684 actionSet = _ActionSet(actions, extensions, options, None, False, True)
5685 self.assertTrue(len(actionSet.actionSet) == 2)
5686 self.assertEqual(300, actionSet.actionSet[0].index)
5687 self.assertEqual("store", actionSet.actionSet[0].name)
5688 self.assertEqual(None, actionSet.actionSet[0].preHooks)
5689 self.assertEqual(None, actionSet.actionSet[0].postHooks)
5690 self.assertEqual(executeStore, actionSet.actionSet[0].function)
5691 self.assertEqual(400, actionSet.actionSet[1].index)
5692 self.assertEqual("purge", actionSet.actionSet[1].name)
5693 self.assertEqual(None, actionSet.actionSet[1].preHooks)
5694 self.assertEqual(None, actionSet.actionSet[1].postHooks)
5695 self.assertEqual(executePurge, actionSet.actionSet[1].function)
5696
5697 def testActionSet_035(self):
5698 """
5699 Test with actions=[ purge, purge ], extensions=[].
5700 """
5701 actions = [
5702 "purge",
5703 "purge",
5704 ]
5705 extensions = ExtensionsConfig([], None)
5706 options = OptionsConfig()
5707 actionSet = _ActionSet(actions, extensions, options, None, False, True)
5708 self.assertTrue(len(actionSet.actionSet) == 2)
5709 self.assertEqual(400, actionSet.actionSet[0].index)
5710 self.assertEqual("purge", actionSet.actionSet[0].name)
5711 self.assertEqual(None, actionSet.actionSet[0].preHooks)
5712 self.assertEqual(None, actionSet.actionSet[0].postHooks)
5713 self.assertEqual(executePurge, actionSet.actionSet[0].function)
5714 self.assertEqual(400, actionSet.actionSet[1].index)
5715 self.assertEqual("purge", actionSet.actionSet[1].name)
5716 self.assertEqual(None, actionSet.actionSet[1].preHooks)
5717 self.assertEqual(None, actionSet.actionSet[1].postHooks)
5718 self.assertEqual(executePurge, actionSet.actionSet[1].function)
5719
5720 def testActionSet_036(self):
5721 """
5722 Test with actions=[ purge, all ], extensions=[].
5723 """
5724 actions = [
5725 "purge",
5726 "all",
5727 ]
5728 extensions = ExtensionsConfig([], None)
5729 options = OptionsConfig()
5730 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
5731
5732 def testActionSet_037(self):
5733 """
5734 Test with actions=[ purge, rebuild ], extensions=[].
5735 """
5736 actions = [
5737 "purge",
5738 "rebuild",
5739 ]
5740 extensions = ExtensionsConfig([], None)
5741 options = OptionsConfig()
5742 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
5743
5744 def testActionSet_038(self):
5745 """
5746 Test with actions=[ purge, validate ], extensions=[].
5747 """
5748 actions = [
5749 "purge",
5750 "validate",
5751 ]
5752 extensions = ExtensionsConfig([], None)
5753 options = OptionsConfig()
5754 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
5755
5756 def testActionSet_039(self):
5757 """
5758 Test with actions=[ all, collect ], extensions=[].
5759 """
5760 actions = [
5761 "all",
5762 "collect",
5763 ]
5764 extensions = ExtensionsConfig([], None)
5765 options = OptionsConfig()
5766 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
5767
5768 def testActionSet_040(self):
5769 """
5770 Test with actions=[ all, stage ], extensions=[].
5771 """
5772 actions = [
5773 "all",
5774 "stage",
5775 ]
5776 extensions = ExtensionsConfig([], None)
5777 options = OptionsConfig()
5778 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
5779
5780 def testActionSet_041(self):
5781 """
5782 Test with actions=[ all, store ], extensions=[].
5783 """
5784 actions = [
5785 "all",
5786 "store",
5787 ]
5788 extensions = ExtensionsConfig([], None)
5789 options = OptionsConfig()
5790 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
5791
5792 def testActionSet_042(self):
5793 """
5794 Test with actions=[ all, purge ], extensions=[].
5795 """
5796 actions = [
5797 "all",
5798 "purge",
5799 ]
5800 extensions = ExtensionsConfig([], None)
5801 options = OptionsConfig()
5802 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
5803
5804 def testActionSet_043(self):
5805 """
5806 Test with actions=[ all, all ], extensions=[].
5807 """
5808 actions = [
5809 "all",
5810 "all",
5811 ]
5812 extensions = ExtensionsConfig([], None)
5813 options = OptionsConfig()
5814 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
5815
5816 def testActionSet_044(self):
5817 """
5818 Test with actions=[ all, rebuild ], extensions=[].
5819 """
5820 actions = [
5821 "all",
5822 "rebuild",
5823 ]
5824 extensions = ExtensionsConfig([], None)
5825 options = OptionsConfig()
5826 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
5827
5828 def testActionSet_045(self):
5829 """
5830 Test with actions=[ all, validate ], extensions=[].
5831 """
5832 actions = [
5833 "all",
5834 "validate",
5835 ]
5836 extensions = ExtensionsConfig([], None)
5837 options = OptionsConfig()
5838 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
5839
5840 def testActionSet_046(self):
5841 """
5842 Test with actions=[ rebuild, collect ], extensions=[].
5843 """
5844 actions = [
5845 "rebuild",
5846 "collect",
5847 ]
5848 extensions = ExtensionsConfig([], None)
5849 options = OptionsConfig()
5850 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
5851
5852 def testActionSet_047(self):
5853 """
5854 Test with actions=[ rebuild, stage ], extensions=[].
5855 """
5856 actions = [
5857 "rebuild",
5858 "stage",
5859 ]
5860 extensions = ExtensionsConfig([], None)
5861 options = OptionsConfig()
5862 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
5863
5864 def testActionSet_048(self):
5865 """
5866 Test with actions=[ rebuild, store ], extensions=[].
5867 """
5868 actions = [
5869 "rebuild",
5870 "store",
5871 ]
5872 extensions = ExtensionsConfig([], None)
5873 options = OptionsConfig()
5874 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
5875
5876 def testActionSet_049(self):
5877 """
5878 Test with actions=[ rebuild, purge ], extensions=[].
5879 """
5880 actions = [
5881 "rebuild",
5882 "purge",
5883 ]
5884 extensions = ExtensionsConfig([], None)
5885 options = OptionsConfig()
5886 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
5887
5888 def testActionSet_050(self):
5889 """
5890 Test with actions=[ rebuild, all ], extensions=[].
5891 """
5892 actions = [
5893 "rebuild",
5894 "all",
5895 ]
5896 extensions = ExtensionsConfig([], None)
5897 options = OptionsConfig()
5898 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
5899
5900 def testActionSet_051(self):
5901 """
5902 Test with actions=[ rebuild, rebuild ], extensions=[].
5903 """
5904 actions = [
5905 "rebuild",
5906 "rebuild",
5907 ]
5908 extensions = ExtensionsConfig([], None)
5909 options = OptionsConfig()
5910 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
5911
5912 def testActionSet_052(self):
5913 """
5914 Test with actions=[ rebuild, validate ], extensions=[].
5915 """
5916 actions = [
5917 "rebuild",
5918 "validate",
5919 ]
5920 extensions = ExtensionsConfig([], None)
5921 options = OptionsConfig()
5922 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
5923
5924 def testActionSet_053(self):
5925 """
5926 Test with actions=[ validate, collect ], extensions=[].
5927 """
5928 actions = [
5929 "validate",
5930 "collect",
5931 ]
5932 extensions = ExtensionsConfig([], None)
5933 options = OptionsConfig()
5934 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
5935
5936 def testActionSet_054(self):
5937 """
5938 Test with actions=[ validate, stage ], extensions=[].
5939 """
5940 actions = [
5941 "validate",
5942 "stage",
5943 ]
5944 extensions = ExtensionsConfig([], None)
5945 options = OptionsConfig()
5946 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
5947
5948 def testActionSet_055(self):
5949 """
5950 Test with actions=[ validate, store ], extensions=[].
5951 """
5952 actions = [
5953 "validate",
5954 "store",
5955 ]
5956 extensions = ExtensionsConfig([], None)
5957 options = OptionsConfig()
5958 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
5959
5960 def testActionSet_056(self):
5961 """
5962 Test with actions=[ validate, purge ], extensions=[].
5963 """
5964 actions = [
5965 "validate",
5966 "purge",
5967 ]
5968 extensions = ExtensionsConfig([], None)
5969 options = OptionsConfig()
5970 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
5971
5972 def testActionSet_057(self):
5973 """
5974 Test with actions=[ validate, all ], extensions=[].
5975 """
5976 actions = [
5977 "validate",
5978 "all",
5979 ]
5980 extensions = ExtensionsConfig([], None)
5981 options = OptionsConfig()
5982 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
5983
5984 def testActionSet_058(self):
5985 """
5986 Test with actions=[ validate, rebuild ], extensions=[].
5987 """
5988 actions = [
5989 "validate",
5990 "rebuild",
5991 ]
5992 extensions = ExtensionsConfig([], None)
5993 options = OptionsConfig()
5994 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
5995
5996 def testActionSet_059(self):
5997 """
5998 Test with actions=[ validate, validate ], extensions=[].
5999 """
6000 actions = [
6001 "validate",
6002 "validate",
6003 ]
6004 extensions = ExtensionsConfig([], None)
6005 options = OptionsConfig()
6006 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
6007
6008 def testActionSet_060(self):
6009 """
6010 Test with actions=[ bogus ], extensions=[].
6011 """
6012 actions = [
6013 "bogus",
6014 ]
6015 extensions = ExtensionsConfig([], None)
6016 options = OptionsConfig()
6017 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
6018
6019 def testActionSet_061(self):
6020 """
6021 Test with actions=[ bogus, collect ], extensions=[].
6022 """
6023 actions = [
6024 "bogus",
6025 "collect",
6026 ]
6027 extensions = ExtensionsConfig([], None)
6028 options = OptionsConfig()
6029 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
6030
6031 def testActionSet_062(self):
6032 """
6033 Test with actions=[ bogus, stage ], extensions=[].
6034 """
6035 actions = [
6036 "bogus",
6037 "stage",
6038 ]
6039 extensions = ExtensionsConfig([], None)
6040 options = OptionsConfig()
6041 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
6042
6043 def testActionSet_063(self):
6044 """
6045 Test with actions=[ bogus, store ], extensions=[].
6046 """
6047 actions = [
6048 "bogus",
6049 "store",
6050 ]
6051 extensions = ExtensionsConfig([], None)
6052 options = OptionsConfig()
6053 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
6054
6055 def testActionSet_064(self):
6056 """
6057 Test with actions=[ bogus, purge ], extensions=[].
6058 """
6059 actions = [
6060 "bogus",
6061 "purge",
6062 ]
6063 extensions = ExtensionsConfig([], None)
6064 options = OptionsConfig()
6065 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
6066
6067 def testActionSet_065(self):
6068 """
6069 Test with actions=[ bogus, all ], extensions=[].
6070 """
6071 actions = [
6072 "bogus",
6073 "all",
6074 ]
6075 extensions = ExtensionsConfig([], None)
6076 options = OptionsConfig()
6077 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
6078
6079 def testActionSet_066(self):
6080 """
6081 Test with actions=[ bogus, rebuild ], extensions=[].
6082 """
6083 actions = [
6084 "bogus",
6085 "rebuild",
6086 ]
6087 extensions = ExtensionsConfig([], None)
6088 options = OptionsConfig()
6089 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
6090
6091 def testActionSet_067(self):
6092 """
6093 Test with actions=[ bogus, validate ], extensions=[].
6094 """
6095 actions = [
6096 "bogus",
6097 "validate",
6098 ]
6099 extensions = ExtensionsConfig([], None)
6100 options = OptionsConfig()
6101 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
6102
6103 def testActionSet_068(self):
6104 """
6105 Test with actions=[ collect, one ], extensions=[ (one, index 50) ].
6106 """
6107 actions = [
6108 "collect",
6109 "one",
6110 ]
6111 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
6112 options = OptionsConfig()
6113 actionSet = _ActionSet(actions, extensions, options, None, False, True)
6114 self.assertTrue(len(actionSet.actionSet) == 2)
6115 self.assertEqual(50, actionSet.actionSet[0].index)
6116 self.assertEqual("one", actionSet.actionSet[0].name)
6117 self.assertEqual(None, actionSet.actionSet[0].preHooks)
6118 self.assertEqual(None, actionSet.actionSet[0].postHooks)
6119 self.assertEqual(isdir, actionSet.actionSet[0].function)
6120 self.assertEqual(100, actionSet.actionSet[1].index)
6121 self.assertEqual("collect", actionSet.actionSet[1].name)
6122 self.assertEqual(None, actionSet.actionSet[1].preHooks)
6123 self.assertEqual(None, actionSet.actionSet[1].postHooks)
6124 self.assertEqual(executeCollect, actionSet.actionSet[1].function)
6125
6126 def testActionSet_069(self):
6127 """
6128 Test with actions=[ stage, one ], extensions=[ (one, index 50) ].
6129 """
6130 actions = [
6131 "stage",
6132 "one",
6133 ]
6134 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
6135 options = OptionsConfig()
6136 actionSet = _ActionSet(actions, extensions, options, None, False, True)
6137 self.assertTrue(len(actionSet.actionSet) == 2)
6138 self.assertEqual(50, actionSet.actionSet[0].index)
6139 self.assertEqual(isdir, actionSet.actionSet[0].function)
6140 self.assertEqual("one", actionSet.actionSet[0].name)
6141 self.assertEqual(None, actionSet.actionSet[0].preHooks)
6142 self.assertEqual(None, actionSet.actionSet[0].postHooks)
6143 self.assertEqual(200, actionSet.actionSet[1].index)
6144 self.assertEqual("stage", actionSet.actionSet[1].name)
6145 self.assertEqual(None, actionSet.actionSet[1].preHooks)
6146 self.assertEqual(None, actionSet.actionSet[1].postHooks)
6147 self.assertEqual(executeStage, actionSet.actionSet[1].function)
6148
6149 def testActionSet_070(self):
6150 """
6151 Test with actions=[ store, one ], extensions=[ (one, index 50) ].
6152 """
6153 actions = [
6154 "store",
6155 "one",
6156 ]
6157 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
6158 options = OptionsConfig()
6159 actionSet = _ActionSet(actions, extensions, options, None, False, True)
6160 self.assertTrue(len(actionSet.actionSet) == 2)
6161 self.assertEqual(50, actionSet.actionSet[0].index)
6162 self.assertEqual("one", actionSet.actionSet[0].name)
6163 self.assertEqual(None, actionSet.actionSet[0].preHooks)
6164 self.assertEqual(None, actionSet.actionSet[0].postHooks)
6165 self.assertEqual(isdir, actionSet.actionSet[0].function)
6166 self.assertEqual(300, actionSet.actionSet[1].index)
6167 self.assertEqual("store", actionSet.actionSet[1].name)
6168 self.assertEqual(None, actionSet.actionSet[1].preHooks)
6169 self.assertEqual(None, actionSet.actionSet[1].postHooks)
6170 self.assertEqual(executeStore, actionSet.actionSet[1].function)
6171
6172 def testActionSet_071(self):
6173 """
6174 Test with actions=[ purge, one ], extensions=[ (one, index 50) ].
6175 """
6176 actions = [
6177 "purge",
6178 "one",
6179 ]
6180 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
6181 options = OptionsConfig()
6182 actionSet = _ActionSet(actions, extensions, options, None, False, True)
6183 self.assertTrue(len(actionSet.actionSet) == 2)
6184 self.assertEqual(50, actionSet.actionSet[0].index)
6185 self.assertEqual("one", actionSet.actionSet[0].name)
6186 self.assertEqual(None, actionSet.actionSet[0].preHooks)
6187 self.assertEqual(None, actionSet.actionSet[0].postHooks)
6188 self.assertEqual(isdir, actionSet.actionSet[0].function)
6189 self.assertEqual(400, actionSet.actionSet[1].index)
6190 self.assertEqual("purge", actionSet.actionSet[1].name)
6191 self.assertEqual(None, actionSet.actionSet[1].preHooks)
6192 self.assertEqual(None, actionSet.actionSet[1].postHooks)
6193 self.assertEqual(executePurge, actionSet.actionSet[1].function)
6194
6195 def testActionSet_072(self):
6196 """
6197 Test with actions=[ all, one ], extensions=[ (one, index 50) ].
6198 """
6199 actions = [
6200 "all",
6201 "one",
6202 ]
6203 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
6204 options = OptionsConfig()
6205 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
6206
6207 def testActionSet_073(self):
6208 """
6209 Test with actions=[ rebuild, one ], extensions=[ (one, index 50) ].
6210 """
6211 actions = [
6212 "rebuild",
6213 "one",
6214 ]
6215 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
6216 options = OptionsConfig()
6217 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
6218
6219 def testActionSet_074(self):
6220 """
6221 Test with actions=[ validate, one ], extensions=[ (one, index 50) ].
6222 """
6223 actions = [
6224 "validate",
6225 "one",
6226 ]
6227 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
6228 options = OptionsConfig()
6229 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
6230
6231 def testActionSet_075(self):
6232 """
6233 Test with actions=[ collect, one ], extensions=[ (one, index 150) ].
6234 """
6235 actions = [
6236 "collect",
6237 "one",
6238 ]
6239 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 150)], None)
6240 options = OptionsConfig()
6241 actionSet = _ActionSet(actions, extensions, options, None, False, True)
6242 self.assertTrue(len(actionSet.actionSet) == 2)
6243 self.assertEqual(100, actionSet.actionSet[0].index)
6244 self.assertEqual("collect", actionSet.actionSet[0].name)
6245 self.assertEqual(None, actionSet.actionSet[0].preHooks)
6246 self.assertEqual(None, actionSet.actionSet[0].postHooks)
6247 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
6248 self.assertEqual(150, actionSet.actionSet[1].index)
6249 self.assertEqual("one", actionSet.actionSet[1].name)
6250 self.assertEqual(None, actionSet.actionSet[1].preHooks)
6251 self.assertEqual(None, actionSet.actionSet[1].postHooks)
6252 self.assertEqual(isdir, actionSet.actionSet[1].function)
6253
6254 def testActionSet_076(self):
6255 """
6256 Test with actions=[ stage, one ], extensions=[ (one, index 150) ].
6257 """
6258 actions = [
6259 "stage",
6260 "one",
6261 ]
6262 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 150)], None)
6263 options = OptionsConfig()
6264 actionSet = _ActionSet(actions, extensions, options, None, False, True)
6265 self.assertTrue(len(actionSet.actionSet) == 2)
6266 self.assertEqual(150, actionSet.actionSet[0].index)
6267 self.assertEqual("one", actionSet.actionSet[0].name)
6268 self.assertEqual(None, actionSet.actionSet[0].preHooks)
6269 self.assertEqual(None, actionSet.actionSet[0].postHooks)
6270 self.assertEqual(isdir, actionSet.actionSet[0].function)
6271 self.assertEqual(200, actionSet.actionSet[1].index)
6272 self.assertEqual("stage", actionSet.actionSet[1].name)
6273 self.assertEqual(None, actionSet.actionSet[1].preHooks)
6274 self.assertEqual(None, actionSet.actionSet[1].postHooks)
6275 self.assertEqual(executeStage, actionSet.actionSet[1].function)
6276
6277 def testActionSet_077(self):
6278 """
6279 Test with actions=[ store, one ], extensions=[ (one, index 150) ].
6280 """
6281 actions = [
6282 "store",
6283 "one",
6284 ]
6285 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 150)], None)
6286 options = OptionsConfig()
6287 actionSet = _ActionSet(actions, extensions, options, None, False, True)
6288 self.assertTrue(len(actionSet.actionSet) == 2)
6289 self.assertEqual(150, actionSet.actionSet[0].index)
6290 self.assertEqual("one", actionSet.actionSet[0].name)
6291 self.assertEqual(None, actionSet.actionSet[0].preHooks)
6292 self.assertEqual(None, actionSet.actionSet[0].postHooks)
6293 self.assertEqual(isdir, actionSet.actionSet[0].function)
6294 self.assertEqual(300, actionSet.actionSet[1].index)
6295 self.assertEqual("store", actionSet.actionSet[1].name)
6296 self.assertEqual(None, actionSet.actionSet[1].preHooks)
6297 self.assertEqual(None, actionSet.actionSet[1].postHooks)
6298 self.assertEqual(executeStore, actionSet.actionSet[1].function)
6299
6300 def testActionSet_078(self):
6301 """
6302 Test with actions=[ purge, one ], extensions=[ (one, index 150) ].
6303 """
6304 actions = [
6305 "purge",
6306 "one",
6307 ]
6308 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 150)], None)
6309 options = OptionsConfig()
6310 actionSet = _ActionSet(actions, extensions, options, None, False, True)
6311 self.assertTrue(len(actionSet.actionSet) == 2)
6312 self.assertEqual(150, actionSet.actionSet[0].index)
6313 self.assertEqual("one", actionSet.actionSet[0].name)
6314 self.assertEqual(None, actionSet.actionSet[0].preHooks)
6315 self.assertEqual(None, actionSet.actionSet[0].postHooks)
6316 self.assertEqual(isdir, actionSet.actionSet[0].function)
6317 self.assertEqual(400, actionSet.actionSet[1].index)
6318 self.assertEqual("purge", actionSet.actionSet[1].name)
6319 self.assertEqual(None, actionSet.actionSet[1].preHooks)
6320 self.assertEqual(None, actionSet.actionSet[1].postHooks)
6321 self.assertEqual(executePurge, actionSet.actionSet[1].function)
6322
6323 def testActionSet_079(self):
6324 """
6325 Test with actions=[ all, one ], extensions=[ (one, index 150) ].
6326 """
6327 actions = [
6328 "all",
6329 "one",
6330 ]
6331 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 150)], None)
6332 options = OptionsConfig()
6333 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
6334
6335 def testActionSet_080(self):
6336 """
6337 Test with actions=[ rebuild, one ], extensions=[ (one, index 150) ].
6338 """
6339 actions = [
6340 "rebuild",
6341 "one",
6342 ]
6343 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 150)], None)
6344 options = OptionsConfig()
6345 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
6346
6347 def testActionSet_081(self):
6348 """
6349 Test with actions=[ validate, one ], extensions=[ (one, index 150) ].
6350 """
6351 actions = [
6352 "validate",
6353 "one",
6354 ]
6355 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 150)], None)
6356 options = OptionsConfig()
6357 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
6358
6359 def testActionSet_082(self):
6360 """
6361 Test with actions=[ collect, one ], extensions=[ (one, index 250) ].
6362 """
6363 actions = [
6364 "collect",
6365 "one",
6366 ]
6367 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 250)], None)
6368 options = OptionsConfig()
6369 actionSet = _ActionSet(actions, extensions, options, None, False, True)
6370 self.assertTrue(len(actionSet.actionSet) == 2)
6371 self.assertEqual(100, actionSet.actionSet[0].index)
6372 self.assertEqual("collect", actionSet.actionSet[0].name)
6373 self.assertEqual(None, actionSet.actionSet[0].preHooks)
6374 self.assertEqual(None, actionSet.actionSet[0].postHooks)
6375 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
6376 self.assertEqual(250, actionSet.actionSet[1].index)
6377 self.assertEqual("one", actionSet.actionSet[1].name)
6378 self.assertEqual(None, actionSet.actionSet[1].preHooks)
6379 self.assertEqual(None, actionSet.actionSet[1].postHooks)
6380 self.assertEqual(isdir, actionSet.actionSet[1].function)
6381
6382 def testActionSet_083(self):
6383 """
6384 Test with actions=[ stage, one ], extensions=[ (one, index 250) ].
6385 """
6386 actions = [
6387 "stage",
6388 "one",
6389 ]
6390 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 250)], None)
6391 options = OptionsConfig()
6392 actionSet = _ActionSet(actions, extensions, options, None, False, True)
6393 self.assertTrue(len(actionSet.actionSet) == 2)
6394 self.assertEqual(200, actionSet.actionSet[0].index)
6395 self.assertEqual("stage", actionSet.actionSet[0].name)
6396 self.assertEqual(None, actionSet.actionSet[0].preHooks)
6397 self.assertEqual(None, actionSet.actionSet[0].postHooks)
6398 self.assertEqual(executeStage, actionSet.actionSet[0].function)
6399 self.assertEqual(250, actionSet.actionSet[1].index)
6400 self.assertEqual("one", actionSet.actionSet[1].name)
6401 self.assertEqual(None, actionSet.actionSet[1].preHooks)
6402 self.assertEqual(None, actionSet.actionSet[1].postHooks)
6403 self.assertEqual(isdir, actionSet.actionSet[1].function)
6404
6405 def testActionSet_084(self):
6406 """
6407 Test with actions=[ store, one ], extensions=[ (one, index 250) ].
6408 """
6409 actions = [
6410 "store",
6411 "one",
6412 ]
6413 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 250)], None)
6414 options = OptionsConfig()
6415 actionSet = _ActionSet(actions, extensions, options, None, False, True)
6416 self.assertTrue(len(actionSet.actionSet) == 2)
6417 self.assertEqual(250, actionSet.actionSet[0].index)
6418 self.assertEqual("one", actionSet.actionSet[0].name)
6419 self.assertEqual(None, actionSet.actionSet[0].preHooks)
6420 self.assertEqual(None, actionSet.actionSet[0].postHooks)
6421 self.assertEqual(isdir, actionSet.actionSet[0].function)
6422 self.assertEqual(300, actionSet.actionSet[1].index)
6423 self.assertEqual("store", actionSet.actionSet[1].name)
6424 self.assertEqual(None, actionSet.actionSet[1].preHooks)
6425 self.assertEqual(None, actionSet.actionSet[1].postHooks)
6426 self.assertEqual(executeStore, actionSet.actionSet[1].function)
6427
6428 def testActionSet_085(self):
6429 """
6430 Test with actions=[ purge, one ], extensions=[ (one, index 250) ].
6431 """
6432 actions = [
6433 "purge",
6434 "one",
6435 ]
6436 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 250)], None)
6437 options = OptionsConfig()
6438 actionSet = _ActionSet(actions, extensions, options, None, False, True)
6439 self.assertTrue(len(actionSet.actionSet) == 2)
6440 self.assertEqual(250, actionSet.actionSet[0].index)
6441 self.assertEqual("one", actionSet.actionSet[0].name)
6442 self.assertEqual(None, actionSet.actionSet[0].preHooks)
6443 self.assertEqual(None, actionSet.actionSet[0].postHooks)
6444 self.assertEqual(isdir, actionSet.actionSet[0].function)
6445 self.assertEqual(400, actionSet.actionSet[1].index)
6446 self.assertEqual("purge", actionSet.actionSet[1].name)
6447 self.assertEqual(None, actionSet.actionSet[1].preHooks)
6448 self.assertEqual(None, actionSet.actionSet[1].postHooks)
6449 self.assertEqual(executePurge, actionSet.actionSet[1].function)
6450
6451 def testActionSet_086(self):
6452 """
6453 Test with actions=[ all, one ], extensions=[ (one, index 250) ].
6454 """
6455 actions = [
6456 "all",
6457 "one",
6458 ]
6459 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 250)], None)
6460 options = OptionsConfig()
6461 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
6462
6463 def testActionSet_087(self):
6464 """
6465 Test with actions=[ rebuild, one ], extensions=[ (one, index 250) ].
6466 """
6467 actions = [
6468 "rebuild",
6469 "one",
6470 ]
6471 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 250)], None)
6472 options = OptionsConfig()
6473 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
6474
6475 def testActionSet_088(self):
6476 """
6477 Test with actions=[ validate, one ], extensions=[ (one, index 250) ].
6478 """
6479 actions = [
6480 "validate",
6481 "one",
6482 ]
6483 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 250)], None)
6484 options = OptionsConfig()
6485 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
6486
6487 def testActionSet_089(self):
6488 """
6489 Test with actions=[ collect, one ], extensions=[ (one, index 350) ].
6490 """
6491 actions = [
6492 "collect",
6493 "one",
6494 ]
6495 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 350)], None)
6496 options = OptionsConfig()
6497 actionSet = _ActionSet(actions, extensions, options, None, False, True)
6498 self.assertTrue(len(actionSet.actionSet) == 2)
6499 self.assertEqual(100, actionSet.actionSet[0].index)
6500 self.assertEqual("collect", actionSet.actionSet[0].name)
6501 self.assertEqual(None, actionSet.actionSet[0].preHooks)
6502 self.assertEqual(None, actionSet.actionSet[0].postHooks)
6503 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
6504 self.assertEqual(350, actionSet.actionSet[1].index)
6505 self.assertEqual("one", actionSet.actionSet[1].name)
6506 self.assertEqual(None, actionSet.actionSet[1].preHooks)
6507 self.assertEqual(None, actionSet.actionSet[1].postHooks)
6508 self.assertEqual(isdir, actionSet.actionSet[1].function)
6509
6510 def testActionSet_090(self):
6511 """
6512 Test with actions=[ stage, one ], extensions=[ (one, index 350) ].
6513 """
6514 actions = [
6515 "stage",
6516 "one",
6517 ]
6518 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 350)], None)
6519 options = OptionsConfig()
6520 actionSet = _ActionSet(actions, extensions, options, None, False, True)
6521 self.assertTrue(len(actionSet.actionSet) == 2)
6522 self.assertEqual(200, actionSet.actionSet[0].index)
6523 self.assertEqual("stage", actionSet.actionSet[0].name)
6524 self.assertEqual(None, actionSet.actionSet[0].preHooks)
6525 self.assertEqual(None, actionSet.actionSet[0].postHooks)
6526 self.assertEqual(executeStage, actionSet.actionSet[0].function)
6527 self.assertEqual(350, actionSet.actionSet[1].index)
6528 self.assertEqual("one", actionSet.actionSet[1].name)
6529 self.assertEqual(None, actionSet.actionSet[1].preHooks)
6530 self.assertEqual(None, actionSet.actionSet[1].postHooks)
6531 self.assertEqual(isdir, actionSet.actionSet[1].function)
6532
6533 def testActionSet_091(self):
6534 """
6535 Test with actions=[ store, one ], extensions=[ (one, index 350) ].
6536 """
6537 actions = [
6538 "store",
6539 "one",
6540 ]
6541 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 350)], None)
6542 options = OptionsConfig()
6543 actionSet = _ActionSet(actions, extensions, options, None, False, True)
6544 self.assertTrue(len(actionSet.actionSet) == 2)
6545 self.assertEqual(300, actionSet.actionSet[0].index)
6546 self.assertEqual("store", actionSet.actionSet[0].name)
6547 self.assertEqual(None, actionSet.actionSet[0].preHooks)
6548 self.assertEqual(None, actionSet.actionSet[0].postHooks)
6549 self.assertEqual(executeStore, actionSet.actionSet[0].function)
6550 self.assertEqual(350, actionSet.actionSet[1].index)
6551 self.assertEqual("one", actionSet.actionSet[1].name)
6552 self.assertEqual(None, actionSet.actionSet[1].preHooks)
6553 self.assertEqual(None, actionSet.actionSet[1].postHooks)
6554 self.assertEqual(isdir, actionSet.actionSet[1].function)
6555
6556 def testActionSet_092(self):
6557 """
6558 Test with actions=[ purge, one ], extensions=[ (one, index 350) ].
6559 """
6560 actions = [
6561 "purge",
6562 "one",
6563 ]
6564 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 350)], None)
6565 options = OptionsConfig()
6566 actionSet = _ActionSet(actions, extensions, options, None, False, True)
6567 self.assertTrue(len(actionSet.actionSet) == 2)
6568 self.assertEqual(350, actionSet.actionSet[0].index)
6569 self.assertEqual("one", actionSet.actionSet[0].name)
6570 self.assertEqual(None, actionSet.actionSet[0].preHooks)
6571 self.assertEqual(None, actionSet.actionSet[0].postHooks)
6572 self.assertEqual(isdir, actionSet.actionSet[0].function)
6573 self.assertEqual(400, actionSet.actionSet[1].index)
6574 self.assertEqual("purge", actionSet.actionSet[1].name)
6575 self.assertEqual(None, actionSet.actionSet[1].preHooks)
6576 self.assertEqual(None, actionSet.actionSet[1].postHooks)
6577 self.assertEqual(executePurge, actionSet.actionSet[1].function)
6578
6579 def testActionSet_093(self):
6580 """
6581 Test with actions=[ all, one ], extensions=[ (one, index 350) ].
6582 """
6583 actions = [
6584 "all",
6585 "one",
6586 ]
6587 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 350)], None)
6588 options = OptionsConfig()
6589 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
6590
6591 def testActionSet_094(self):
6592 """
6593 Test with actions=[ rebuild, one ], extensions=[ (one, index 350) ].
6594 """
6595 actions = [
6596 "rebuild",
6597 "one",
6598 ]
6599 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 350)], None)
6600 options = OptionsConfig()
6601 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
6602
6603 def testActionSet_095(self):
6604 """
6605 Test with actions=[ validate, one ], extensions=[ (one, index 350) ].
6606 """
6607 actions = [
6608 "validate",
6609 "one",
6610 ]
6611 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 350)], None)
6612 options = OptionsConfig()
6613 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
6614
6615 def testActionSet_096(self):
6616 """
6617 Test with actions=[ collect, one ], extensions=[ (one, index 450) ].
6618 """
6619 actions = [
6620 "collect",
6621 "one",
6622 ]
6623 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 450)], None)
6624 options = OptionsConfig()
6625 actionSet = _ActionSet(actions, extensions, options, None, False, True)
6626 self.assertTrue(len(actionSet.actionSet) == 2)
6627 self.assertEqual(100, actionSet.actionSet[0].index)
6628 self.assertEqual("collect", actionSet.actionSet[0].name)
6629 self.assertEqual(None, actionSet.actionSet[0].preHooks)
6630 self.assertEqual(None, actionSet.actionSet[0].postHooks)
6631 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
6632 self.assertEqual(450, actionSet.actionSet[1].index)
6633 self.assertEqual("one", actionSet.actionSet[1].name)
6634 self.assertEqual(None, actionSet.actionSet[1].preHooks)
6635 self.assertEqual(None, actionSet.actionSet[1].postHooks)
6636 self.assertEqual(isdir, actionSet.actionSet[1].function)
6637
6638 def testActionSet_097(self):
6639 """
6640 Test with actions=[ stage, one ], extensions=[ (one, index 450) ].
6641 """
6642 actions = [
6643 "stage",
6644 "one",
6645 ]
6646 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 450)], None)
6647 options = OptionsConfig()
6648 actionSet = _ActionSet(actions, extensions, options, None, False, True)
6649 self.assertTrue(len(actionSet.actionSet) == 2)
6650 self.assertEqual(200, actionSet.actionSet[0].index)
6651 self.assertEqual("stage", actionSet.actionSet[0].name)
6652 self.assertEqual(None, actionSet.actionSet[0].preHooks)
6653 self.assertEqual(None, actionSet.actionSet[0].postHooks)
6654 self.assertEqual(executeStage, actionSet.actionSet[0].function)
6655 self.assertEqual(450, actionSet.actionSet[1].index)
6656 self.assertEqual("one", actionSet.actionSet[1].name)
6657 self.assertEqual(None, actionSet.actionSet[1].preHooks)
6658 self.assertEqual(None, actionSet.actionSet[1].postHooks)
6659 self.assertEqual(isdir, actionSet.actionSet[1].function)
6660
6661 def testActionSet_098(self):
6662 """
6663 Test with actions=[ store, one ], extensions=[ (one, index 450) ].
6664 """
6665 actions = [
6666 "store",
6667 "one",
6668 ]
6669 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 450)], None)
6670 options = OptionsConfig()
6671 actionSet = _ActionSet(actions, extensions, options, None, False, True)
6672 self.assertTrue(len(actionSet.actionSet) == 2)
6673 self.assertEqual(300, actionSet.actionSet[0].index)
6674 self.assertEqual("store", actionSet.actionSet[0].name)
6675 self.assertEqual(None, actionSet.actionSet[0].preHooks)
6676 self.assertEqual(None, actionSet.actionSet[0].postHooks)
6677 self.assertEqual(executeStore, actionSet.actionSet[0].function)
6678 self.assertEqual(450, actionSet.actionSet[1].index)
6679 self.assertEqual("one", actionSet.actionSet[1].name)
6680 self.assertEqual(None, actionSet.actionSet[1].preHooks)
6681 self.assertEqual(None, actionSet.actionSet[1].postHooks)
6682 self.assertEqual(isdir, actionSet.actionSet[1].function)
6683
6684 def testActionSet_099(self):
6685 """
6686 Test with actions=[ purge, one ], extensions=[ (one, index 450) ].
6687 """
6688 actions = [
6689 "purge",
6690 "one",
6691 ]
6692 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 450)], None)
6693 options = OptionsConfig()
6694 actionSet = _ActionSet(actions, extensions, options, None, False, True)
6695 self.assertTrue(len(actionSet.actionSet) == 2)
6696 self.assertEqual(400, actionSet.actionSet[0].index)
6697 self.assertEqual("purge", actionSet.actionSet[0].name)
6698 self.assertEqual(None, actionSet.actionSet[0].preHooks)
6699 self.assertEqual(None, actionSet.actionSet[0].postHooks)
6700 self.assertEqual(executePurge, actionSet.actionSet[0].function)
6701 self.assertEqual(450, actionSet.actionSet[1].index)
6702 self.assertEqual("one", actionSet.actionSet[1].name)
6703 self.assertEqual(None, actionSet.actionSet[1].preHooks)
6704 self.assertEqual(None, actionSet.actionSet[1].postHooks)
6705 self.assertEqual(isdir, actionSet.actionSet[1].function)
6706
6707 def testActionSet_100(self):
6708 """
6709 Test with actions=[ all, one ], extensions=[ (one, index 450) ].
6710 """
6711 actions = [
6712 "all",
6713 "one",
6714 ]
6715 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 450)], None)
6716 options = OptionsConfig()
6717 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
6718
6719 def testActionSet_101(self):
6720 """
6721 Test with actions=[ rebuild, one ], extensions=[ (one, index 450) ].
6722 """
6723 actions = [
6724 "rebuild",
6725 "one",
6726 ]
6727 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 450)], None)
6728 options = OptionsConfig()
6729 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
6730
6731 def testActionSet_102(self):
6732 """
6733 Test with actions=[ validate, one ], extensions=[ (one, index 450) ].
6734 """
6735 actions = [
6736 "validate",
6737 "one",
6738 ]
6739 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 450)], None)
6740 options = OptionsConfig()
6741 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
6742
6743 def testActionSet_103(self):
6744 """
6745 Test with actions=[ one, one ], extensions=[ (one, index 450) ].
6746 """
6747 actions = [
6748 "one",
6749 "one",
6750 ]
6751 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 450)], None)
6752 options = OptionsConfig()
6753 actionSet = _ActionSet(actions, extensions, options, None, False, True)
6754 self.assertTrue(len(actionSet.actionSet) == 2)
6755 self.assertEqual(450, actionSet.actionSet[0].index)
6756 self.assertEqual("one", actionSet.actionSet[0].name)
6757 self.assertEqual(None, actionSet.actionSet[0].preHooks)
6758 self.assertEqual(None, actionSet.actionSet[0].postHooks)
6759 self.assertEqual(isdir, actionSet.actionSet[0].function)
6760 self.assertEqual(450, actionSet.actionSet[1].index)
6761 self.assertEqual("one", actionSet.actionSet[1].name)
6762 self.assertEqual(None, actionSet.actionSet[1].preHooks)
6763 self.assertEqual(None, actionSet.actionSet[1].postHooks)
6764 self.assertEqual(isdir, actionSet.actionSet[1].function)
6765
6766 def testActionSet_104(self):
6767 """
6768 Test with actions=[ collect, stage, store, purge ], extensions=[].
6769 """
6770 actions = [
6771 "collect",
6772 "stage",
6773 "store",
6774 "purge",
6775 ]
6776 extensions = ExtensionsConfig([], None)
6777 options = OptionsConfig()
6778 actionSet = _ActionSet(actions, extensions, options, None, False, True)
6779 self.assertTrue(len(actionSet.actionSet) == 4)
6780 self.assertEqual(100, actionSet.actionSet[0].index)
6781 self.assertEqual("collect", actionSet.actionSet[0].name)
6782 self.assertEqual(None, actionSet.actionSet[0].preHooks)
6783 self.assertEqual(None, actionSet.actionSet[0].postHooks)
6784 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
6785 self.assertEqual(200, actionSet.actionSet[1].index)
6786 self.assertEqual("stage", actionSet.actionSet[1].name)
6787 self.assertEqual(None, actionSet.actionSet[1].preHooks)
6788 self.assertEqual(None, actionSet.actionSet[1].postHooks)
6789 self.assertEqual(executeStage, actionSet.actionSet[1].function)
6790 self.assertEqual(300, actionSet.actionSet[2].index)
6791 self.assertEqual("store", actionSet.actionSet[2].name)
6792 self.assertEqual(None, actionSet.actionSet[2].preHooks)
6793 self.assertEqual(None, actionSet.actionSet[2].postHooks)
6794 self.assertEqual(executeStore, actionSet.actionSet[2].function)
6795 self.assertEqual(400, actionSet.actionSet[3].index)
6796 self.assertEqual("purge", actionSet.actionSet[3].name)
6797 self.assertEqual(None, actionSet.actionSet[3].preHooks)
6798 self.assertEqual(None, actionSet.actionSet[3].postHooks)
6799 self.assertEqual(executePurge, actionSet.actionSet[3].function)
6800
6801 def testActionSet_105(self):
6802 """
6803 Test with actions=[ stage, purge, collect, store ], extensions=[].
6804 """
6805 actions = [
6806 "stage",
6807 "purge",
6808 "collect",
6809 "store",
6810 ]
6811 extensions = ExtensionsConfig([], None)
6812 options = OptionsConfig()
6813 actionSet = _ActionSet(actions, extensions, options, None, False, True)
6814 self.assertTrue(len(actionSet.actionSet) == 4)
6815 self.assertEqual(100, actionSet.actionSet[0].index)
6816 self.assertEqual("collect", actionSet.actionSet[0].name)
6817 self.assertEqual(None, actionSet.actionSet[0].preHooks)
6818 self.assertEqual(None, actionSet.actionSet[0].postHooks)
6819 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
6820 self.assertEqual(200, actionSet.actionSet[1].index)
6821 self.assertEqual("stage", actionSet.actionSet[1].name)
6822 self.assertEqual(None, actionSet.actionSet[1].preHooks)
6823 self.assertEqual(None, actionSet.actionSet[1].postHooks)
6824 self.assertEqual(executeStage, actionSet.actionSet[1].function)
6825 self.assertEqual(300, actionSet.actionSet[2].index)
6826 self.assertEqual("store", actionSet.actionSet[2].name)
6827 self.assertEqual(None, actionSet.actionSet[2].preHooks)
6828 self.assertEqual(None, actionSet.actionSet[2].postHooks)
6829 self.assertEqual(executeStore, actionSet.actionSet[2].function)
6830 self.assertEqual(400, actionSet.actionSet[3].index)
6831 self.assertEqual("purge", actionSet.actionSet[3].name)
6832 self.assertEqual(None, actionSet.actionSet[3].preHooks)
6833 self.assertEqual(None, actionSet.actionSet[3].postHooks)
6834 self.assertEqual(executePurge, actionSet.actionSet[3].function)
6835
6836 def testActionSet_106(self):
6837 """
6838 Test with actions=[ collect, stage, store, purge, one, two, three, four, five ], extensions=[ (index 50, 150, 250, 350, 450)].
6839 """
6840 actions = [
6841 "collect",
6842 "stage",
6843 "store",
6844 "purge",
6845 "one",
6846 "two",
6847 "three",
6848 "four",
6849 "five",
6850 ]
6851 extensions = ExtensionsConfig(
6852 [
6853 ExtendedAction("one", "os.path", "isdir", 50),
6854 ExtendedAction("two", "os.path", "isfile", 150),
6855 ExtendedAction("three", "os.path", "islink", 250),
6856 ExtendedAction("four", "os.path", "isabs", 350),
6857 ExtendedAction("five", "os.path", "exists", 450),
6858 ],
6859 None,
6860 )
6861 options = OptionsConfig()
6862 actionSet = _ActionSet(actions, extensions, options, None, False, True)
6863 self.assertTrue(len(actionSet.actionSet) == 9)
6864 self.assertEqual(50, actionSet.actionSet[0].index)
6865 self.assertEqual("one", actionSet.actionSet[0].name)
6866 self.assertEqual(None, actionSet.actionSet[0].preHooks)
6867 self.assertEqual(None, actionSet.actionSet[0].postHooks)
6868 self.assertEqual(isdir, actionSet.actionSet[0].function)
6869 self.assertEqual(100, actionSet.actionSet[1].index)
6870 self.assertEqual("collect", actionSet.actionSet[1].name)
6871 self.assertEqual(None, actionSet.actionSet[1].preHooks)
6872 self.assertEqual(None, actionSet.actionSet[1].postHooks)
6873 self.assertEqual(executeCollect, actionSet.actionSet[1].function)
6874 self.assertEqual(150, actionSet.actionSet[2].index)
6875 self.assertEqual("two", actionSet.actionSet[2].name)
6876 self.assertEqual(None, actionSet.actionSet[2].preHooks)
6877 self.assertEqual(None, actionSet.actionSet[2].postHooks)
6878 self.assertEqual(isfile, actionSet.actionSet[2].function)
6879 self.assertEqual(200, actionSet.actionSet[3].index)
6880 self.assertEqual("stage", actionSet.actionSet[3].name)
6881 self.assertEqual(None, actionSet.actionSet[3].preHooks)
6882 self.assertEqual(None, actionSet.actionSet[3].postHooks)
6883 self.assertEqual(executeStage, actionSet.actionSet[3].function)
6884 self.assertEqual(250, actionSet.actionSet[4].index)
6885 self.assertEqual("three", actionSet.actionSet[4].name)
6886 self.assertEqual(None, actionSet.actionSet[4].preHooks)
6887 self.assertEqual(None, actionSet.actionSet[4].postHooks)
6888 self.assertEqual(islink, actionSet.actionSet[4].function)
6889 self.assertEqual(300, actionSet.actionSet[5].index)
6890 self.assertEqual("store", actionSet.actionSet[5].name)
6891 self.assertEqual(None, actionSet.actionSet[5].preHooks)
6892 self.assertEqual(None, actionSet.actionSet[5].postHooks)
6893 self.assertEqual(executeStore, actionSet.actionSet[5].function)
6894 self.assertEqual(350, actionSet.actionSet[6].index)
6895 self.assertEqual("four", actionSet.actionSet[6].name)
6896 self.assertEqual(None, actionSet.actionSet[6].preHooks)
6897 self.assertEqual(None, actionSet.actionSet[6].postHooks)
6898 self.assertEqual(isabs, actionSet.actionSet[6].function)
6899 self.assertEqual(400, actionSet.actionSet[7].index)
6900 self.assertEqual("purge", actionSet.actionSet[7].name)
6901 self.assertEqual(None, actionSet.actionSet[7].preHooks)
6902 self.assertEqual(None, actionSet.actionSet[7].postHooks)
6903 self.assertEqual(executePurge, actionSet.actionSet[7].function)
6904 self.assertEqual(450, actionSet.actionSet[8].index)
6905 self.assertEqual("five", actionSet.actionSet[8].name)
6906 self.assertEqual(None, actionSet.actionSet[8].preHooks)
6907 self.assertEqual(None, actionSet.actionSet[8].postHooks)
6908 self.assertEqual(exists, actionSet.actionSet[8].function)
6909
6910 def testActionSet_107(self):
6911 """
6912 Test with actions=[ one, five, collect, store, three, stage, four, purge, two ], extensions=[ (index 50, 150, 250, 350, 450)].
6913 """
6914 actions = [
6915 "one",
6916 "five",
6917 "collect",
6918 "store",
6919 "three",
6920 "stage",
6921 "four",
6922 "purge",
6923 "two",
6924 ]
6925 extensions = ExtensionsConfig(
6926 [
6927 ExtendedAction("one", "os.path", "isdir", 50),
6928 ExtendedAction("two", "os.path", "isfile", 150),
6929 ExtendedAction("three", "os.path", "islink", 250),
6930 ExtendedAction("four", "os.path", "isabs", 350),
6931 ExtendedAction("five", "os.path", "exists", 450),
6932 ],
6933 None,
6934 )
6935 options = OptionsConfig()
6936 actionSet = _ActionSet(actions, extensions, options, None, False, True)
6937 self.assertTrue(len(actionSet.actionSet) == 9)
6938 self.assertEqual(50, actionSet.actionSet[0].index)
6939 self.assertEqual("one", actionSet.actionSet[0].name)
6940 self.assertEqual(None, actionSet.actionSet[0].preHooks)
6941 self.assertEqual(None, actionSet.actionSet[0].postHooks)
6942 self.assertEqual(isdir, actionSet.actionSet[0].function)
6943 self.assertEqual(100, actionSet.actionSet[1].index)
6944 self.assertEqual("collect", actionSet.actionSet[1].name)
6945 self.assertEqual(None, actionSet.actionSet[1].preHooks)
6946 self.assertEqual(None, actionSet.actionSet[1].postHooks)
6947 self.assertEqual(executeCollect, actionSet.actionSet[1].function)
6948 self.assertEqual(150, actionSet.actionSet[2].index)
6949 self.assertEqual("two", actionSet.actionSet[2].name)
6950 self.assertEqual(None, actionSet.actionSet[2].preHooks)
6951 self.assertEqual(None, actionSet.actionSet[2].postHooks)
6952 self.assertEqual(isfile, actionSet.actionSet[2].function)
6953 self.assertEqual(200, actionSet.actionSet[3].index)
6954 self.assertEqual("stage", actionSet.actionSet[3].name)
6955 self.assertEqual(None, actionSet.actionSet[3].preHooks)
6956 self.assertEqual(None, actionSet.actionSet[3].postHooks)
6957 self.assertEqual(executeStage, actionSet.actionSet[3].function)
6958 self.assertEqual(250, actionSet.actionSet[4].index)
6959 self.assertEqual("three", actionSet.actionSet[4].name)
6960 self.assertEqual(None, actionSet.actionSet[4].preHooks)
6961 self.assertEqual(None, actionSet.actionSet[4].postHooks)
6962 self.assertEqual(islink, actionSet.actionSet[4].function)
6963 self.assertEqual(300, actionSet.actionSet[5].index)
6964 self.assertEqual("store", actionSet.actionSet[5].name)
6965 self.assertEqual(None, actionSet.actionSet[5].preHooks)
6966 self.assertEqual(None, actionSet.actionSet[5].postHooks)
6967 self.assertEqual(executeStore, actionSet.actionSet[5].function)
6968 self.assertEqual(350, actionSet.actionSet[6].index)
6969 self.assertEqual("four", actionSet.actionSet[6].name)
6970 self.assertEqual(None, actionSet.actionSet[6].preHooks)
6971 self.assertEqual(None, actionSet.actionSet[6].postHooks)
6972 self.assertEqual(isabs, actionSet.actionSet[6].function)
6973 self.assertEqual(400, actionSet.actionSet[7].index)
6974 self.assertEqual("purge", actionSet.actionSet[7].name)
6975 self.assertEqual(None, actionSet.actionSet[7].preHooks)
6976 self.assertEqual(None, actionSet.actionSet[7].postHooks)
6977 self.assertEqual(executePurge, actionSet.actionSet[7].function)
6978 self.assertEqual(450, actionSet.actionSet[8].index)
6979 self.assertEqual("five", actionSet.actionSet[8].name)
6980 self.assertEqual(None, actionSet.actionSet[8].preHooks)
6981 self.assertEqual(None, actionSet.actionSet[8].postHooks)
6982 self.assertEqual(exists, actionSet.actionSet[8].function)
6983
6984 def testActionSet_108(self):
6985 """
6986 Test with actions=[ one ], extensions=[ (one, index 50) ].
6987 """
6988 actions = [
6989 "one",
6990 ]
6991 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
6992 options = OptionsConfig()
6993 actionSet = _ActionSet(actions, extensions, options, None, False, True)
6994 self.assertTrue(len(actionSet.actionSet) == 1)
6995 self.assertEqual(50, actionSet.actionSet[0].index)
6996 self.assertEqual("one", actionSet.actionSet[0].name)
6997 self.assertEqual(None, actionSet.actionSet[0].preHooks)
6998 self.assertEqual(None, actionSet.actionSet[0].postHooks)
6999 self.assertEqual(isdir, actionSet.actionSet[0].function)
7000
7001 def testActionSet_109(self):
7002 """
7003 Test with actions=[ collect ], extensions=[], hooks=[]
7004 """
7005 actions = [
7006 "collect",
7007 ]
7008 extensions = ExtensionsConfig([], None)
7009 options = OptionsConfig()
7010 options.hooks = []
7011 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7012 self.assertFalse(actionSet.actionSet is None)
7013 self.assertTrue(len(actionSet.actionSet) == 1)
7014 self.assertEqual(100, actionSet.actionSet[0].index)
7015 self.assertEqual("collect", actionSet.actionSet[0].name)
7016 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7017 self.assertEqual(None, actionSet.actionSet[0].postHooks)
7018 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
7019
7020 def testActionSet_110(self):
7021 """
7022 Test with actions=[ collect ], extensions=[], pre-hook on 'stage' action.
7023 """
7024 actions = [
7025 "collect",
7026 ]
7027 extensions = ExtensionsConfig([], None)
7028 options = OptionsConfig()
7029 options.hooks = [PreActionHook("stage", "something")]
7030 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7031 self.assertFalse(actionSet.actionSet is None)
7032 self.assertTrue(len(actionSet.actionSet) == 1)
7033 self.assertEqual(100, actionSet.actionSet[0].index)
7034 self.assertEqual("collect", actionSet.actionSet[0].name)
7035 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7036 self.assertEqual(None, actionSet.actionSet[0].postHooks)
7037 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
7038
7039 def testActionSet_111(self):
7040 """
7041 Test with actions=[ collect ], extensions=[], post-hook on 'stage' action.
7042 """
7043 actions = [
7044 "collect",
7045 ]
7046 extensions = ExtensionsConfig([], None)
7047 options = OptionsConfig()
7048 options.hooks = [PostActionHook("stage", "something")]
7049 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7050 self.assertFalse(actionSet.actionSet is None)
7051 self.assertTrue(len(actionSet.actionSet) == 1)
7052 self.assertEqual(100, actionSet.actionSet[0].index)
7053 self.assertEqual("collect", actionSet.actionSet[0].name)
7054 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7055 self.assertEqual(None, actionSet.actionSet[0].postHooks)
7056 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
7057
7058 def testActionSet_112(self):
7059 """
7060 Test with actions=[ collect ], extensions=[], pre-hook on 'collect' action.
7061 """
7062 actions = [
7063 "collect",
7064 ]
7065 extensions = ExtensionsConfig([], None)
7066 options = OptionsConfig()
7067 options.hooks = [PreActionHook("collect", "something")]
7068 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7069 self.assertFalse(actionSet.actionSet is None)
7070 self.assertTrue(len(actionSet.actionSet) == 1)
7071 self.assertEqual(100, actionSet.actionSet[0].index)
7072 self.assertEqual("collect", actionSet.actionSet[0].name)
7073 self.assertEqual([PreActionHook("collect", "something")], actionSet.actionSet[0].preHooks)
7074 self.assertEqual(None, actionSet.actionSet[0].postHooks)
7075 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
7076
7077 def testActionSet_113(self):
7078 """
7079 Test with actions=[ collect ], extensions=[], post-hook on 'collect' action.
7080 """
7081 actions = [
7082 "collect",
7083 ]
7084 extensions = ExtensionsConfig([], None)
7085 options = OptionsConfig()
7086 options.hooks = [PostActionHook("collect", "something")]
7087 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7088 self.assertFalse(actionSet.actionSet is None)
7089 self.assertTrue(len(actionSet.actionSet) == 1)
7090 self.assertEqual(100, actionSet.actionSet[0].index)
7091 self.assertEqual("collect", actionSet.actionSet[0].name)
7092 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7093 self.assertEqual([PostActionHook("collect", "something")], actionSet.actionSet[0].postHooks)
7094 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
7095
7096 def testActionSet_114(self):
7097 """
7098 Test with actions=[ collect ], extensions=[], pre- and post-hook on 'collect' action.
7099 """
7100 actions = [
7101 "collect",
7102 ]
7103 extensions = ExtensionsConfig([], None)
7104 options = OptionsConfig()
7105 options.hooks = [PreActionHook("collect", "something1"), PostActionHook("collect", "something2")]
7106 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7107 self.assertFalse(actionSet.actionSet is None)
7108 self.assertTrue(len(actionSet.actionSet) == 1)
7109 self.assertEqual(100, actionSet.actionSet[0].index)
7110 self.assertEqual("collect", actionSet.actionSet[0].name)
7111 self.assertEqual([PreActionHook("collect", "something1")], actionSet.actionSet[0].preHooks)
7112 self.assertEqual([PostActionHook("collect", "something2")], actionSet.actionSet[0].postHooks)
7113 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
7114
7115 def testActionSet_115(self):
7116 """
7117 Test with actions=[ one ], extensions=[ (one, index 50) ], hooks=[]
7118 """
7119 actions = [
7120 "one",
7121 ]
7122 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
7123 options = OptionsConfig()
7124 options.hooks = []
7125 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7126 self.assertTrue(len(actionSet.actionSet) == 1)
7127 self.assertEqual(50, actionSet.actionSet[0].index)
7128 self.assertEqual("one", actionSet.actionSet[0].name)
7129 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7130 self.assertEqual(None, actionSet.actionSet[0].postHooks)
7131 self.assertEqual(isdir, actionSet.actionSet[0].function)
7132
7133 def testActionSet_116(self):
7134 """
7135 Test with actions=[ one ], extensions=[ (one, index 50) ], pre-hook on "store" action.
7136 """
7137 actions = [
7138 "one",
7139 ]
7140 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
7141 options = OptionsConfig()
7142 options.hooks = [
7143 PreActionHook("store", "whatever"),
7144 ]
7145 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7146 self.assertTrue(len(actionSet.actionSet) == 1)
7147 self.assertEqual(50, actionSet.actionSet[0].index)
7148 self.assertEqual("one", actionSet.actionSet[0].name)
7149 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7150 self.assertEqual(None, actionSet.actionSet[0].postHooks)
7151 self.assertEqual(isdir, actionSet.actionSet[0].function)
7152
7153 def testActionSet_117(self):
7154 """
7155 Test with actions=[ one ], extensions=[ (one, index 50) ], post-hook on "store" action.
7156 """
7157 actions = [
7158 "one",
7159 ]
7160 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
7161 options = OptionsConfig()
7162 options.hooks = [
7163 PostActionHook("store", "whatever"),
7164 ]
7165 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7166 self.assertTrue(len(actionSet.actionSet) == 1)
7167 self.assertEqual(50, actionSet.actionSet[0].index)
7168 self.assertEqual("one", actionSet.actionSet[0].name)
7169 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7170 self.assertEqual(None, actionSet.actionSet[0].postHooks)
7171 self.assertEqual(isdir, actionSet.actionSet[0].function)
7172
7173 def testActionSet_118(self):
7174 """
7175 Test with actions=[ one ], extensions=[ (one, index 50) ], pre-hook on "one" action.
7176 """
7177 actions = [
7178 "one",
7179 ]
7180 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
7181 options = OptionsConfig()
7182 options.hooks = [
7183 PreActionHook("one", "extension"),
7184 ]
7185 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7186 self.assertTrue(len(actionSet.actionSet) == 1)
7187 self.assertEqual(50, actionSet.actionSet[0].index)
7188 self.assertEqual("one", actionSet.actionSet[0].name)
7189 self.assertEqual([PreActionHook("one", "extension")], actionSet.actionSet[0].preHooks)
7190 self.assertEqual(None, actionSet.actionSet[0].postHooks)
7191 self.assertEqual(isdir, actionSet.actionSet[0].function)
7192
7193 def testActionSet_119(self):
7194 """
7195 Test with actions=[ one ], extensions=[ (one, index 50) ], post-hook on "one" action.
7196 """
7197 actions = [
7198 "one",
7199 ]
7200 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
7201 options = OptionsConfig()
7202 options.hooks = [
7203 PostActionHook("one", "extension"),
7204 ]
7205 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7206 self.assertTrue(len(actionSet.actionSet) == 1)
7207 self.assertEqual(50, actionSet.actionSet[0].index)
7208 self.assertEqual("one", actionSet.actionSet[0].name)
7209 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7210 self.assertEqual([PostActionHook("one", "extension")], actionSet.actionSet[0].postHooks)
7211 self.assertEqual(isdir, actionSet.actionSet[0].function)
7212
7213 def testActionSet_120(self):
7214 """
7215 Test with actions=[ one ], extensions=[ (one, index 50) ], pre- and post-hook on "one" action.
7216 """
7217 actions = [
7218 "one",
7219 ]
7220 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
7221 options = OptionsConfig()
7222 options.hooks = [
7223 PostActionHook("one", "extension2"),
7224 PreActionHook("one", "extension1"),
7225 ]
7226 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7227 self.assertTrue(len(actionSet.actionSet) == 1)
7228 self.assertEqual(50, actionSet.actionSet[0].index)
7229 self.assertEqual("one", actionSet.actionSet[0].name)
7230 self.assertEqual([PreActionHook("one", "extension1")], actionSet.actionSet[0].preHooks)
7231 self.assertEqual([PostActionHook("one", "extension2")], actionSet.actionSet[0].postHooks)
7232 self.assertEqual(isdir, actionSet.actionSet[0].function)
7233
7234 def testActionSet_121(self):
7235 """
7236 Test with actions=[ collect, one ], extensions=[ (one, index 50) ], hooks=[]
7237 """
7238 actions = [
7239 "collect",
7240 "one",
7241 ]
7242 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
7243 options = OptionsConfig()
7244 options.hooks = []
7245 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7246 self.assertTrue(len(actionSet.actionSet) == 2)
7247 self.assertEqual(50, actionSet.actionSet[0].index)
7248 self.assertEqual("one", actionSet.actionSet[0].name)
7249 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7250 self.assertEqual(None, actionSet.actionSet[0].postHooks)
7251 self.assertEqual(isdir, actionSet.actionSet[0].function)
7252 self.assertEqual(100, actionSet.actionSet[1].index)
7253 self.assertEqual("collect", actionSet.actionSet[1].name)
7254 self.assertEqual(None, actionSet.actionSet[1].preHooks)
7255 self.assertEqual(None, actionSet.actionSet[1].postHooks)
7256 self.assertEqual(executeCollect, actionSet.actionSet[1].function)
7257
7258 def testActionSet_122(self):
7259 """
7260 Test with actions=[ collect, one ], extensions=[ (one, index 50) ], pre-hook on "purge" action
7261 """
7262 actions = [
7263 "collect",
7264 "one",
7265 ]
7266 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
7267 options = OptionsConfig()
7268 options.hooks = [
7269 PreActionHook("purge", "rm -f"),
7270 ]
7271 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7272 self.assertTrue(len(actionSet.actionSet) == 2)
7273 self.assertEqual(50, actionSet.actionSet[0].index)
7274 self.assertEqual("one", actionSet.actionSet[0].name)
7275 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7276 self.assertEqual(None, actionSet.actionSet[0].postHooks)
7277 self.assertEqual(isdir, actionSet.actionSet[0].function)
7278 self.assertEqual(100, actionSet.actionSet[1].index)
7279 self.assertEqual("collect", actionSet.actionSet[1].name)
7280 self.assertEqual(None, actionSet.actionSet[1].preHooks)
7281 self.assertEqual(None, actionSet.actionSet[1].postHooks)
7282 self.assertEqual(executeCollect, actionSet.actionSet[1].function)
7283
7284 def testActionSet_123(self):
7285 """
7286 Test with actions=[ collect, one ], extensions=[ (one, index 50) ], post-hook on "purge" action
7287 """
7288 actions = [
7289 "collect",
7290 "one",
7291 ]
7292 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
7293 options = OptionsConfig()
7294 options.hooks = [
7295 PostActionHook("purge", "rm -f"),
7296 ]
7297 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7298 self.assertTrue(len(actionSet.actionSet) == 2)
7299 self.assertEqual(50, actionSet.actionSet[0].index)
7300 self.assertEqual("one", actionSet.actionSet[0].name)
7301 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7302 self.assertEqual(None, actionSet.actionSet[0].postHooks)
7303 self.assertEqual(isdir, actionSet.actionSet[0].function)
7304 self.assertEqual(100, actionSet.actionSet[1].index)
7305 self.assertEqual("collect", actionSet.actionSet[1].name)
7306 self.assertEqual(None, actionSet.actionSet[1].preHooks)
7307 self.assertEqual(None, actionSet.actionSet[1].postHooks)
7308 self.assertEqual(executeCollect, actionSet.actionSet[1].function)
7309
7310 def testActionSet_124(self):
7311 """
7312 Test with actions=[ collect, one ], extensions=[ (one, index 50) ], pre-hook on "collect" action
7313 """
7314 actions = [
7315 "collect",
7316 "one",
7317 ]
7318 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
7319 options = OptionsConfig()
7320 options.hooks = [
7321 PreActionHook("collect", "something"),
7322 ]
7323 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7324 self.assertTrue(len(actionSet.actionSet) == 2)
7325 self.assertEqual(50, actionSet.actionSet[0].index)
7326 self.assertEqual("one", actionSet.actionSet[0].name)
7327 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7328 self.assertEqual(None, actionSet.actionSet[0].postHooks)
7329 self.assertEqual(isdir, actionSet.actionSet[0].function)
7330 self.assertEqual(100, actionSet.actionSet[1].index)
7331 self.assertEqual("collect", actionSet.actionSet[1].name)
7332 self.assertEqual([PreActionHook("collect", "something")], actionSet.actionSet[1].preHooks)
7333 self.assertEqual(None, actionSet.actionSet[1].postHooks)
7334 self.assertEqual(executeCollect, actionSet.actionSet[1].function)
7335
7336 def testActionSet_125(self):
7337 """
7338 Test with actions=[ collect, one ], extensions=[ (one, index 50) ], post-hook on "collect" action
7339 """
7340 actions = [
7341 "collect",
7342 "one",
7343 ]
7344 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
7345 options = OptionsConfig()
7346 options.hooks = [
7347 PostActionHook("collect", "something"),
7348 ]
7349 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7350 self.assertTrue(len(actionSet.actionSet) == 2)
7351 self.assertEqual(50, actionSet.actionSet[0].index)
7352 self.assertEqual("one", actionSet.actionSet[0].name)
7353 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7354 self.assertEqual(None, actionSet.actionSet[0].postHooks)
7355 self.assertEqual(isdir, actionSet.actionSet[0].function)
7356 self.assertEqual(100, actionSet.actionSet[1].index)
7357 self.assertEqual("collect", actionSet.actionSet[1].name)
7358 self.assertEqual(None, actionSet.actionSet[1].preHooks)
7359 self.assertEqual([PostActionHook("collect", "something")], actionSet.actionSet[1].postHooks)
7360 self.assertEqual(executeCollect, actionSet.actionSet[1].function)
7361
7362 def testActionSet_126(self):
7363 """
7364 Test with actions=[ collect, one ], extensions=[ (one, index 50) ], pre-hook on "one" action
7365 """
7366 actions = [
7367 "collect",
7368 "one",
7369 ]
7370 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
7371 options = OptionsConfig()
7372 options.hooks = [
7373 PreActionHook("one", "extension"),
7374 ]
7375 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7376 self.assertTrue(len(actionSet.actionSet) == 2)
7377 self.assertEqual(50, actionSet.actionSet[0].index)
7378 self.assertEqual("one", actionSet.actionSet[0].name)
7379 self.assertEqual([PreActionHook("one", "extension")], actionSet.actionSet[0].preHooks)
7380 self.assertEqual(None, actionSet.actionSet[0].postHooks)
7381 self.assertEqual(isdir, actionSet.actionSet[0].function)
7382 self.assertEqual(100, actionSet.actionSet[1].index)
7383 self.assertEqual("collect", actionSet.actionSet[1].name)
7384 self.assertEqual(None, actionSet.actionSet[1].preHooks)
7385 self.assertEqual(None, actionSet.actionSet[1].postHooks)
7386 self.assertEqual(executeCollect, actionSet.actionSet[1].function)
7387
7388 def testActionSet_127(self):
7389 """
7390 Test with actions=[ collect, one ], extensions=[ (one, index 50) ], post-hook on "one" action
7391 """
7392 actions = [
7393 "collect",
7394 "one",
7395 ]
7396 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
7397 options = OptionsConfig()
7398 options.hooks = [
7399 PostActionHook("one", "extension"),
7400 ]
7401 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7402 self.assertTrue(len(actionSet.actionSet) == 2)
7403 self.assertEqual(50, actionSet.actionSet[0].index)
7404 self.assertEqual("one", actionSet.actionSet[0].name)
7405 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7406 self.assertEqual([PostActionHook("one", "extension")], actionSet.actionSet[0].postHooks)
7407 self.assertEqual(isdir, actionSet.actionSet[0].function)
7408 self.assertEqual(100, actionSet.actionSet[1].index)
7409 self.assertEqual("collect", actionSet.actionSet[1].name)
7410 self.assertEqual(None, actionSet.actionSet[1].preHooks)
7411 self.assertEqual(None, actionSet.actionSet[1].postHooks)
7412 self.assertEqual(executeCollect, actionSet.actionSet[1].function)
7413
7414 def testActionSet_128(self):
7415 """
7416 Test with actions=[ collect, one ], extensions=[ (one, index 50) ], set of various pre- and post hooks.
7417 """
7418 actions = [
7419 "collect",
7420 "one",
7421 ]
7422 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
7423 options = OptionsConfig()
7424 options.hooks = [
7425 PostActionHook("one", "extension"),
7426 PreActionHook("collect", "something1"),
7427 PreActionHook("collect", "something2"),
7428 PostActionHook("stage", "whatever1"),
7429 PostActionHook("stage", "whatever2"),
7430 ]
7431 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7432 self.assertTrue(len(actionSet.actionSet) == 2)
7433 self.assertEqual(50, actionSet.actionSet[0].index)
7434 self.assertEqual("one", actionSet.actionSet[0].name)
7435 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7436 self.assertEqual([PostActionHook("one", "extension")], actionSet.actionSet[0].postHooks)
7437 self.assertEqual(isdir, actionSet.actionSet[0].function)
7438 self.assertEqual(100, actionSet.actionSet[1].index)
7439 self.assertEqual("collect", actionSet.actionSet[1].name)
7440 self.assertEqual(
7441 [PreActionHook("collect", "something1"), PreActionHook("collect", "something2")], actionSet.actionSet[1].preHooks
7442 )
7443 self.assertEqual(None, actionSet.actionSet[1].postHooks)
7444 self.assertEqual(executeCollect, actionSet.actionSet[1].function)
7445
7446 def testActionSet_129(self):
7447 """
7448 Test with actions=[ stage, one ], extensions=[ (one, index 50) ], set of various pre- and post hooks.
7449 """
7450 actions = [
7451 "stage",
7452 "one",
7453 ]
7454 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
7455 options = OptionsConfig()
7456 options.hooks = [
7457 PostActionHook("one", "extension"),
7458 PreActionHook("collect", "something1"),
7459 PreActionHook("collect", "something2"),
7460 PostActionHook("stage", "whatever1"),
7461 PostActionHook("stage", "whatever2"),
7462 ]
7463 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7464 self.assertTrue(len(actionSet.actionSet) == 2)
7465 self.assertEqual(50, actionSet.actionSet[0].index)
7466 self.assertEqual("one", actionSet.actionSet[0].name)
7467 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7468 self.assertEqual([PostActionHook("one", "extension")], actionSet.actionSet[0].postHooks)
7469 self.assertEqual(isdir, actionSet.actionSet[0].function)
7470 self.assertEqual(200, actionSet.actionSet[1].index)
7471 self.assertEqual("stage", actionSet.actionSet[1].name)
7472 self.assertEqual(None, actionSet.actionSet[1].preHooks)
7473 self.assertEqual(
7474 [PostActionHook("stage", "whatever1"), PostActionHook("stage", "whatever2")], actionSet.actionSet[1].postHooks
7475 )
7476 self.assertEqual(executeStage, actionSet.actionSet[1].function)
7477
7478 ############################################
7479 # Test constructor, "dependency" order mode
7480 ############################################
7481
7482 def testDependencyMode_001(self):
7483 """
7484 Test with actions=None, extensions=None.
7485 """
7486 actions = None
7487 extensions = ExtensionsConfig(None, "dependency")
7488 options = OptionsConfig()
7489 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
7490
7491 def testDependencyMode_002(self):
7492 """
7493 Test with actions=[], extensions=None.
7494 """
7495 actions = []
7496 extensions = ExtensionsConfig(None, "dependency")
7497 options = OptionsConfig()
7498 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
7499
7500 def testDependencyMode_003(self):
7501 """
7502 Test with actions=[], extensions=[].
7503 """
7504 actions = []
7505 extensions = ExtensionsConfig([], "dependency")
7506 options = OptionsConfig()
7507 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
7508
7509 def testDependencyMode_004(self):
7510 """
7511 Test with actions=[ collect ], extensions=[].
7512 """
7513 actions = [
7514 "collect",
7515 ]
7516 extensions = ExtensionsConfig([], "dependency")
7517 options = OptionsConfig()
7518 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7519 self.assertFalse(actionSet.actionSet is None)
7520 self.assertTrue(len(actionSet.actionSet) == 1)
7521 self.assertEqual(100, actionSet.actionSet[0].index)
7522 self.assertEqual("collect", actionSet.actionSet[0].name)
7523 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7524 self.assertEqual(None, actionSet.actionSet[0].postHooks)
7525 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
7526
7527 def testDependencyMode_005(self):
7528 """
7529 Test with actions=[ stage ], extensions=[].
7530 """
7531 actions = [
7532 "stage",
7533 ]
7534 extensions = ExtensionsConfig([], "dependency")
7535 options = OptionsConfig()
7536 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7537 self.assertFalse(actionSet.actionSet is None)
7538 self.assertTrue(len(actionSet.actionSet) == 1)
7539 self.assertEqual(200, actionSet.actionSet[0].index)
7540 self.assertEqual("stage", actionSet.actionSet[0].name)
7541 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7542 self.assertEqual(None, actionSet.actionSet[0].postHooks)
7543 self.assertEqual(executeStage, actionSet.actionSet[0].function)
7544
7545 def testDependencyMode_006(self):
7546 """
7547 Test with actions=[ store ], extensions=[].
7548 """
7549 actions = [
7550 "store",
7551 ]
7552 extensions = ExtensionsConfig([], "dependency")
7553 options = OptionsConfig()
7554 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7555 self.assertFalse(actionSet.actionSet is None)
7556 self.assertTrue(len(actionSet.actionSet) == 1)
7557 self.assertEqual(300, actionSet.actionSet[0].index)
7558 self.assertEqual("store", actionSet.actionSet[0].name)
7559 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7560 self.assertEqual(None, actionSet.actionSet[0].postHooks)
7561 self.assertEqual(executeStore, actionSet.actionSet[0].function)
7562
7563 def testDependencyMode_007(self):
7564 """
7565 Test with actions=[ purge ], extensions=[].
7566 """
7567 actions = [
7568 "purge",
7569 ]
7570 extensions = ExtensionsConfig([], "dependency")
7571 options = OptionsConfig()
7572 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7573 self.assertFalse(actionSet.actionSet is None)
7574 self.assertTrue(len(actionSet.actionSet) == 1)
7575 self.assertEqual(400, actionSet.actionSet[0].index)
7576 self.assertEqual("purge", actionSet.actionSet[0].name)
7577 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7578 self.assertEqual(None, actionSet.actionSet[0].postHooks)
7579 self.assertEqual(executePurge, actionSet.actionSet[0].function)
7580
7581 def testDependencyMode_008(self):
7582 """
7583 Test with actions=[ all ], extensions=[].
7584 """
7585 actions = [
7586 "all",
7587 ]
7588 extensions = ExtensionsConfig([], "dependency")
7589 options = OptionsConfig()
7590 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7591 self.assertFalse(actionSet.actionSet is None)
7592 self.assertTrue(len(actionSet.actionSet) == 4)
7593 self.assertEqual(100, actionSet.actionSet[0].index)
7594 self.assertEqual("collect", actionSet.actionSet[0].name)
7595 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7596 self.assertEqual(None, actionSet.actionSet[0].postHooks)
7597 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
7598 self.assertEqual(200, actionSet.actionSet[1].index)
7599 self.assertEqual("stage", actionSet.actionSet[1].name)
7600 self.assertEqual(None, actionSet.actionSet[1].preHooks)
7601 self.assertEqual(None, actionSet.actionSet[1].postHooks)
7602 self.assertEqual(executeStage, actionSet.actionSet[1].function)
7603 self.assertEqual(300, actionSet.actionSet[2].index)
7604 self.assertEqual("store", actionSet.actionSet[2].name)
7605 self.assertEqual(None, actionSet.actionSet[2].preHooks)
7606 self.assertEqual(None, actionSet.actionSet[2].postHooks)
7607 self.assertEqual(executeStore, actionSet.actionSet[2].function)
7608 self.assertEqual(400, actionSet.actionSet[3].index)
7609 self.assertEqual("purge", actionSet.actionSet[3].name)
7610 self.assertEqual(None, actionSet.actionSet[3].preHooks)
7611 self.assertEqual(None, actionSet.actionSet[3].postHooks)
7612 self.assertEqual(executePurge, actionSet.actionSet[3].function)
7613
7614 def testDependencyMode_009(self):
7615 """
7616 Test with actions=[ rebuild ], extensions=[].
7617 """
7618 actions = [
7619 "rebuild",
7620 ]
7621 extensions = ExtensionsConfig([], "dependency")
7622 options = OptionsConfig()
7623 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7624 self.assertTrue(len(actionSet.actionSet) == 1)
7625 self.assertEqual(0, actionSet.actionSet[0].index)
7626 self.assertEqual("rebuild", actionSet.actionSet[0].name)
7627 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7628 self.assertEqual(None, actionSet.actionSet[0].postHooks)
7629 self.assertEqual(executeRebuild, actionSet.actionSet[0].function)
7630
7631 def testDependencyMode_010(self):
7632 """
7633 Test with actions=[ validate ], extensions=[].
7634 """
7635 actions = [
7636 "validate",
7637 ]
7638 extensions = ExtensionsConfig([], "dependency")
7639 options = OptionsConfig()
7640 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7641 self.assertTrue(len(actionSet.actionSet) == 1)
7642 self.assertEqual(0, actionSet.actionSet[0].index)
7643 self.assertEqual("validate", actionSet.actionSet[0].name)
7644 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7645 self.assertEqual(None, actionSet.actionSet[0].postHooks)
7646 self.assertEqual(executeValidate, actionSet.actionSet[0].function)
7647
7648 def testDependencyMode_011(self):
7649 """
7650 Test with actions=[ collect, collect ], extensions=[].
7651 """
7652 actions = [
7653 "collect",
7654 "collect",
7655 ]
7656 extensions = ExtensionsConfig([], "dependency")
7657 options = OptionsConfig()
7658 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7659 self.assertTrue(len(actionSet.actionSet) == 2)
7660 self.assertEqual(100, actionSet.actionSet[0].index)
7661 self.assertEqual("collect", actionSet.actionSet[0].name)
7662 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7663 self.assertEqual(None, actionSet.actionSet[0].postHooks)
7664 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
7665 self.assertEqual(100, actionSet.actionSet[1].index)
7666 self.assertEqual("collect", actionSet.actionSet[0].name)
7667 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7668 self.assertEqual(None, actionSet.actionSet[0].postHooks)
7669 self.assertEqual(executeCollect, actionSet.actionSet[1].function)
7670
7671 def testDependencyMode_012(self):
7672 """
7673 Test with actions=[ collect, stage ], extensions=[].
7674 """
7675 actions = [
7676 "collect",
7677 "stage",
7678 ]
7679 extensions = ExtensionsConfig([], "dependency")
7680 options = OptionsConfig()
7681 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7682 self.assertTrue(len(actionSet.actionSet) == 2)
7683 self.assertEqual(100, actionSet.actionSet[0].index)
7684 self.assertEqual("collect", actionSet.actionSet[0].name)
7685 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7686 self.assertEqual(None, actionSet.actionSet[0].postHooks)
7687 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
7688 self.assertEqual(200, actionSet.actionSet[1].index)
7689 self.assertEqual("stage", actionSet.actionSet[1].name)
7690 self.assertEqual(None, actionSet.actionSet[1].preHooks)
7691 self.assertEqual(None, actionSet.actionSet[1].postHooks)
7692 self.assertEqual(executeStage, actionSet.actionSet[1].function)
7693
7694 def testDependencyMode_013(self):
7695 """
7696 Test with actions=[ collect, store ], extensions=[].
7697 """
7698 actions = [
7699 "collect",
7700 "store",
7701 ]
7702 extensions = ExtensionsConfig([], "dependency")
7703 options = OptionsConfig()
7704 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7705 self.assertTrue(len(actionSet.actionSet) == 2)
7706 self.assertEqual(100, actionSet.actionSet[0].index)
7707 self.assertEqual("collect", actionSet.actionSet[0].name)
7708 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7709 self.assertEqual(None, actionSet.actionSet[0].postHooks)
7710 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
7711 self.assertEqual(300, actionSet.actionSet[1].index)
7712 self.assertEqual("store", actionSet.actionSet[1].name)
7713 self.assertEqual(None, actionSet.actionSet[1].preHooks)
7714 self.assertEqual(None, actionSet.actionSet[1].postHooks)
7715 self.assertEqual(executeStore, actionSet.actionSet[1].function)
7716
7717 def testDependencyMode_014(self):
7718 """
7719 Test with actions=[ collect, purge ], extensions=[].
7720 """
7721 actions = [
7722 "collect",
7723 "purge",
7724 ]
7725 extensions = ExtensionsConfig([], "dependency")
7726 options = OptionsConfig()
7727 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7728 self.assertTrue(len(actionSet.actionSet) == 2)
7729 self.assertEqual(100, actionSet.actionSet[0].index)
7730 self.assertEqual("collect", actionSet.actionSet[0].name)
7731 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7732 self.assertEqual(None, actionSet.actionSet[0].postHooks)
7733 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
7734 self.assertEqual(400, actionSet.actionSet[1].index)
7735 self.assertEqual("purge", actionSet.actionSet[1].name)
7736 self.assertEqual(None, actionSet.actionSet[1].preHooks)
7737 self.assertEqual(None, actionSet.actionSet[1].postHooks)
7738 self.assertEqual(executePurge, actionSet.actionSet[1].function)
7739
7740 def testDependencyMode_015(self):
7741 """
7742 Test with actions=[ collect, all ], extensions=[].
7743 """
7744 actions = [
7745 "collect",
7746 "all",
7747 ]
7748 extensions = ExtensionsConfig([], "dependency")
7749 options = OptionsConfig()
7750 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
7751
7752 def testDependencyMode_016(self):
7753 """
7754 Test with actions=[ collect, rebuild ], extensions=[].
7755 """
7756 actions = [
7757 "collect",
7758 "rebuild",
7759 ]
7760 extensions = ExtensionsConfig([], "dependency")
7761 options = OptionsConfig()
7762 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
7763
7764 def testDependencyMode_017(self):
7765 """
7766 Test with actions=[ collect, validate ], extensions=[].
7767 """
7768 actions = [
7769 "collect",
7770 "validate",
7771 ]
7772 extensions = ExtensionsConfig([], "dependency")
7773 options = OptionsConfig()
7774 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
7775
7776 def testDependencyMode_018(self):
7777 """
7778 Test with actions=[ stage, collect ], extensions=[].
7779 """
7780 actions = [
7781 "stage",
7782 "collect",
7783 ]
7784 extensions = ExtensionsConfig([], "dependency")
7785 options = OptionsConfig()
7786 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7787 self.assertTrue(len(actionSet.actionSet) == 2)
7788 self.assertEqual(100, actionSet.actionSet[0].index)
7789 self.assertEqual("collect", actionSet.actionSet[0].name)
7790 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7791 self.assertEqual(None, actionSet.actionSet[0].postHooks)
7792 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
7793 self.assertEqual(200, actionSet.actionSet[1].index)
7794 self.assertEqual("stage", actionSet.actionSet[1].name)
7795 self.assertEqual(None, actionSet.actionSet[1].preHooks)
7796 self.assertEqual(None, actionSet.actionSet[1].postHooks)
7797 self.assertEqual(executeStage, actionSet.actionSet[1].function)
7798
7799 def testDependencyMode_019(self):
7800 """
7801 Test with actions=[ stage, stage ], extensions=[].
7802 """
7803 actions = [
7804 "stage",
7805 "stage",
7806 ]
7807 extensions = ExtensionsConfig([], "dependency")
7808 options = OptionsConfig()
7809 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7810 self.assertTrue(len(actionSet.actionSet) == 2)
7811 self.assertEqual(200, actionSet.actionSet[0].index)
7812 self.assertEqual("stage", actionSet.actionSet[0].name)
7813 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7814 self.assertEqual(None, actionSet.actionSet[0].postHooks)
7815 self.assertEqual(executeStage, actionSet.actionSet[0].function)
7816 self.assertEqual(200, actionSet.actionSet[1].index)
7817 self.assertEqual("stage", actionSet.actionSet[1].name)
7818 self.assertEqual(None, actionSet.actionSet[1].preHooks)
7819 self.assertEqual(None, actionSet.actionSet[1].postHooks)
7820 self.assertEqual(executeStage, actionSet.actionSet[1].function)
7821
7822 def testDependencyMode_020(self):
7823 """
7824 Test with actions=[ stage, store ], extensions=[].
7825 """
7826 actions = [
7827 "stage",
7828 "store",
7829 ]
7830 extensions = ExtensionsConfig([], "dependency")
7831 options = OptionsConfig()
7832 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7833 self.assertTrue(len(actionSet.actionSet) == 2)
7834 self.assertEqual(200, actionSet.actionSet[0].index)
7835 self.assertEqual("stage", actionSet.actionSet[0].name)
7836 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7837 self.assertEqual(None, actionSet.actionSet[0].postHooks)
7838 self.assertEqual(executeStage, actionSet.actionSet[0].function)
7839 self.assertEqual(300, actionSet.actionSet[1].index)
7840 self.assertEqual("store", actionSet.actionSet[1].name)
7841 self.assertEqual(None, actionSet.actionSet[1].preHooks)
7842 self.assertEqual(None, actionSet.actionSet[1].postHooks)
7843 self.assertEqual(executeStore, actionSet.actionSet[1].function)
7844
7845 def testDependencyMode_021(self):
7846 """
7847 Test with actions=[ stage, purge ], extensions=[].
7848 """
7849 actions = [
7850 "stage",
7851 "purge",
7852 ]
7853 extensions = ExtensionsConfig([], "dependency")
7854 options = OptionsConfig()
7855 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7856 self.assertTrue(len(actionSet.actionSet) == 2)
7857 self.assertEqual(200, actionSet.actionSet[0].index)
7858 self.assertEqual("stage", actionSet.actionSet[0].name)
7859 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7860 self.assertEqual(None, actionSet.actionSet[0].postHooks)
7861 self.assertEqual(executeStage, actionSet.actionSet[0].function)
7862 self.assertEqual(400, actionSet.actionSet[1].index)
7863 self.assertEqual("purge", actionSet.actionSet[1].name)
7864 self.assertEqual(None, actionSet.actionSet[1].preHooks)
7865 self.assertEqual(None, actionSet.actionSet[1].postHooks)
7866 self.assertEqual(executePurge, actionSet.actionSet[1].function)
7867
7868 def testDependencyMode_022(self):
7869 """
7870 Test with actions=[ stage, all ], extensions=[].
7871 """
7872 actions = [
7873 "stage",
7874 "all",
7875 ]
7876 extensions = ExtensionsConfig([], "dependency")
7877 options = OptionsConfig()
7878 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
7879
7880 def testDependencyMode_023(self):
7881 """
7882 Test with actions=[ stage, rebuild ], extensions=[].
7883 """
7884 actions = [
7885 "stage",
7886 "rebuild",
7887 ]
7888 extensions = ExtensionsConfig([], "dependency")
7889 options = OptionsConfig()
7890 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
7891
7892 def testDependencyMode_024(self):
7893 """
7894 Test with actions=[ stage, validate ], extensions=[].
7895 """
7896 actions = [
7897 "stage",
7898 "validate",
7899 ]
7900 extensions = ExtensionsConfig([], "dependency")
7901 options = OptionsConfig()
7902 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
7903
7904 def testDependencyMode_025(self):
7905 """
7906 Test with actions=[ store, collect ], extensions=[].
7907 """
7908 actions = [
7909 "store",
7910 "collect",
7911 ]
7912 extensions = ExtensionsConfig([], "dependency")
7913 options = OptionsConfig()
7914 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7915 self.assertTrue(len(actionSet.actionSet) == 2)
7916 self.assertEqual(100, actionSet.actionSet[0].index)
7917 self.assertEqual("collect", actionSet.actionSet[0].name)
7918 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7919 self.assertEqual(None, actionSet.actionSet[0].postHooks)
7920 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
7921 self.assertEqual(300, actionSet.actionSet[1].index)
7922 self.assertEqual("store", actionSet.actionSet[1].name)
7923 self.assertEqual(None, actionSet.actionSet[1].preHooks)
7924 self.assertEqual(None, actionSet.actionSet[1].postHooks)
7925 self.assertEqual(executeStore, actionSet.actionSet[1].function)
7926
7927 def testDependencyMode_026(self):
7928 """
7929 Test with actions=[ store, stage ], extensions=[].
7930 """
7931 actions = [
7932 "store",
7933 "stage",
7934 ]
7935 extensions = ExtensionsConfig([], "dependency")
7936 options = OptionsConfig()
7937 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7938 self.assertTrue(len(actionSet.actionSet) == 2)
7939 self.assertEqual(200, actionSet.actionSet[0].index)
7940 self.assertEqual("stage", actionSet.actionSet[0].name)
7941 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7942 self.assertEqual(None, actionSet.actionSet[0].postHooks)
7943 self.assertEqual(executeStage, actionSet.actionSet[0].function)
7944 self.assertEqual(300, actionSet.actionSet[1].index)
7945 self.assertEqual("store", actionSet.actionSet[1].name)
7946 self.assertEqual(None, actionSet.actionSet[1].preHooks)
7947 self.assertEqual(None, actionSet.actionSet[1].postHooks)
7948 self.assertEqual(executeStore, actionSet.actionSet[1].function)
7949
7950 def testDependencyMode_027(self):
7951 """
7952 Test with actions=[ store, store ], extensions=[].
7953 """
7954 actions = [
7955 "store",
7956 "store",
7957 ]
7958 extensions = ExtensionsConfig([], "dependency")
7959 options = OptionsConfig()
7960 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7961 self.assertTrue(len(actionSet.actionSet) == 2)
7962 self.assertEqual(300, actionSet.actionSet[0].index)
7963 self.assertEqual("store", actionSet.actionSet[0].name)
7964 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7965 self.assertEqual(None, actionSet.actionSet[0].postHooks)
7966 self.assertEqual(executeStore, actionSet.actionSet[0].function)
7967 self.assertEqual(300, actionSet.actionSet[1].index)
7968 self.assertEqual("store", actionSet.actionSet[1].name)
7969 self.assertEqual(None, actionSet.actionSet[1].preHooks)
7970 self.assertEqual(None, actionSet.actionSet[1].postHooks)
7971 self.assertEqual(executeStore, actionSet.actionSet[1].function)
7972
7973 def testDependencyMode_028(self):
7974 """
7975 Test with actions=[ store, purge ], extensions=[].
7976 """
7977 actions = [
7978 "store",
7979 "purge",
7980 ]
7981 extensions = ExtensionsConfig([], "dependency")
7982 options = OptionsConfig()
7983 actionSet = _ActionSet(actions, extensions, options, None, False, True)
7984 self.assertTrue(len(actionSet.actionSet) == 2)
7985 self.assertEqual(300, actionSet.actionSet[0].index)
7986 self.assertEqual("store", actionSet.actionSet[0].name)
7987 self.assertEqual(None, actionSet.actionSet[0].preHooks)
7988 self.assertEqual(None, actionSet.actionSet[0].postHooks)
7989 self.assertEqual(executeStore, actionSet.actionSet[0].function)
7990 self.assertEqual(400, actionSet.actionSet[1].index)
7991 self.assertEqual("purge", actionSet.actionSet[1].name)
7992 self.assertEqual(None, actionSet.actionSet[1].preHooks)
7993 self.assertEqual(None, actionSet.actionSet[1].postHooks)
7994 self.assertEqual(executePurge, actionSet.actionSet[1].function)
7995
7996 def testDependencyMode_029(self):
7997 """
7998 Test with actions=[ store, all ], extensions=[].
7999 """
8000 actions = [
8001 "store",
8002 "all",
8003 ]
8004 extensions = ExtensionsConfig([], "dependency")
8005 options = OptionsConfig()
8006 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8007
8008 def testDependencyMode_030(self):
8009 """
8010 Test with actions=[ store, rebuild ], extensions=[].
8011 """
8012 actions = [
8013 "store",
8014 "rebuild",
8015 ]
8016 extensions = ExtensionsConfig([], "dependency")
8017 options = OptionsConfig()
8018 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8019
8020 def testDependencyMode_031(self):
8021 """
8022 Test with actions=[ store, validate ], extensions=[].
8023 """
8024 actions = [
8025 "store",
8026 "validate",
8027 ]
8028 extensions = ExtensionsConfig([], "dependency")
8029 options = OptionsConfig()
8030 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8031
8032 def testDependencyMode_032(self):
8033 """
8034 Test with actions=[ purge, collect ], extensions=[].
8035 """
8036 actions = [
8037 "purge",
8038 "collect",
8039 ]
8040 extensions = ExtensionsConfig([], "dependency")
8041 options = OptionsConfig()
8042 actionSet = _ActionSet(actions, extensions, options, None, False, True)
8043 self.assertTrue(len(actionSet.actionSet) == 2)
8044 self.assertEqual(100, actionSet.actionSet[0].index)
8045 self.assertEqual("collect", actionSet.actionSet[0].name)
8046 self.assertEqual(None, actionSet.actionSet[0].preHooks)
8047 self.assertEqual(None, actionSet.actionSet[0].postHooks)
8048 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
8049 self.assertEqual(400, actionSet.actionSet[1].index)
8050 self.assertEqual("purge", actionSet.actionSet[1].name)
8051 self.assertEqual(None, actionSet.actionSet[1].preHooks)
8052 self.assertEqual(None, actionSet.actionSet[1].postHooks)
8053 self.assertEqual(executePurge, actionSet.actionSet[1].function)
8054
8055 def testDependencyMode_033(self):
8056 """
8057 Test with actions=[ purge, stage ], extensions=[].
8058 """
8059 actions = [
8060 "purge",
8061 "stage",
8062 ]
8063 extensions = ExtensionsConfig([], "dependency")
8064 options = OptionsConfig()
8065 actionSet = _ActionSet(actions, extensions, options, None, False, True)
8066 self.assertTrue(len(actionSet.actionSet) == 2)
8067 self.assertEqual(200, actionSet.actionSet[0].index)
8068 self.assertEqual("stage", actionSet.actionSet[0].name)
8069 self.assertEqual(None, actionSet.actionSet[0].preHooks)
8070 self.assertEqual(None, actionSet.actionSet[0].postHooks)
8071 self.assertEqual(executeStage, actionSet.actionSet[0].function)
8072 self.assertEqual(400, actionSet.actionSet[1].index)
8073 self.assertEqual("purge", actionSet.actionSet[1].name)
8074 self.assertEqual(None, actionSet.actionSet[1].preHooks)
8075 self.assertEqual(None, actionSet.actionSet[1].postHooks)
8076 self.assertEqual(executePurge, actionSet.actionSet[1].function)
8077
8078 def testDependencyMode_034(self):
8079 """
8080 Test with actions=[ purge, store ], extensions=[].
8081 """
8082 actions = [
8083 "purge",
8084 "store",
8085 ]
8086 extensions = ExtensionsConfig([], "dependency")
8087 options = OptionsConfig()
8088 actionSet = _ActionSet(actions, extensions, options, None, False, True)
8089 self.assertTrue(len(actionSet.actionSet) == 2)
8090 self.assertEqual(300, actionSet.actionSet[0].index)
8091 self.assertEqual("store", actionSet.actionSet[0].name)
8092 self.assertEqual(None, actionSet.actionSet[0].preHooks)
8093 self.assertEqual(None, actionSet.actionSet[0].postHooks)
8094 self.assertEqual(executeStore, actionSet.actionSet[0].function)
8095 self.assertEqual(400, actionSet.actionSet[1].index)
8096 self.assertEqual("purge", actionSet.actionSet[1].name)
8097 self.assertEqual(None, actionSet.actionSet[1].preHooks)
8098 self.assertEqual(None, actionSet.actionSet[1].postHooks)
8099 self.assertEqual(executePurge, actionSet.actionSet[1].function)
8100
8101 def testDependencyMode_035(self):
8102 """
8103 Test with actions=[ purge, purge ], extensions=[].
8104 """
8105 actions = [
8106 "purge",
8107 "purge",
8108 ]
8109 extensions = ExtensionsConfig([], "dependency")
8110 options = OptionsConfig()
8111 actionSet = _ActionSet(actions, extensions, options, None, False, True)
8112 self.assertTrue(len(actionSet.actionSet) == 2)
8113 self.assertEqual(400, actionSet.actionSet[0].index)
8114 self.assertEqual("purge", actionSet.actionSet[0].name)
8115 self.assertEqual(None, actionSet.actionSet[0].preHooks)
8116 self.assertEqual(None, actionSet.actionSet[0].postHooks)
8117 self.assertEqual(executePurge, actionSet.actionSet[0].function)
8118 self.assertEqual(400, actionSet.actionSet[1].index)
8119 self.assertEqual("purge", actionSet.actionSet[1].name)
8120 self.assertEqual(None, actionSet.actionSet[1].preHooks)
8121 self.assertEqual(None, actionSet.actionSet[1].postHooks)
8122 self.assertEqual(executePurge, actionSet.actionSet[1].function)
8123
8124 def testDependencyMode_036(self):
8125 """
8126 Test with actions=[ purge, all ], extensions=[].
8127 """
8128 actions = [
8129 "purge",
8130 "all",
8131 ]
8132 extensions = ExtensionsConfig([], "dependency")
8133 options = OptionsConfig()
8134 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8135
8136 def testDependencyMode_037(self):
8137 """
8138 Test with actions=[ purge, rebuild ], extensions=[].
8139 """
8140 actions = [
8141 "purge",
8142 "rebuild",
8143 ]
8144 extensions = ExtensionsConfig([], "dependency")
8145 options = OptionsConfig()
8146 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8147
8148 def testDependencyMode_038(self):
8149 """
8150 Test with actions=[ purge, validate ], extensions=[].
8151 """
8152 actions = [
8153 "purge",
8154 "validate",
8155 ]
8156 extensions = ExtensionsConfig([], "dependency")
8157 options = OptionsConfig()
8158 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8159
8160 def testDependencyMode_039(self):
8161 """
8162 Test with actions=[ all, collect ], extensions=[].
8163 """
8164 actions = [
8165 "all",
8166 "collect",
8167 ]
8168 extensions = ExtensionsConfig([], "dependency")
8169 options = OptionsConfig()
8170 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8171
8172 def testDependencyMode_040(self):
8173 """
8174 Test with actions=[ all, stage ], extensions=[].
8175 """
8176 actions = [
8177 "all",
8178 "stage",
8179 ]
8180 extensions = ExtensionsConfig([], "dependency")
8181 options = OptionsConfig()
8182 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8183
8184 def testDependencyMode_041(self):
8185 """
8186 Test with actions=[ all, store ], extensions=[].
8187 """
8188 actions = [
8189 "all",
8190 "store",
8191 ]
8192 extensions = ExtensionsConfig([], "dependency")
8193 options = OptionsConfig()
8194 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8195
8196 def testDependencyMode_042(self):
8197 """
8198 Test with actions=[ all, purge ], extensions=[].
8199 """
8200 actions = [
8201 "all",
8202 "purge",
8203 ]
8204 extensions = ExtensionsConfig([], "dependency")
8205 options = OptionsConfig()
8206 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8207
8208 def testDependencyMode_043(self):
8209 """
8210 Test with actions=[ all, all ], extensions=[].
8211 """
8212 actions = [
8213 "all",
8214 "all",
8215 ]
8216 extensions = ExtensionsConfig([], "dependency")
8217 options = OptionsConfig()
8218 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8219
8220 def testDependencyMode_044(self):
8221 """
8222 Test with actions=[ all, rebuild ], extensions=[].
8223 """
8224 actions = [
8225 "all",
8226 "rebuild",
8227 ]
8228 extensions = ExtensionsConfig([], "dependency")
8229 options = OptionsConfig()
8230 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8231
8232 def testDependencyMode_045(self):
8233 """
8234 Test with actions=[ all, validate ], extensions=[].
8235 """
8236 actions = [
8237 "all",
8238 "validate",
8239 ]
8240 extensions = ExtensionsConfig([], "dependency")
8241 options = OptionsConfig()
8242 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8243
8244 def testDependencyMode_046(self):
8245 """
8246 Test with actions=[ rebuild, collect ], extensions=[].
8247 """
8248 actions = [
8249 "rebuild",
8250 "collect",
8251 ]
8252 extensions = ExtensionsConfig([], "dependency")
8253 options = OptionsConfig()
8254 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8255
8256 def testDependencyMode_047(self):
8257 """
8258 Test with actions=[ rebuild, stage ], extensions=[].
8259 """
8260 actions = [
8261 "rebuild",
8262 "stage",
8263 ]
8264 extensions = ExtensionsConfig([], "dependency")
8265 options = OptionsConfig()
8266 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8267
8268 def testDependencyMode_048(self):
8269 """
8270 Test with actions=[ rebuild, store ], extensions=[].
8271 """
8272 actions = [
8273 "rebuild",
8274 "store",
8275 ]
8276 extensions = ExtensionsConfig([], "dependency")
8277 options = OptionsConfig()
8278 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8279
8280 def testDependencyMode_049(self):
8281 """
8282 Test with actions=[ rebuild, purge ], extensions=[].
8283 """
8284 actions = [
8285 "rebuild",
8286 "purge",
8287 ]
8288 extensions = ExtensionsConfig([], "dependency")
8289 options = OptionsConfig()
8290 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8291
8292 def testDependencyMode_050(self):
8293 """
8294 Test with actions=[ rebuild, all ], extensions=[].
8295 """
8296 actions = [
8297 "rebuild",
8298 "all",
8299 ]
8300 extensions = ExtensionsConfig([], "dependency")
8301 options = OptionsConfig()
8302 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8303
8304 def testDependencyMode_051(self):
8305 """
8306 Test with actions=[ rebuild, rebuild ], extensions=[].
8307 """
8308 actions = [
8309 "rebuild",
8310 "rebuild",
8311 ]
8312 extensions = ExtensionsConfig([], "dependency")
8313 options = OptionsConfig()
8314 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8315
8316 def testDependencyMode_052(self):
8317 """
8318 Test with actions=[ rebuild, validate ], extensions=[].
8319 """
8320 actions = [
8321 "rebuild",
8322 "validate",
8323 ]
8324 extensions = ExtensionsConfig([], "dependency")
8325 options = OptionsConfig()
8326 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8327
8328 def testDependencyMode_053(self):
8329 """
8330 Test with actions=[ validate, collect ], extensions=[].
8331 """
8332 actions = [
8333 "validate",
8334 "collect",
8335 ]
8336 extensions = ExtensionsConfig([], "dependency")
8337 options = OptionsConfig()
8338 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8339
8340 def testDependencyMode_054(self):
8341 """
8342 Test with actions=[ validate, stage ], extensions=[].
8343 """
8344 actions = [
8345 "validate",
8346 "stage",
8347 ]
8348 extensions = ExtensionsConfig([], "dependency")
8349 options = OptionsConfig()
8350 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8351
8352 def testDependencyMode_055(self):
8353 """
8354 Test with actions=[ validate, store ], extensions=[].
8355 """
8356 actions = [
8357 "validate",
8358 "store",
8359 ]
8360 extensions = ExtensionsConfig([], "dependency")
8361 options = OptionsConfig()
8362 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8363
8364 def testDependencyMode_056(self):
8365 """
8366 Test with actions=[ validate, purge ], extensions=[].
8367 """
8368 actions = [
8369 "validate",
8370 "purge",
8371 ]
8372 extensions = ExtensionsConfig([], "dependency")
8373 options = OptionsConfig()
8374 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8375
8376 def testDependencyMode_057(self):
8377 """
8378 Test with actions=[ validate, all ], extensions=[].
8379 """
8380 actions = [
8381 "validate",
8382 "all",
8383 ]
8384 extensions = ExtensionsConfig([], "dependency")
8385 options = OptionsConfig()
8386 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8387
8388 def testDependencyMode_058(self):
8389 """
8390 Test with actions=[ validate, rebuild ], extensions=[].
8391 """
8392 actions = [
8393 "validate",
8394 "rebuild",
8395 ]
8396 extensions = ExtensionsConfig([], "dependency")
8397 options = OptionsConfig()
8398 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8399
8400 def testDependencyMode_059(self):
8401 """
8402 Test with actions=[ validate, validate ], extensions=[].
8403 """
8404 actions = [
8405 "validate",
8406 "validate",
8407 ]
8408 extensions = ExtensionsConfig([], "dependency")
8409 options = OptionsConfig()
8410 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8411
8412 def testDependencyMode_060(self):
8413 """
8414 Test with actions=[ bogus ], extensions=[].
8415 """
8416 actions = [
8417 "bogus",
8418 ]
8419 extensions = ExtensionsConfig([], "dependency")
8420 options = OptionsConfig()
8421 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8422
8423 def testDependencyMode_061(self):
8424 """
8425 Test with actions=[ bogus, collect ], extensions=[].
8426 """
8427 actions = [
8428 "bogus",
8429 "collect",
8430 ]
8431 extensions = ExtensionsConfig([], "dependency")
8432 options = OptionsConfig()
8433 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8434
8435 def testDependencyMode_062(self):
8436 """
8437 Test with actions=[ bogus, stage ], extensions=[].
8438 """
8439 actions = [
8440 "bogus",
8441 "stage",
8442 ]
8443 extensions = ExtensionsConfig([], "dependency")
8444 options = OptionsConfig()
8445 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8446
8447 def testDependencyMode_063(self):
8448 """
8449 Test with actions=[ bogus, store ], extensions=[].
8450 """
8451 actions = [
8452 "bogus",
8453 "store",
8454 ]
8455 extensions = ExtensionsConfig([], "dependency")
8456 options = OptionsConfig()
8457 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8458
8459 def testDependencyMode_064(self):
8460 """
8461 Test with actions=[ bogus, purge ], extensions=[].
8462 """
8463 actions = [
8464 "bogus",
8465 "purge",
8466 ]
8467 extensions = ExtensionsConfig([], "dependency")
8468 options = OptionsConfig()
8469 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8470
8471 def testDependencyMode_065(self):
8472 """
8473 Test with actions=[ bogus, all ], extensions=[].
8474 """
8475 actions = [
8476 "bogus",
8477 "all",
8478 ]
8479 extensions = ExtensionsConfig([], "dependency")
8480 options = OptionsConfig()
8481 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8482
8483 def testDependencyMode_066(self):
8484 """
8485 Test with actions=[ bogus, rebuild ], extensions=[].
8486 """
8487 actions = [
8488 "bogus",
8489 "rebuild",
8490 ]
8491 extensions = ExtensionsConfig([], "dependency")
8492 options = OptionsConfig()
8493 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8494
8495 def testDependencyMode_067(self):
8496 """
8497 Test with actions=[ bogus, validate ], extensions=[].
8498 """
8499 actions = [
8500 "bogus",
8501 "validate",
8502 ]
8503 extensions = ExtensionsConfig([], "dependency")
8504 options = OptionsConfig()
8505 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8506
8507 def testDependencyMode_068(self):
8508 """
8509 Test with actions=[ collect, one ], extensions=[ (one, before collect) ].
8510 """
8511 actions = [
8512 "collect",
8513 "one",
8514 ]
8515 dependencies = ActionDependencies(["collect"], [])
8516 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
8517 options = OptionsConfig()
8518 actionSet = _ActionSet(actions, extensions, options, None, False, True)
8519 self.assertTrue(len(actionSet.actionSet) == 2)
8520 self.assertEqual("one", actionSet.actionSet[0].name)
8521 self.assertEqual(None, actionSet.actionSet[0].preHooks)
8522 self.assertEqual(None, actionSet.actionSet[0].postHooks)
8523 self.assertEqual(isdir, actionSet.actionSet[0].function)
8524 self.assertEqual("collect", actionSet.actionSet[1].name)
8525 self.assertEqual(None, actionSet.actionSet[1].preHooks)
8526 self.assertEqual(None, actionSet.actionSet[1].postHooks)
8527 self.assertEqual(executeCollect, actionSet.actionSet[1].function)
8528
8529 def testDependencyMode_069(self):
8530 """
8531 Test with actions=[ stage, one ], extensions=[ (one, before stage) ].
8532 """
8533 actions = [
8534 "stage",
8535 "one",
8536 ]
8537 dependencies = ActionDependencies(["stage"], None)
8538 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
8539 options = OptionsConfig()
8540 actionSet = _ActionSet(actions, extensions, options, None, False, True)
8541 self.assertTrue(len(actionSet.actionSet) == 2)
8542 self.assertEqual(isdir, actionSet.actionSet[0].function)
8543 self.assertEqual("one", actionSet.actionSet[0].name)
8544 self.assertEqual(None, actionSet.actionSet[0].preHooks)
8545 self.assertEqual(None, actionSet.actionSet[0].postHooks)
8546 self.assertEqual("stage", actionSet.actionSet[1].name)
8547 self.assertEqual(None, actionSet.actionSet[1].preHooks)
8548 self.assertEqual(None, actionSet.actionSet[1].postHooks)
8549 self.assertEqual(executeStage, actionSet.actionSet[1].function)
8550
8551 def testDependencyMode_070(self):
8552 """
8553 Test with actions=[ store, one ], extensions=[ (one, before store) ].
8554 """
8555 actions = [
8556 "store",
8557 "one",
8558 ]
8559 dependencies = ActionDependencies(["store"], [])
8560 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
8561 options = OptionsConfig()
8562 actionSet = _ActionSet(actions, extensions, options, None, False, True)
8563 self.assertTrue(len(actionSet.actionSet) == 2)
8564 self.assertEqual("one", actionSet.actionSet[0].name)
8565 self.assertEqual(None, actionSet.actionSet[0].preHooks)
8566 self.assertEqual(None, actionSet.actionSet[0].postHooks)
8567 self.assertEqual(isdir, actionSet.actionSet[0].function)
8568 self.assertEqual("store", actionSet.actionSet[1].name)
8569 self.assertEqual(None, actionSet.actionSet[1].preHooks)
8570 self.assertEqual(None, actionSet.actionSet[1].postHooks)
8571 self.assertEqual(executeStore, actionSet.actionSet[1].function)
8572
8573 def testDependencyMode_071(self):
8574 """
8575 Test with actions=[ purge, one ], extensions=[ (one, before purge) ].
8576 """
8577 actions = [
8578 "purge",
8579 "one",
8580 ]
8581 dependencies = ActionDependencies(["purge"], None)
8582 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
8583 options = OptionsConfig()
8584 actionSet = _ActionSet(actions, extensions, options, None, False, True)
8585 self.assertTrue(len(actionSet.actionSet) == 2)
8586 self.assertEqual("one", actionSet.actionSet[0].name)
8587 self.assertEqual(None, actionSet.actionSet[0].preHooks)
8588 self.assertEqual(None, actionSet.actionSet[0].postHooks)
8589 self.assertEqual(isdir, actionSet.actionSet[0].function)
8590 self.assertEqual("purge", actionSet.actionSet[1].name)
8591 self.assertEqual(None, actionSet.actionSet[1].preHooks)
8592 self.assertEqual(None, actionSet.actionSet[1].postHooks)
8593 self.assertEqual(executePurge, actionSet.actionSet[1].function)
8594
8595 def testDependencyMode_072(self):
8596 """
8597 Test with actions=[ all, one ], extensions=[ (one, before collect) ].
8598 """
8599 actions = [
8600 "all",
8601 "one",
8602 ]
8603 dependencies = ActionDependencies(["collect"], [])
8604 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
8605 options = OptionsConfig()
8606 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8607
8608 def testDependencyMode_073(self):
8609 """
8610 Test with actions=[ rebuild, one ], extensions=[ (one, before collect) ].
8611 """
8612 actions = [
8613 "rebuild",
8614 "one",
8615 ]
8616 dependencies = ActionDependencies(["collect"], None)
8617 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
8618 options = OptionsConfig()
8619 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8620
8621 def testDependencyMode_074(self):
8622 """
8623 Test with actions=[ validate, one ], extensions=[ (one, before collect) ].
8624 """
8625 actions = [
8626 "validate",
8627 "one",
8628 ]
8629 dependencies = ActionDependencies(["stage"], [])
8630 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
8631 options = OptionsConfig()
8632 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8633
8634 def testDependencyMode_075(self):
8635 """
8636 Test with actions=[ collect, one ], extensions=[ (one, after collect) ].
8637 """
8638 actions = [
8639 "collect",
8640 "one",
8641 ]
8642 dependencies = ActionDependencies([], ["collect"])
8643 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
8644 options = OptionsConfig()
8645 actionSet = _ActionSet(actions, extensions, options, None, False, True)
8646 self.assertTrue(len(actionSet.actionSet) == 2)
8647 self.assertEqual("collect", actionSet.actionSet[0].name)
8648 self.assertEqual(None, actionSet.actionSet[0].preHooks)
8649 self.assertEqual(None, actionSet.actionSet[0].postHooks)
8650 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
8651 self.assertEqual("one", actionSet.actionSet[1].name)
8652 self.assertEqual(None, actionSet.actionSet[1].preHooks)
8653 self.assertEqual(None, actionSet.actionSet[1].postHooks)
8654 self.assertEqual(isdir, actionSet.actionSet[1].function)
8655
8656 def testDependencyMode_076(self):
8657 """
8658 Test with actions=[ stage, one ], extensions=[ (one, after collect) ].
8659 """
8660 actions = [
8661 "stage",
8662 "one",
8663 ]
8664 dependencies = ActionDependencies(None, ["collect"])
8665 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
8666 options = OptionsConfig()
8667 actionSet = _ActionSet(actions, extensions, options, None, False, True)
8668 self.assertTrue(len(actionSet.actionSet) == 2)
8669 self.assertEqual("one", actionSet.actionSet[0].name)
8670 self.assertEqual(None, actionSet.actionSet[0].preHooks)
8671 self.assertEqual(None, actionSet.actionSet[0].postHooks)
8672 self.assertEqual(isdir, actionSet.actionSet[0].function)
8673 self.assertEqual("stage", actionSet.actionSet[1].name)
8674 self.assertEqual(None, actionSet.actionSet[1].preHooks)
8675 self.assertEqual(None, actionSet.actionSet[1].postHooks)
8676 self.assertEqual(executeStage, actionSet.actionSet[1].function)
8677
8678 def testDependencyMode_077(self):
8679 """
8680 Test with actions=[ store, one ], extensions=[ (one, after collect) ].
8681 """
8682 actions = [
8683 "store",
8684 "one",
8685 ]
8686 dependencies = ActionDependencies([], ["collect"])
8687 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
8688 options = OptionsConfig()
8689 actionSet = _ActionSet(actions, extensions, options, None, False, True)
8690 self.assertTrue(len(actionSet.actionSet) == 2)
8691 self.assertEqual("one", actionSet.actionSet[0].name)
8692 self.assertEqual(None, actionSet.actionSet[0].preHooks)
8693 self.assertEqual(None, actionSet.actionSet[0].postHooks)
8694 self.assertEqual(isdir, actionSet.actionSet[0].function)
8695 self.assertEqual("store", actionSet.actionSet[1].name)
8696 self.assertEqual(None, actionSet.actionSet[1].preHooks)
8697 self.assertEqual(None, actionSet.actionSet[1].postHooks)
8698 self.assertEqual(executeStore, actionSet.actionSet[1].function)
8699
8700 def testDependencyMode_078(self):
8701 """
8702 Test with actions=[ purge, one ], extensions=[ (one, after collect) ].
8703 """
8704 actions = [
8705 "purge",
8706 "one",
8707 ]
8708 dependencies = ActionDependencies(None, ["collect"])
8709 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
8710 options = OptionsConfig()
8711 actionSet = _ActionSet(actions, extensions, options, None, False, True)
8712 self.assertTrue(len(actionSet.actionSet) == 2)
8713 self.assertEqual("one", actionSet.actionSet[0].name)
8714 self.assertEqual(None, actionSet.actionSet[0].preHooks)
8715 self.assertEqual(None, actionSet.actionSet[0].postHooks)
8716 self.assertEqual(isdir, actionSet.actionSet[0].function)
8717 self.assertEqual("purge", actionSet.actionSet[1].name)
8718 self.assertEqual(None, actionSet.actionSet[1].preHooks)
8719 self.assertEqual(None, actionSet.actionSet[1].postHooks)
8720 self.assertEqual(executePurge, actionSet.actionSet[1].function)
8721
8722 def testDependencyMode_079(self):
8723 """
8724 Test with actions=[ stage, one ], extensions=[ (one, before stage) ].
8725 """
8726 actions = [
8727 "stage",
8728 "one",
8729 ]
8730 dependencies = ActionDependencies(["stage"], [])
8731 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
8732 options = OptionsConfig()
8733 actionSet = _ActionSet(actions, extensions, options, None, False, True)
8734 self.assertTrue(len(actionSet.actionSet) == 2)
8735 self.assertEqual("one", actionSet.actionSet[0].name)
8736 self.assertEqual(None, actionSet.actionSet[0].preHooks)
8737 self.assertEqual(None, actionSet.actionSet[0].postHooks)
8738 self.assertEqual(isdir, actionSet.actionSet[0].function)
8739 self.assertEqual("stage", actionSet.actionSet[1].name)
8740 self.assertEqual(None, actionSet.actionSet[1].preHooks)
8741 self.assertEqual(None, actionSet.actionSet[1].postHooks)
8742 self.assertEqual(executeStage, actionSet.actionSet[1].function)
8743
8744 def testDependencyMode_080(self):
8745 """
8746 Test with actions=[ store, one ], extensions=[ (one, before stage ) ].
8747 """
8748 actions = [
8749 "store",
8750 "one",
8751 ]
8752 dependencies = ActionDependencies(["stage"], None)
8753 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
8754 options = OptionsConfig()
8755 actionSet = _ActionSet(actions, extensions, options, None, False, True)
8756 self.assertTrue(len(actionSet.actionSet) == 2)
8757 self.assertEqual("one", actionSet.actionSet[0].name)
8758 self.assertEqual(None, actionSet.actionSet[0].preHooks)
8759 self.assertEqual(None, actionSet.actionSet[0].postHooks)
8760 self.assertEqual(isdir, actionSet.actionSet[0].function)
8761 self.assertEqual("store", actionSet.actionSet[1].name)
8762 self.assertEqual(None, actionSet.actionSet[1].preHooks)
8763 self.assertEqual(None, actionSet.actionSet[1].postHooks)
8764 self.assertEqual(executeStore, actionSet.actionSet[1].function)
8765
8766 def testDependencyMode_081(self):
8767 """
8768 Test with actions=[ purge, one ], extensions=[ (one, before stage) ].
8769 """
8770 actions = [
8771 "purge",
8772 "one",
8773 ]
8774 dependencies = ActionDependencies(["stage"], [])
8775 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
8776 options = OptionsConfig()
8777 actionSet = _ActionSet(actions, extensions, options, None, False, True)
8778 self.assertTrue(len(actionSet.actionSet) == 2)
8779 self.assertEqual("one", actionSet.actionSet[0].name)
8780 self.assertEqual(None, actionSet.actionSet[0].preHooks)
8781 self.assertEqual(None, actionSet.actionSet[0].postHooks)
8782 self.assertEqual(isdir, actionSet.actionSet[0].function)
8783 self.assertEqual("purge", actionSet.actionSet[1].name)
8784 self.assertEqual(None, actionSet.actionSet[1].preHooks)
8785 self.assertEqual(None, actionSet.actionSet[1].postHooks)
8786 self.assertEqual(executePurge, actionSet.actionSet[1].function)
8787
8788 def testDependencyMode_082(self):
8789 """
8790 Test with actions=[ all, one ], extensions=[ (one, after collect) ].
8791 """
8792 actions = [
8793 "all",
8794 "one",
8795 ]
8796 dependencies = ActionDependencies(None, ["collect"])
8797 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
8798 options = OptionsConfig()
8799 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8800
8801 def testDependencyMode_083(self):
8802 """
8803 Test with actions=[ rebuild, one ], extensions=[ (one, after collect) ].
8804 """
8805 actions = [
8806 "rebuild",
8807 "one",
8808 ]
8809 dependencies = ActionDependencies([], ["collect"])
8810 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
8811 options = OptionsConfig()
8812 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8813
8814 def testDependencyMode_084(self):
8815 """
8816 Test with actions=[ validate, one ], extensions=[ (one, after collect) ].
8817 """
8818 actions = [
8819 "validate",
8820 "one",
8821 ]
8822 dependencies = ActionDependencies(None, ["collect"])
8823 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
8824 options = OptionsConfig()
8825 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
8826
8827 def testDependencyMode_085(self):
8828 """
8829 Test with actions=[ collect, one ], extensions=[ (one, after stage) ].
8830 """
8831 actions = [
8832 "collect",
8833 "one",
8834 ]
8835 dependencies = ActionDependencies([], ["stage"])
8836 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
8837 options = OptionsConfig()
8838 actionSet = _ActionSet(actions, extensions, options, None, False, True)
8839 self.assertTrue(len(actionSet.actionSet) == 2)
8840 self.assertEqual("collect", actionSet.actionSet[0].name)
8841 self.assertEqual(None, actionSet.actionSet[0].preHooks)
8842 self.assertEqual(None, actionSet.actionSet[0].postHooks)
8843 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
8844 self.assertEqual("one", actionSet.actionSet[1].name)
8845 self.assertEqual(None, actionSet.actionSet[1].preHooks)
8846 self.assertEqual(None, actionSet.actionSet[1].postHooks)
8847 self.assertEqual(isdir, actionSet.actionSet[1].function)
8848
8849 def testDependencyMode_086(self):
8850 """
8851 Test with actions=[ stage, one ], extensions=[ (one, after stage) ].
8852 """
8853 actions = [
8854 "stage",
8855 "one",
8856 ]
8857 dependencies = ActionDependencies([], ["stage"])
8858 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
8859 options = OptionsConfig()
8860 actionSet = _ActionSet(actions, extensions, options, None, False, True)
8861 self.assertTrue(len(actionSet.actionSet) == 2)
8862 self.assertEqual("stage", actionSet.actionSet[0].name)
8863 self.assertEqual(None, actionSet.actionSet[0].preHooks)
8864 self.assertEqual(None, actionSet.actionSet[0].postHooks)
8865 self.assertEqual(executeStage, actionSet.actionSet[0].function)
8866 self.assertEqual("one", actionSet.actionSet[1].name)
8867 self.assertEqual(None, actionSet.actionSet[1].preHooks)
8868 self.assertEqual(None, actionSet.actionSet[1].postHooks)
8869 self.assertEqual(isdir, actionSet.actionSet[1].function)
8870
8871 def testDependencyMode_087(self):
8872 """
8873 Test with actions=[ store, one ], extensions=[ (one, after stage) ].
8874 """
8875 actions = [
8876 "store",
8877 "one",
8878 ]
8879 dependencies = ActionDependencies(None, ["stage"])
8880 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
8881 options = OptionsConfig()
8882 actionSet = _ActionSet(actions, extensions, options, None, False, True)
8883 self.assertTrue(len(actionSet.actionSet) == 2)
8884 self.assertEqual("one", actionSet.actionSet[0].name)
8885 self.assertEqual(None, actionSet.actionSet[0].preHooks)
8886 self.assertEqual(None, actionSet.actionSet[0].postHooks)
8887 self.assertEqual(isdir, actionSet.actionSet[0].function)
8888 self.assertEqual("store", actionSet.actionSet[1].name)
8889 self.assertEqual(None, actionSet.actionSet[1].preHooks)
8890 self.assertEqual(None, actionSet.actionSet[1].postHooks)
8891 self.assertEqual(executeStore, actionSet.actionSet[1].function)
8892
8893 def testDependencyMode_088(self):
8894 """
8895 Test with actions=[ purge, one ], extensions=[ (one, after stage) ].
8896 """
8897 actions = [
8898 "purge",
8899 "one",
8900 ]
8901 dependencies = ActionDependencies([], ["stage"])
8902 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
8903 options = OptionsConfig()
8904 actionSet = _ActionSet(actions, extensions, options, None, False, True)
8905 self.assertTrue(len(actionSet.actionSet) == 2)
8906 self.assertEqual("one", actionSet.actionSet[0].name)
8907 self.assertEqual(None, actionSet.actionSet[0].preHooks)
8908 self.assertEqual(None, actionSet.actionSet[0].postHooks)
8909 self.assertEqual(isdir, actionSet.actionSet[0].function)
8910 self.assertEqual("purge", actionSet.actionSet[1].name)
8911 self.assertEqual(None, actionSet.actionSet[1].preHooks)
8912 self.assertEqual(None, actionSet.actionSet[1].postHooks)
8913 self.assertEqual(executePurge, actionSet.actionSet[1].function)
8914
8915 def testDependencyMode_089(self):
8916 """
8917 Test with actions=[ collect, one ], extensions=[ (one, before store) ].
8918 """
8919 actions = [
8920 "collect",
8921 "one",
8922 ]
8923 dependencies = ActionDependencies(["store"], None)
8924 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
8925 options = OptionsConfig()
8926 actionSet = _ActionSet(actions, extensions, options, None, False, True)
8927 self.assertTrue(len(actionSet.actionSet) == 2)
8928 self.assertEqual("one", actionSet.actionSet[0].name)
8929 self.assertEqual(None, actionSet.actionSet[0].preHooks)
8930 self.assertEqual(None, actionSet.actionSet[0].postHooks)
8931 self.assertEqual(isdir, actionSet.actionSet[0].function)
8932 self.assertEqual("collect", actionSet.actionSet[1].name)
8933 self.assertEqual(None, actionSet.actionSet[1].preHooks)
8934 self.assertEqual(None, actionSet.actionSet[1].postHooks)
8935 self.assertEqual(executeCollect, actionSet.actionSet[1].function)
8936
8937 def testDependencyMode_090(self):
8938 """
8939 Test with actions=[ stage, one ], extensions=[ (one, before store) ].
8940 """
8941 actions = [
8942 "stage",
8943 "one",
8944 ]
8945 dependencies = ActionDependencies(["store"], [])
8946 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
8947 options = OptionsConfig()
8948 actionSet = _ActionSet(actions, extensions, options, None, False, True)
8949 self.assertTrue(len(actionSet.actionSet) == 2)
8950 self.assertEqual("one", actionSet.actionSet[0].name)
8951 self.assertEqual(None, actionSet.actionSet[0].preHooks)
8952 self.assertEqual(None, actionSet.actionSet[0].postHooks)
8953 self.assertEqual(isdir, actionSet.actionSet[0].function)
8954 self.assertEqual("stage", actionSet.actionSet[1].name)
8955 self.assertEqual(None, actionSet.actionSet[1].preHooks)
8956 self.assertEqual(None, actionSet.actionSet[1].postHooks)
8957 self.assertEqual(executeStage, actionSet.actionSet[1].function)
8958
8959 def testDependencyMode_091(self):
8960 """
8961 Test with actions=[ store, one ], extensions=[ (one, before store) ].
8962 """
8963 actions = [
8964 "store",
8965 "one",
8966 ]
8967 dependencies = ActionDependencies(["store"], None)
8968 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
8969 options = OptionsConfig()
8970 actionSet = _ActionSet(actions, extensions, options, None, False, True)
8971 self.assertTrue(len(actionSet.actionSet) == 2)
8972 self.assertEqual("one", actionSet.actionSet[0].name)
8973 self.assertEqual(None, actionSet.actionSet[0].preHooks)
8974 self.assertEqual(None, actionSet.actionSet[0].postHooks)
8975 self.assertEqual(isdir, actionSet.actionSet[0].function)
8976 self.assertEqual("store", actionSet.actionSet[1].name)
8977 self.assertEqual(None, actionSet.actionSet[1].preHooks)
8978 self.assertEqual(None, actionSet.actionSet[1].postHooks)
8979 self.assertEqual(executeStore, actionSet.actionSet[1].function)
8980
8981 def testDependencyMode_092(self):
8982 """
8983 Test with actions=[ purge, one ], extensions=[ (one, before store) ].
8984 """
8985 actions = [
8986 "purge",
8987 "one",
8988 ]
8989 dependencies = ActionDependencies(["store"], [])
8990 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
8991 options = OptionsConfig()
8992 actionSet = _ActionSet(actions, extensions, options, None, False, True)
8993 self.assertTrue(len(actionSet.actionSet) == 2)
8994 self.assertEqual("one", actionSet.actionSet[0].name)
8995 self.assertEqual(None, actionSet.actionSet[0].preHooks)
8996 self.assertEqual(None, actionSet.actionSet[0].postHooks)
8997 self.assertEqual(isdir, actionSet.actionSet[0].function)
8998 self.assertEqual("purge", actionSet.actionSet[1].name)
8999 self.assertEqual(None, actionSet.actionSet[1].preHooks)
9000 self.assertEqual(None, actionSet.actionSet[1].postHooks)
9001 self.assertEqual(executePurge, actionSet.actionSet[1].function)
9002
9003 def testDependencyMode_093(self):
9004 """
9005 Test with actions=[ all, one ], extensions=[ (one, after stage) ].
9006 """
9007 actions = [
9008 "all",
9009 "one",
9010 ]
9011 dependencies = ActionDependencies(None, ["stage"])
9012 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
9013 options = OptionsConfig()
9014 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
9015
9016 def testDependencyMode_094(self):
9017 """
9018 Test with actions=[ rebuild, one ], extensions=[ (one, after stage) ].
9019 """
9020 actions = [
9021 "rebuild",
9022 "one",
9023 ]
9024 dependencies = ActionDependencies([], ["stage"])
9025 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
9026 options = OptionsConfig()
9027 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
9028
9029 def testDependencyMode_095(self):
9030 """
9031 Test with actions=[ validate, one ], extensions=[ (one, after stage) ].
9032 """
9033 actions = [
9034 "validate",
9035 "one",
9036 ]
9037 dependencies = ActionDependencies(None, ["stage"])
9038 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
9039 options = OptionsConfig()
9040 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
9041
9042 def testDependencyMode_096(self):
9043 """
9044 Test with actions=[ collect, one ], extensions=[ (one, after store) ].
9045 """
9046 actions = [
9047 "collect",
9048 "one",
9049 ]
9050 dependencies = ActionDependencies(["store"], [])
9051 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
9052 options = OptionsConfig()
9053 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9054 self.assertTrue(len(actionSet.actionSet) == 2)
9055 self.assertEqual("one", actionSet.actionSet[0].name)
9056 self.assertEqual(None, actionSet.actionSet[0].preHooks)
9057 self.assertEqual(None, actionSet.actionSet[0].postHooks)
9058 self.assertEqual(isdir, actionSet.actionSet[0].function)
9059 self.assertEqual("collect", actionSet.actionSet[1].name)
9060 self.assertEqual(None, actionSet.actionSet[1].preHooks)
9061 self.assertEqual(None, actionSet.actionSet[1].postHooks)
9062 self.assertEqual(executeCollect, actionSet.actionSet[1].function)
9063
9064 def testDependencyMode_097(self):
9065 """
9066 Test with actions=[ stage, one ], extensions=[ (one, after store) ].
9067 """
9068 actions = [
9069 "stage",
9070 "one",
9071 ]
9072 dependencies = ActionDependencies(["store"], None)
9073 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
9074 options = OptionsConfig()
9075 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9076 self.assertTrue(len(actionSet.actionSet) == 2)
9077 self.assertEqual("one", actionSet.actionSet[0].name)
9078 self.assertEqual(None, actionSet.actionSet[0].preHooks)
9079 self.assertEqual(None, actionSet.actionSet[0].postHooks)
9080 self.assertEqual(isdir, actionSet.actionSet[0].function)
9081 self.assertEqual("stage", actionSet.actionSet[1].name)
9082 self.assertEqual(None, actionSet.actionSet[1].preHooks)
9083 self.assertEqual(None, actionSet.actionSet[1].postHooks)
9084 self.assertEqual(executeStage, actionSet.actionSet[1].function)
9085
9086 def testDependencyMode_098(self):
9087 """
9088 Test with actions=[ store, one ], extensions=[ (one, after store) ].
9089 """
9090 actions = [
9091 "store",
9092 "one",
9093 ]
9094 dependencies = ActionDependencies(["store"], [])
9095 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
9096 options = OptionsConfig()
9097 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9098 self.assertTrue(len(actionSet.actionSet) == 2)
9099 self.assertEqual("one", actionSet.actionSet[0].name)
9100 self.assertEqual(None, actionSet.actionSet[0].preHooks)
9101 self.assertEqual(None, actionSet.actionSet[0].postHooks)
9102 self.assertEqual(isdir, actionSet.actionSet[0].function)
9103 self.assertEqual("store", actionSet.actionSet[1].name)
9104 self.assertEqual(None, actionSet.actionSet[1].preHooks)
9105 self.assertEqual(None, actionSet.actionSet[1].postHooks)
9106 self.assertEqual(executeStore, actionSet.actionSet[1].function)
9107
9108 def testDependencyMode_099(self):
9109 """
9110 Test with actions=[ purge, one ], extensions=[ (one, after store) ].
9111 """
9112 actions = [
9113 "purge",
9114 "one",
9115 ]
9116 dependencies = ActionDependencies(["store"], None)
9117 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
9118 options = OptionsConfig()
9119 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9120 self.assertTrue(len(actionSet.actionSet) == 2)
9121 self.assertEqual("one", actionSet.actionSet[0].name)
9122 self.assertEqual(None, actionSet.actionSet[0].preHooks)
9123 self.assertEqual(None, actionSet.actionSet[0].postHooks)
9124 self.assertEqual(isdir, actionSet.actionSet[0].function)
9125 self.assertEqual("purge", actionSet.actionSet[1].name)
9126 self.assertEqual(None, actionSet.actionSet[1].preHooks)
9127 self.assertEqual(None, actionSet.actionSet[1].postHooks)
9128 self.assertEqual(executePurge, actionSet.actionSet[1].function)
9129
9130 def testDependencyMode_100(self):
9131 """
9132 Test with actions=[ collect, one ], extensions=[ (one, before purge) ].
9133 """
9134 actions = [
9135 "collect",
9136 "one",
9137 ]
9138 dependencies = ActionDependencies([], ["purge"])
9139 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
9140 options = OptionsConfig()
9141 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9142 self.assertTrue(len(actionSet.actionSet) == 2)
9143 self.assertEqual("one", actionSet.actionSet[1].name)
9144 self.assertEqual(None, actionSet.actionSet[1].preHooks)
9145 self.assertEqual(None, actionSet.actionSet[1].postHooks)
9146 self.assertEqual(isdir, actionSet.actionSet[1].function)
9147 self.assertEqual("collect", actionSet.actionSet[0].name)
9148 self.assertEqual(None, actionSet.actionSet[0].preHooks)
9149 self.assertEqual(None, actionSet.actionSet[0].postHooks)
9150 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
9151
9152 def testDependencyMode_101(self):
9153 """
9154 Test with actions=[ stage, one ], extensions=[ (one, before purge) ].
9155 """
9156 actions = [
9157 "stage",
9158 "one",
9159 ]
9160 dependencies = ActionDependencies(None, ["purge"])
9161 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
9162 options = OptionsConfig()
9163 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9164 self.assertTrue(len(actionSet.actionSet) == 2)
9165 self.assertEqual("one", actionSet.actionSet[1].name)
9166 self.assertEqual(None, actionSet.actionSet[1].preHooks)
9167 self.assertEqual(None, actionSet.actionSet[1].postHooks)
9168 self.assertEqual(isdir, actionSet.actionSet[1].function)
9169 self.assertEqual("stage", actionSet.actionSet[0].name)
9170 self.assertEqual(None, actionSet.actionSet[0].preHooks)
9171 self.assertEqual(None, actionSet.actionSet[0].postHooks)
9172 self.assertEqual(executeStage, actionSet.actionSet[0].function)
9173
9174 def testDependencyMode_102(self):
9175 """
9176 Test with actions=[ store, one ], extensions=[ (one, before purge) ].
9177 """
9178 actions = [
9179 "store",
9180 "one",
9181 ]
9182 dependencies = ActionDependencies([], ["purge"])
9183 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
9184 options = OptionsConfig()
9185 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9186 self.assertTrue(len(actionSet.actionSet) == 2)
9187 self.assertEqual("one", actionSet.actionSet[1].name)
9188 self.assertEqual(None, actionSet.actionSet[1].preHooks)
9189 self.assertEqual(None, actionSet.actionSet[1].postHooks)
9190 self.assertEqual(isdir, actionSet.actionSet[1].function)
9191 self.assertEqual("store", actionSet.actionSet[0].name)
9192 self.assertEqual(None, actionSet.actionSet[0].preHooks)
9193 self.assertEqual(None, actionSet.actionSet[0].postHooks)
9194 self.assertEqual(executeStore, actionSet.actionSet[0].function)
9195
9196 def testDependencyMode_103(self):
9197 """
9198 Test with actions=[ purge, one ], extensions=[ (one, before purge) ].
9199 """
9200 actions = [
9201 "purge",
9202 "one",
9203 ]
9204 dependencies = ActionDependencies(None, ["purge"])
9205 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
9206 options = OptionsConfig()
9207 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9208 self.assertTrue(len(actionSet.actionSet) == 2)
9209 self.assertEqual("purge", actionSet.actionSet[0].name)
9210 self.assertEqual(None, actionSet.actionSet[0].preHooks)
9211 self.assertEqual(None, actionSet.actionSet[0].postHooks)
9212 self.assertEqual(executePurge, actionSet.actionSet[0].function)
9213 self.assertEqual("one", actionSet.actionSet[1].name)
9214 self.assertEqual(None, actionSet.actionSet[1].preHooks)
9215 self.assertEqual(None, actionSet.actionSet[1].postHooks)
9216 self.assertEqual(isdir, actionSet.actionSet[1].function)
9217
9218 def testDependencyMode_104(self):
9219 """
9220 Test with actions=[ all, one ], extensions=[ (one, after store) ].
9221 """
9222 actions = [
9223 "all",
9224 "one",
9225 ]
9226 dependencies = ActionDependencies(["store"], [])
9227 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
9228 options = OptionsConfig()
9229 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
9230
9231 def testDependencyMode_105(self):
9232 """
9233 Test with actions=[ rebuild, one ], extensions=[ (one, after store) ].
9234 """
9235 actions = [
9236 "rebuild",
9237 "one",
9238 ]
9239 dependencies = ActionDependencies(["store"], None)
9240 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
9241 options = OptionsConfig()
9242 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
9243
9244 def testDependencyMode_106(self):
9245 """
9246 Test with actions=[ validate, one ], extensions=[ (one, after store) ].
9247 """
9248 actions = [
9249 "validate",
9250 "one",
9251 ]
9252 dependencies = ActionDependencies(["store"], [])
9253 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
9254 options = OptionsConfig()
9255 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
9256
9257 def testDependencyMode_107(self):
9258 """
9259 Test with actions=[ collect, one ], extensions=[ (one, after purge) ].
9260 """
9261 actions = [
9262 "collect",
9263 "one",
9264 ]
9265 dependencies = ActionDependencies(None, ["purge"])
9266 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
9267 options = OptionsConfig()
9268 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9269 self.assertTrue(len(actionSet.actionSet) == 2)
9270 self.assertEqual("one", actionSet.actionSet[1].name)
9271 self.assertEqual(None, actionSet.actionSet[1].preHooks)
9272 self.assertEqual(None, actionSet.actionSet[1].postHooks)
9273 self.assertEqual(isdir, actionSet.actionSet[1].function)
9274 self.assertEqual("collect", actionSet.actionSet[0].name)
9275 self.assertEqual(None, actionSet.actionSet[0].preHooks)
9276 self.assertEqual(None, actionSet.actionSet[0].postHooks)
9277 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
9278
9279 def testDependencyMode_108(self):
9280 """
9281 Test with actions=[ stage, one ], extensions=[ (one, after purge) ].
9282 """
9283 actions = [
9284 "stage",
9285 "one",
9286 ]
9287 dependencies = ActionDependencies([], ["purge"])
9288 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
9289 options = OptionsConfig()
9290 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9291 self.assertTrue(len(actionSet.actionSet) == 2)
9292 self.assertEqual("one", actionSet.actionSet[1].name)
9293 self.assertEqual(None, actionSet.actionSet[1].preHooks)
9294 self.assertEqual(None, actionSet.actionSet[1].postHooks)
9295 self.assertEqual(isdir, actionSet.actionSet[1].function)
9296 self.assertEqual("stage", actionSet.actionSet[0].name)
9297 self.assertEqual(None, actionSet.actionSet[0].preHooks)
9298 self.assertEqual(None, actionSet.actionSet[0].postHooks)
9299 self.assertEqual(executeStage, actionSet.actionSet[0].function)
9300
9301 def testDependencyMode_109(self):
9302 """
9303 Test with actions=[ store, one ], extensions=[ (one, after purge) ].
9304 """
9305 actions = [
9306 "store",
9307 "one",
9308 ]
9309 dependencies = ActionDependencies(None, ["purge"])
9310 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
9311 options = OptionsConfig()
9312 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9313 self.assertTrue(len(actionSet.actionSet) == 2)
9314 self.assertEqual("one", actionSet.actionSet[1].name)
9315 self.assertEqual(None, actionSet.actionSet[1].preHooks)
9316 self.assertEqual(None, actionSet.actionSet[1].postHooks)
9317 self.assertEqual(isdir, actionSet.actionSet[1].function)
9318 self.assertEqual("store", actionSet.actionSet[0].name)
9319 self.assertEqual(None, actionSet.actionSet[0].preHooks)
9320 self.assertEqual(None, actionSet.actionSet[0].postHooks)
9321 self.assertEqual(executeStore, actionSet.actionSet[0].function)
9322
9323 def testDependencyMode_110(self):
9324 """
9325 Test with actions=[ purge, one ], extensions=[ (one, after purge) ].
9326 """
9327 actions = [
9328 "purge",
9329 "one",
9330 ]
9331 dependencies = ActionDependencies([], ["purge"])
9332 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
9333 options = OptionsConfig()
9334 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9335 self.assertTrue(len(actionSet.actionSet) == 2)
9336 self.assertEqual("purge", actionSet.actionSet[0].name)
9337 self.assertEqual(None, actionSet.actionSet[0].preHooks)
9338 self.assertEqual(None, actionSet.actionSet[0].postHooks)
9339 self.assertEqual(executePurge, actionSet.actionSet[0].function)
9340 self.assertEqual("one", actionSet.actionSet[1].name)
9341 self.assertEqual(None, actionSet.actionSet[1].preHooks)
9342 self.assertEqual(None, actionSet.actionSet[1].postHooks)
9343 self.assertEqual(isdir, actionSet.actionSet[1].function)
9344
9345 def testDependencyMode_111(self):
9346 """
9347 Test with actions=[ all, one ], extensions=[ (one, after purge) ].
9348 """
9349 actions = [
9350 "all",
9351 "one",
9352 ]
9353 dependencies = ActionDependencies(None, ["purge"])
9354 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
9355 options = OptionsConfig()
9356 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
9357
9358 def testDependencyMode_112(self):
9359 """
9360 Test with actions=[ rebuild, one ], extensions=[ (one, after purge) ].
9361 """
9362 actions = [
9363 "rebuild",
9364 "one",
9365 ]
9366 dependencies = ActionDependencies([], ["purge"])
9367 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
9368 options = OptionsConfig()
9369 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
9370
9371 def testDependencyMode_113(self):
9372 """
9373 Test with actions=[ validate, one ], extensions=[ (one, after purge) ].
9374 """
9375 actions = [
9376 "validate",
9377 "one",
9378 ]
9379 dependencies = ActionDependencies(None, ["purge"])
9380 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
9381 options = OptionsConfig()
9382 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
9383
9384 def testDependencyMode_114(self):
9385 """
9386 Test with actions=[ one, one ], extensions=[ (one, after purge) ].
9387 """
9388 actions = [
9389 "one",
9390 "one",
9391 ]
9392 dependencies = ActionDependencies([], ["purge"])
9393 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
9394 options = OptionsConfig()
9395 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9396 self.assertTrue(len(actionSet.actionSet) == 2)
9397 self.assertEqual("one", actionSet.actionSet[0].name)
9398 self.assertEqual(None, actionSet.actionSet[0].preHooks)
9399 self.assertEqual(None, actionSet.actionSet[0].postHooks)
9400 self.assertEqual(isdir, actionSet.actionSet[0].function)
9401 self.assertEqual("one", actionSet.actionSet[1].name)
9402 self.assertEqual(None, actionSet.actionSet[1].preHooks)
9403 self.assertEqual(None, actionSet.actionSet[1].postHooks)
9404 self.assertEqual(isdir, actionSet.actionSet[1].function)
9405
9406 def testDependencyMode_115(self):
9407 """
9408 Test with actions=[ collect, stage, store, purge ], extensions=[].
9409 """
9410 actions = [
9411 "collect",
9412 "stage",
9413 "store",
9414 "purge",
9415 ]
9416 extensions = ExtensionsConfig([], "dependency")
9417 options = OptionsConfig()
9418 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9419 self.assertTrue(len(actionSet.actionSet) == 4)
9420 self.assertEqual(100, actionSet.actionSet[0].index)
9421 self.assertEqual("collect", actionSet.actionSet[0].name)
9422 self.assertEqual(None, actionSet.actionSet[0].preHooks)
9423 self.assertEqual(None, actionSet.actionSet[0].postHooks)
9424 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
9425 self.assertEqual(200, actionSet.actionSet[1].index)
9426 self.assertEqual("stage", actionSet.actionSet[1].name)
9427 self.assertEqual(None, actionSet.actionSet[1].preHooks)
9428 self.assertEqual(None, actionSet.actionSet[1].postHooks)
9429 self.assertEqual(executeStage, actionSet.actionSet[1].function)
9430 self.assertEqual(300, actionSet.actionSet[2].index)
9431 self.assertEqual("store", actionSet.actionSet[2].name)
9432 self.assertEqual(None, actionSet.actionSet[2].preHooks)
9433 self.assertEqual(None, actionSet.actionSet[2].postHooks)
9434 self.assertEqual(executeStore, actionSet.actionSet[2].function)
9435 self.assertEqual(400, actionSet.actionSet[3].index)
9436 self.assertEqual("purge", actionSet.actionSet[3].name)
9437 self.assertEqual(None, actionSet.actionSet[3].preHooks)
9438 self.assertEqual(None, actionSet.actionSet[3].postHooks)
9439 self.assertEqual(executePurge, actionSet.actionSet[3].function)
9440
9441 def testDependencyMode_116(self):
9442 """
9443 Test with actions=[ stage, purge, collect, store ], extensions=[].
9444 """
9445 actions = [
9446 "stage",
9447 "purge",
9448 "collect",
9449 "store",
9450 ]
9451 extensions = ExtensionsConfig([], "dependency")
9452 options = OptionsConfig()
9453 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9454 self.assertTrue(len(actionSet.actionSet) == 4)
9455 self.assertEqual(100, actionSet.actionSet[0].index)
9456 self.assertEqual("collect", actionSet.actionSet[0].name)
9457 self.assertEqual(None, actionSet.actionSet[0].preHooks)
9458 self.assertEqual(None, actionSet.actionSet[0].postHooks)
9459 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
9460 self.assertEqual(200, actionSet.actionSet[1].index)
9461 self.assertEqual("stage", actionSet.actionSet[1].name)
9462 self.assertEqual(None, actionSet.actionSet[1].preHooks)
9463 self.assertEqual(None, actionSet.actionSet[1].postHooks)
9464 self.assertEqual(executeStage, actionSet.actionSet[1].function)
9465 self.assertEqual(300, actionSet.actionSet[2].index)
9466 self.assertEqual("store", actionSet.actionSet[2].name)
9467 self.assertEqual(None, actionSet.actionSet[2].preHooks)
9468 self.assertEqual(None, actionSet.actionSet[2].postHooks)
9469 self.assertEqual(executeStore, actionSet.actionSet[2].function)
9470 self.assertEqual(400, actionSet.actionSet[3].index)
9471 self.assertEqual("purge", actionSet.actionSet[3].name)
9472 self.assertEqual(None, actionSet.actionSet[3].preHooks)
9473 self.assertEqual(None, actionSet.actionSet[3].postHooks)
9474 self.assertEqual(executePurge, actionSet.actionSet[3].function)
9475
9476 def testDependencyMode_117(self):
9477 """
9478 Test with actions=[ collect, stage, store, purge, one, two, three, four, five ],
9479 extensions=[ one before collect, two before stage, etc. ].
9480 """
9481 actions = [
9482 "collect",
9483 "stage",
9484 "store",
9485 "purge",
9486 "one",
9487 "two",
9488 "three",
9489 "four",
9490 "five",
9491 ]
9492 dependencies1 = ActionDependencies(["collect", "stage", "store", "purge"], None)
9493 dependencies2 = ActionDependencies(["stage", "store", "purge"], ["collect"])
9494 dependencies3 = ActionDependencies(["store", "purge"], ["collect", "stage"])
9495 dependencies4 = ActionDependencies(["purge"], ["collect", "stage", "store"])
9496 dependencies5 = ActionDependencies([], ["collect", "stage", "store", "purge"])
9497 eaction1 = ExtendedAction("one", "os.path", "isdir", dependencies=dependencies1)
9498 eaction2 = ExtendedAction("two", "os.path", "isfile", dependencies=dependencies2)
9499 eaction3 = ExtendedAction("three", "os.path", "islink", dependencies=dependencies3)
9500 eaction4 = ExtendedAction("four", "os.path", "isabs", dependencies=dependencies4)
9501 eaction5 = ExtendedAction("five", "os.path", "exists", dependencies=dependencies5)
9502 extensions = ExtensionsConfig([eaction1, eaction2, eaction3, eaction4, eaction5], "dependency")
9503 options = OptionsConfig()
9504 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9505 self.assertTrue(len(actionSet.actionSet) == 9)
9506 self.assertEqual("one", actionSet.actionSet[0].name)
9507 self.assertEqual(None, actionSet.actionSet[0].preHooks)
9508 self.assertEqual(None, actionSet.actionSet[0].postHooks)
9509 self.assertEqual(isdir, actionSet.actionSet[0].function)
9510 self.assertEqual("collect", actionSet.actionSet[1].name)
9511 self.assertEqual(None, actionSet.actionSet[1].preHooks)
9512 self.assertEqual(None, actionSet.actionSet[1].postHooks)
9513 self.assertEqual(executeCollect, actionSet.actionSet[1].function)
9514 self.assertEqual("two", actionSet.actionSet[2].name)
9515 self.assertEqual(None, actionSet.actionSet[2].preHooks)
9516 self.assertEqual(None, actionSet.actionSet[2].postHooks)
9517 self.assertEqual(isfile, actionSet.actionSet[2].function)
9518 self.assertEqual("stage", actionSet.actionSet[3].name)
9519 self.assertEqual(None, actionSet.actionSet[3].preHooks)
9520 self.assertEqual(None, actionSet.actionSet[3].postHooks)
9521 self.assertEqual(executeStage, actionSet.actionSet[3].function)
9522 self.assertEqual("three", actionSet.actionSet[4].name)
9523 self.assertEqual(None, actionSet.actionSet[4].preHooks)
9524 self.assertEqual(None, actionSet.actionSet[4].postHooks)
9525 self.assertEqual(islink, actionSet.actionSet[4].function)
9526 self.assertEqual("store", actionSet.actionSet[5].name)
9527 self.assertEqual(None, actionSet.actionSet[5].preHooks)
9528 self.assertEqual(None, actionSet.actionSet[5].postHooks)
9529 self.assertEqual(executeStore, actionSet.actionSet[5].function)
9530 self.assertEqual("four", actionSet.actionSet[6].name)
9531 self.assertEqual(None, actionSet.actionSet[6].preHooks)
9532 self.assertEqual(None, actionSet.actionSet[6].postHooks)
9533 self.assertEqual(isabs, actionSet.actionSet[6].function)
9534 self.assertEqual("purge", actionSet.actionSet[7].name)
9535 self.assertEqual(None, actionSet.actionSet[7].preHooks)
9536 self.assertEqual(None, actionSet.actionSet[7].postHooks)
9537 self.assertEqual(executePurge, actionSet.actionSet[7].function)
9538 self.assertEqual("five", actionSet.actionSet[8].name)
9539 self.assertEqual(None, actionSet.actionSet[8].preHooks)
9540 self.assertEqual(None, actionSet.actionSet[8].postHooks)
9541 self.assertEqual(exists, actionSet.actionSet[8].function)
9542
9543 def testDependencyMode_118(self):
9544 """
9545 Test with actions=[ one, five, collect, store, three, stage, four, purge, two ],
9546 extensions=[ one before collect, two before stage, etc. ].
9547 """
9548 actions = [
9549 "one",
9550 "five",
9551 "collect",
9552 "store",
9553 "three",
9554 "stage",
9555 "four",
9556 "purge",
9557 "two",
9558 ]
9559 dependencies1 = ActionDependencies(["collect", "stage", "store", "purge"], [])
9560 dependencies2 = ActionDependencies(["stage", "store", "purge"], ["collect"])
9561 dependencies3 = ActionDependencies(["store", "purge"], ["collect", "stage"])
9562 dependencies4 = ActionDependencies(["purge"], ["collect", "stage", "store"])
9563 dependencies5 = ActionDependencies(None, ["collect", "stage", "store", "purge"])
9564 eaction1 = ExtendedAction("one", "os.path", "isdir", dependencies=dependencies1)
9565 eaction2 = ExtendedAction("two", "os.path", "isfile", dependencies=dependencies2)
9566 eaction3 = ExtendedAction("three", "os.path", "islink", dependencies=dependencies3)
9567 eaction4 = ExtendedAction("four", "os.path", "isabs", dependencies=dependencies4)
9568 eaction5 = ExtendedAction("five", "os.path", "exists", dependencies=dependencies5)
9569 extensions = ExtensionsConfig([eaction1, eaction2, eaction3, eaction4, eaction5], "dependency")
9570 options = OptionsConfig()
9571 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9572 self.assertTrue(len(actionSet.actionSet) == 9)
9573 self.assertEqual("one", actionSet.actionSet[0].name)
9574 self.assertEqual(None, actionSet.actionSet[0].preHooks)
9575 self.assertEqual(None, actionSet.actionSet[0].postHooks)
9576 self.assertEqual(isdir, actionSet.actionSet[0].function)
9577 self.assertEqual("collect", actionSet.actionSet[1].name)
9578 self.assertEqual(None, actionSet.actionSet[1].preHooks)
9579 self.assertEqual(None, actionSet.actionSet[1].postHooks)
9580 self.assertEqual(executeCollect, actionSet.actionSet[1].function)
9581 self.assertEqual("two", actionSet.actionSet[2].name)
9582 self.assertEqual(None, actionSet.actionSet[2].preHooks)
9583 self.assertEqual(None, actionSet.actionSet[2].postHooks)
9584 self.assertEqual(isfile, actionSet.actionSet[2].function)
9585 self.assertEqual("stage", actionSet.actionSet[3].name)
9586 self.assertEqual(None, actionSet.actionSet[3].preHooks)
9587 self.assertEqual(None, actionSet.actionSet[3].postHooks)
9588 self.assertEqual(executeStage, actionSet.actionSet[3].function)
9589 self.assertEqual("three", actionSet.actionSet[4].name)
9590 self.assertEqual(None, actionSet.actionSet[4].preHooks)
9591 self.assertEqual(None, actionSet.actionSet[4].postHooks)
9592 self.assertEqual(islink, actionSet.actionSet[4].function)
9593 self.assertEqual("store", actionSet.actionSet[5].name)
9594 self.assertEqual(None, actionSet.actionSet[5].preHooks)
9595 self.assertEqual(None, actionSet.actionSet[5].postHooks)
9596 self.assertEqual(executeStore, actionSet.actionSet[5].function)
9597 self.assertEqual("four", actionSet.actionSet[6].name)
9598 self.assertEqual(None, actionSet.actionSet[6].preHooks)
9599 self.assertEqual(None, actionSet.actionSet[6].postHooks)
9600 self.assertEqual(isabs, actionSet.actionSet[6].function)
9601 self.assertEqual("purge", actionSet.actionSet[7].name)
9602 self.assertEqual(None, actionSet.actionSet[7].preHooks)
9603 self.assertEqual(None, actionSet.actionSet[7].postHooks)
9604 self.assertEqual(executePurge, actionSet.actionSet[7].function)
9605 self.assertEqual("five", actionSet.actionSet[8].name)
9606 self.assertEqual(None, actionSet.actionSet[8].preHooks)
9607 self.assertEqual(None, actionSet.actionSet[8].postHooks)
9608 self.assertEqual(exists, actionSet.actionSet[8].function)
9609
9610 def testDependencyMode_119(self):
9611 """
9612 Test with actions=[ one ], extensions=[ (one, before collect) ].
9613 """
9614 actions = [
9615 "one",
9616 ]
9617 dependencies = ActionDependencies(["collect"], [])
9618 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
9619 options = OptionsConfig()
9620 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9621 self.assertTrue(len(actionSet.actionSet) == 1)
9622 self.assertEqual("one", actionSet.actionSet[0].name)
9623 self.assertEqual(None, actionSet.actionSet[0].preHooks)
9624 self.assertEqual(None, actionSet.actionSet[0].postHooks)
9625 self.assertEqual(isdir, actionSet.actionSet[0].function)
9626
9627 def testDependencyMode_120(self):
9628 """
9629 Test with actions=[ collect ], extensions=[], hooks=[]
9630 """
9631 actions = [
9632 "collect",
9633 ]
9634 extensions = ExtensionsConfig([], "dependency")
9635 options = OptionsConfig()
9636 options.hooks = []
9637 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9638 self.assertFalse(actionSet.actionSet is None)
9639 self.assertTrue(len(actionSet.actionSet) == 1)
9640 self.assertEqual(100, actionSet.actionSet[0].index)
9641 self.assertEqual("collect", actionSet.actionSet[0].name)
9642 self.assertEqual(None, actionSet.actionSet[0].preHooks)
9643 self.assertEqual(None, actionSet.actionSet[0].postHooks)
9644 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
9645
9646 def testDependencyMode_121(self):
9647 """
9648 Test with actions=[ collect ], extensions=[], pre-hook on 'stage' action.
9649 """
9650 actions = [
9651 "collect",
9652 ]
9653 extensions = ExtensionsConfig([], "dependency")
9654 options = OptionsConfig()
9655 options.hooks = [PreActionHook("stage", "something")]
9656 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9657 self.assertFalse(actionSet.actionSet is None)
9658 self.assertTrue(len(actionSet.actionSet) == 1)
9659 self.assertEqual("collect", actionSet.actionSet[0].name)
9660 self.assertEqual(None, actionSet.actionSet[0].preHooks)
9661 self.assertEqual(None, actionSet.actionSet[0].postHooks)
9662 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
9663
9664 def testDependencyMode_122(self):
9665 """
9666 Test with actions=[ collect ], extensions=[], post-hook on 'stage' action.
9667 """
9668 actions = [
9669 "collect",
9670 ]
9671 extensions = ExtensionsConfig([], "dependency")
9672 options = OptionsConfig()
9673 options.hooks = [PostActionHook("stage", "something")]
9674 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9675 self.assertFalse(actionSet.actionSet is None)
9676 self.assertTrue(len(actionSet.actionSet) == 1)
9677 self.assertEqual("collect", actionSet.actionSet[0].name)
9678 self.assertEqual(None, actionSet.actionSet[0].preHooks)
9679 self.assertEqual(None, actionSet.actionSet[0].postHooks)
9680 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
9681
9682 def testDependencyMode_123(self):
9683 """
9684 Test with actions=[ collect ], extensions=[], pre-hook on 'collect' action.
9685 """
9686 actions = [
9687 "collect",
9688 ]
9689 extensions = ExtensionsConfig([], "dependency")
9690 options = OptionsConfig()
9691 options.hooks = [PreActionHook("collect", "something")]
9692 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9693 self.assertFalse(actionSet.actionSet is None)
9694 self.assertTrue(len(actionSet.actionSet) == 1)
9695 self.assertEqual("collect", actionSet.actionSet[0].name)
9696 self.assertEqual([PreActionHook("collect", "something")], actionSet.actionSet[0].preHooks)
9697 self.assertEqual(None, actionSet.actionSet[0].postHooks)
9698 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
9699
9700 def testDependencyMode_124(self):
9701 """
9702 Test with actions=[ collect ], extensions=[], post-hook on 'collect' action.
9703 """
9704 actions = [
9705 "collect",
9706 ]
9707 extensions = ExtensionsConfig([], "dependency")
9708 options = OptionsConfig()
9709 options.hooks = [PostActionHook("collect", "something")]
9710 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9711 self.assertFalse(actionSet.actionSet is None)
9712 self.assertTrue(len(actionSet.actionSet) == 1)
9713 self.assertEqual("collect", actionSet.actionSet[0].name)
9714 self.assertEqual(None, actionSet.actionSet[0].preHooks)
9715 self.assertEqual([PostActionHook("collect", "something")], actionSet.actionSet[0].postHooks)
9716 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
9717
9718 def testDependencyMode_125(self):
9719 """
9720 Test with actions=[ collect ], extensions=[], pre- and post-hook on 'collect' action.
9721 """
9722 actions = [
9723 "collect",
9724 ]
9725 extensions = ExtensionsConfig([], "dependency")
9726 options = OptionsConfig()
9727 options.hooks = [PreActionHook("collect", "something1"), PostActionHook("collect", "something2")]
9728 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9729 self.assertFalse(actionSet.actionSet is None)
9730 self.assertTrue(len(actionSet.actionSet) == 1)
9731 self.assertEqual("collect", actionSet.actionSet[0].name)
9732 self.assertEqual([PreActionHook("collect", "something1")], actionSet.actionSet[0].preHooks)
9733 self.assertEqual([PostActionHook("collect", "something2")], actionSet.actionSet[0].postHooks)
9734 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
9735
9736 def testDependencyMode_126(self):
9737 """
9738 Test with actions=[ one ], extensions=[ (one, before collect) ], hooks=[]
9739 """
9740 actions = [
9741 "one",
9742 ]
9743 dependencies = ActionDependencies(["collect"], [])
9744 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
9745 options = OptionsConfig()
9746 options.hooks = []
9747 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9748 self.assertTrue(len(actionSet.actionSet) == 1)
9749 self.assertEqual("one", actionSet.actionSet[0].name)
9750 self.assertEqual(None, actionSet.actionSet[0].preHooks)
9751 self.assertEqual(None, actionSet.actionSet[0].postHooks)
9752 self.assertEqual(isdir, actionSet.actionSet[0].function)
9753
9754 def testDependencyMode_127(self):
9755 """
9756 Test with actions=[ one ], extensions=[ (one, before collect) ], pre-hook on "store" action.
9757 """
9758 actions = [
9759 "one",
9760 ]
9761 dependencies = ActionDependencies(["collect"], None)
9762 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
9763 options = OptionsConfig()
9764 options.hooks = [
9765 PreActionHook("store", "whatever"),
9766 ]
9767 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9768 self.assertTrue(len(actionSet.actionSet) == 1)
9769 self.assertEqual("one", actionSet.actionSet[0].name)
9770 self.assertEqual(None, actionSet.actionSet[0].preHooks)
9771 self.assertEqual(None, actionSet.actionSet[0].postHooks)
9772 self.assertEqual(isdir, actionSet.actionSet[0].function)
9773
9774 def testDependencyMode_128(self):
9775 """
9776 Test with actions=[ one ], extensions=[ (one, before collect) ], post-hook on "store" action.
9777 """
9778 actions = [
9779 "one",
9780 ]
9781 dependencies = ActionDependencies(["collect"], [])
9782 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
9783 options = OptionsConfig()
9784 options.hooks = [
9785 PostActionHook("store", "whatever"),
9786 ]
9787 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9788 self.assertTrue(len(actionSet.actionSet) == 1)
9789 self.assertEqual("one", actionSet.actionSet[0].name)
9790 self.assertEqual(None, actionSet.actionSet[0].preHooks)
9791 self.assertEqual(None, actionSet.actionSet[0].postHooks)
9792 self.assertEqual(isdir, actionSet.actionSet[0].function)
9793
9794 def testDependencyMode_129(self):
9795 """
9796 Test with actions=[ one ], extensions=[ (one, before collect) ], pre-hook on "one" action.
9797 """
9798 actions = [
9799 "one",
9800 ]
9801 dependencies = ActionDependencies(["collect"], None)
9802 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
9803 options = OptionsConfig()
9804 options.hooks = [
9805 PreActionHook("one", "extension"),
9806 ]
9807 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9808 self.assertTrue(len(actionSet.actionSet) == 1)
9809 self.assertEqual("one", actionSet.actionSet[0].name)
9810 self.assertEqual([PreActionHook("one", "extension")], actionSet.actionSet[0].preHooks)
9811 self.assertEqual(None, actionSet.actionSet[0].postHooks)
9812 self.assertEqual(isdir, actionSet.actionSet[0].function)
9813
9814 def testDependencyMode_130(self):
9815 """
9816 Test with actions=[ one ], extensions=[ (one, before collect) ], post-hook on "one" action.
9817 """
9818 actions = [
9819 "one",
9820 ]
9821 dependencies = ActionDependencies(["collect"], [])
9822 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
9823 options = OptionsConfig()
9824 options.hooks = [
9825 PostActionHook("one", "extension"),
9826 ]
9827 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9828 self.assertTrue(len(actionSet.actionSet) == 1)
9829 self.assertEqual("one", actionSet.actionSet[0].name)
9830 self.assertEqual(None, actionSet.actionSet[0].preHooks)
9831 self.assertEqual([PostActionHook("one", "extension")], actionSet.actionSet[0].postHooks)
9832 self.assertEqual(isdir, actionSet.actionSet[0].function)
9833
9834 def testDependencyMode_131(self):
9835 """
9836 Test with actions=[ one ], extensions=[ (one, before collect) ], pre- and post-hook on "one" action.
9837 """
9838 actions = [
9839 "one",
9840 ]
9841 dependencies = ActionDependencies(["collect"], None)
9842 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
9843 options = OptionsConfig()
9844 options.hooks = [
9845 PostActionHook("one", "extension2"),
9846 PreActionHook("one", "extension1"),
9847 ]
9848 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9849 self.assertTrue(len(actionSet.actionSet) == 1)
9850 self.assertEqual("one", actionSet.actionSet[0].name)
9851 self.assertEqual([PreActionHook("one", "extension1")], actionSet.actionSet[0].preHooks)
9852 self.assertEqual([PostActionHook("one", "extension2")], actionSet.actionSet[0].postHooks)
9853 self.assertEqual(isdir, actionSet.actionSet[0].function)
9854
9855 def testDependencyMode_132(self):
9856 """
9857 Test with actions=[ collect, one ], extensions=[ (one, before collect) ], hooks=[]
9858 """
9859 actions = [
9860 "collect",
9861 "one",
9862 ]
9863 dependencies = ActionDependencies(["collect"], [])
9864 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
9865 options = OptionsConfig()
9866 options.hooks = []
9867 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9868 self.assertTrue(len(actionSet.actionSet) == 2)
9869 self.assertEqual("one", actionSet.actionSet[0].name)
9870 self.assertEqual(None, actionSet.actionSet[0].preHooks)
9871 self.assertEqual(None, actionSet.actionSet[0].postHooks)
9872 self.assertEqual(isdir, actionSet.actionSet[0].function)
9873 self.assertEqual("collect", actionSet.actionSet[1].name)
9874 self.assertEqual(None, actionSet.actionSet[1].preHooks)
9875 self.assertEqual(None, actionSet.actionSet[1].postHooks)
9876 self.assertEqual(executeCollect, actionSet.actionSet[1].function)
9877
9878 def testDependencyMode_133(self):
9879 """
9880 Test with actions=[ collect, one ], extensions=[ (one, before collect) ], pre-hook on "purge" action
9881 """
9882 actions = [
9883 "collect",
9884 "one",
9885 ]
9886 dependencies = ActionDependencies(["collect"], None)
9887 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
9888 options = OptionsConfig()
9889 options.hooks = [
9890 PreActionHook("purge", "rm -f"),
9891 ]
9892 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9893 self.assertTrue(len(actionSet.actionSet) == 2)
9894 self.assertEqual("one", actionSet.actionSet[0].name)
9895 self.assertEqual(None, actionSet.actionSet[0].preHooks)
9896 self.assertEqual(None, actionSet.actionSet[0].postHooks)
9897 self.assertEqual(isdir, actionSet.actionSet[0].function)
9898 self.assertEqual("collect", actionSet.actionSet[1].name)
9899 self.assertEqual(None, actionSet.actionSet[1].preHooks)
9900 self.assertEqual(None, actionSet.actionSet[1].postHooks)
9901 self.assertEqual(executeCollect, actionSet.actionSet[1].function)
9902
9903 def testDependencyMode_134(self):
9904 """
9905 Test with actions=[ collect, one ], extensions=[ (one, before collect) ], post-hook on "purge" action
9906 """
9907 actions = [
9908 "collect",
9909 "one",
9910 ]
9911 dependencies = ActionDependencies(["collect"], [])
9912 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
9913 options = OptionsConfig()
9914 options.hooks = [
9915 PostActionHook("purge", "rm -f"),
9916 ]
9917 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9918 self.assertTrue(len(actionSet.actionSet) == 2)
9919 self.assertEqual("one", actionSet.actionSet[0].name)
9920 self.assertEqual(None, actionSet.actionSet[0].preHooks)
9921 self.assertEqual(None, actionSet.actionSet[0].postHooks)
9922 self.assertEqual(isdir, actionSet.actionSet[0].function)
9923 self.assertEqual("collect", actionSet.actionSet[1].name)
9924 self.assertEqual(None, actionSet.actionSet[1].preHooks)
9925 self.assertEqual(None, actionSet.actionSet[1].postHooks)
9926 self.assertEqual(executeCollect, actionSet.actionSet[1].function)
9927
9928 def testDependencyMode_135(self):
9929 """
9930 Test with actions=[ collect, one ], extensions=[ (one, before collect) ], pre-hook on "collect" action
9931 """
9932 actions = [
9933 "collect",
9934 "one",
9935 ]
9936 dependencies = ActionDependencies(["collect"], None)
9937 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
9938 options = OptionsConfig()
9939 options.hooks = [
9940 PreActionHook("collect", "something"),
9941 ]
9942 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9943 self.assertTrue(len(actionSet.actionSet) == 2)
9944 self.assertEqual("one", actionSet.actionSet[0].name)
9945 self.assertEqual(None, actionSet.actionSet[0].preHooks)
9946 self.assertEqual(None, actionSet.actionSet[0].postHooks)
9947 self.assertEqual(isdir, actionSet.actionSet[0].function)
9948 self.assertEqual("collect", actionSet.actionSet[1].name)
9949 self.assertEqual([PreActionHook("collect", "something")], actionSet.actionSet[1].preHooks)
9950 self.assertEqual(None, actionSet.actionSet[1].postHooks)
9951 self.assertEqual(executeCollect, actionSet.actionSet[1].function)
9952
9953 def testDependencyMode_136(self):
9954 """
9955 Test with actions=[ collect, one ], extensions=[ (one, before collect) ], post-hook on "collect" action
9956 """
9957 actions = [
9958 "collect",
9959 "one",
9960 ]
9961 dependencies = ActionDependencies(["collect"], [])
9962 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
9963 options = OptionsConfig()
9964 options.hooks = [
9965 PostActionHook("collect", "something"),
9966 ]
9967 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9968 self.assertTrue(len(actionSet.actionSet) == 2)
9969 self.assertEqual("one", actionSet.actionSet[0].name)
9970 self.assertEqual(None, actionSet.actionSet[0].preHooks)
9971 self.assertEqual(None, actionSet.actionSet[0].postHooks)
9972 self.assertEqual(isdir, actionSet.actionSet[0].function)
9973 self.assertEqual("collect", actionSet.actionSet[1].name)
9974 self.assertEqual(None, actionSet.actionSet[1].preHooks)
9975 self.assertEqual([PostActionHook("collect", "something")], actionSet.actionSet[1].postHooks)
9976 self.assertEqual(executeCollect, actionSet.actionSet[1].function)
9977
9978 def testDependencyMode_137(self):
9979 """
9980 Test with actions=[ collect, one ], extensions=[ (one, before collect) ], pre-hook on "one" action
9981 """
9982 actions = [
9983 "collect",
9984 "one",
9985 ]
9986 dependencies = ActionDependencies(["collect"], None)
9987 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
9988 options = OptionsConfig()
9989 options.hooks = [
9990 PreActionHook("one", "extension"),
9991 ]
9992 actionSet = _ActionSet(actions, extensions, options, None, False, True)
9993 self.assertTrue(len(actionSet.actionSet) == 2)
9994 self.assertEqual("one", actionSet.actionSet[0].name)
9995 self.assertEqual([PreActionHook("one", "extension")], actionSet.actionSet[0].preHooks)
9996 self.assertEqual(None, actionSet.actionSet[0].postHooks)
9997 self.assertEqual(isdir, actionSet.actionSet[0].function)
9998 self.assertEqual("collect", actionSet.actionSet[1].name)
9999 self.assertEqual(None, actionSet.actionSet[1].preHooks)
10000 self.assertEqual(None, actionSet.actionSet[1].postHooks)
10001 self.assertEqual(executeCollect, actionSet.actionSet[1].function)
10002
10003 def testDependencyMode_138(self):
10004 """
10005 Test with actions=[ collect, one ], extensions=[ (one, before collect) ], post-hook on "one" action
10006 """
10007 actions = [
10008 "collect",
10009 "one",
10010 ]
10011 dependencies = ActionDependencies(["collect"], [])
10012 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
10013 options = OptionsConfig()
10014 options.hooks = [
10015 PostActionHook("one", "extension"),
10016 ]
10017 actionSet = _ActionSet(actions, extensions, options, None, False, True)
10018 self.assertTrue(len(actionSet.actionSet) == 2)
10019 self.assertEqual("one", actionSet.actionSet[0].name)
10020 self.assertEqual(None, actionSet.actionSet[0].preHooks)
10021 self.assertEqual([PostActionHook("one", "extension")], actionSet.actionSet[0].postHooks)
10022 self.assertEqual(isdir, actionSet.actionSet[0].function)
10023 self.assertEqual("collect", actionSet.actionSet[1].name)
10024 self.assertEqual(None, actionSet.actionSet[1].preHooks)
10025 self.assertEqual(None, actionSet.actionSet[1].postHooks)
10026 self.assertEqual(executeCollect, actionSet.actionSet[1].function)
10027
10028 def testDependencyMode_139a(self):
10029 """
10030 Test with actions=[ collect, one ], extensions=[ (one, before collect) ], set of various pre- and post hooks.
10031 """
10032 actions = [
10033 "collect",
10034 "one",
10035 ]
10036 dependencies = ActionDependencies(["collect"], None)
10037 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
10038 options = OptionsConfig()
10039 options.hooks = [
10040 PostActionHook("one", "extension"),
10041 PreActionHook("collect", "something1"),
10042 PreActionHook("collect", "something2"),
10043 PostActionHook("stage", "whatever"),
10044 ]
10045 actionSet = _ActionSet(actions, extensions, options, None, False, True)
10046 self.assertTrue(len(actionSet.actionSet) == 2)
10047 self.assertEqual("one", actionSet.actionSet[0].name)
10048 self.assertEqual(None, actionSet.actionSet[0].preHooks)
10049 self.assertEqual([PostActionHook("one", "extension")], actionSet.actionSet[0].postHooks)
10050 self.assertEqual(isdir, actionSet.actionSet[0].function)
10051 self.assertEqual("collect", actionSet.actionSet[1].name)
10052 self.assertEqual(
10053 [PreActionHook("collect", "something1"), PreActionHook("collect", "something2")], actionSet.actionSet[1].preHooks
10054 )
10055 self.assertEqual(None, actionSet.actionSet[1].postHooks)
10056 self.assertEqual(executeCollect, actionSet.actionSet[1].function)
10057
10058 def testDependencyMode_139b(self):
10059 """
10060 Test with actions=[ stage, one ], extensions=[ (one, before stage) ], set of various pre- and post hooks.
10061 """
10062 actions = [
10063 "stage",
10064 "one",
10065 ]
10066 dependencies = ActionDependencies(["stage"], None)
10067 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", dependencies=dependencies)], "dependency")
10068 options = OptionsConfig()
10069 options.hooks = [
10070 PostActionHook("one", "extension"),
10071 PreActionHook("collect", "something1"),
10072 PostActionHook("stage", "whatever1"),
10073 PostActionHook("stage", "whatever2"),
10074 ]
10075 actionSet = _ActionSet(actions, extensions, options, None, False, True)
10076 self.assertTrue(len(actionSet.actionSet) == 2)
10077 self.assertEqual("one", actionSet.actionSet[0].name)
10078 self.assertEqual(None, actionSet.actionSet[0].preHooks)
10079 self.assertEqual([PostActionHook("one", "extension")], actionSet.actionSet[0].postHooks)
10080 self.assertEqual(isdir, actionSet.actionSet[0].function)
10081 self.assertEqual("stage", actionSet.actionSet[1].name)
10082 self.assertEqual(None, actionSet.actionSet[1].preHooks)
10083 self.assertEqual(
10084 [PostActionHook("stage", "whatever1"), PostActionHook("stage", "whatever2")], actionSet.actionSet[1].postHooks
10085 )
10086 self.assertEqual(executeStage, actionSet.actionSet[1].function)
10087
10088 def testDependencyMode_140(self):
10089 """
10090 Test with actions=[ one, five, collect, store, three, stage, four, purge, two ],
10091 extensions= [recursive loop].
10092 """
10093 actions = [
10094 "one",
10095 "five",
10096 "collect",
10097 "store",
10098 "three",
10099 "stage",
10100 "four",
10101 "purge",
10102 "two",
10103 ]
10104 dependencies1 = ActionDependencies(["collect", "stage", "store", "purge"], [])
10105 dependencies2 = ActionDependencies(["stage", "store", "purge"], ["collect"])
10106 dependencies3 = ActionDependencies(["store", "purge"], ["collect", "stage"])
10107 dependencies4 = ActionDependencies(["purge"], ["collect", "stage", "store"])
10108 dependencies5 = ActionDependencies(["one"], ["collect", "stage", "store", "purge"])
10109 eaction1 = ExtendedAction("one", "os.path", "isdir", dependencies=dependencies1)
10110 eaction2 = ExtendedAction("two", "os.path", "isfile", dependencies=dependencies2)
10111 eaction3 = ExtendedAction("three", "os.path", "islink", dependencies=dependencies3)
10112 eaction4 = ExtendedAction("four", "os.path", "isabs", dependencies=dependencies4)
10113 eaction5 = ExtendedAction("five", "os.path", "exists", dependencies=dependencies5)
10114 extensions = ExtensionsConfig([eaction1, eaction2, eaction3, eaction4, eaction5], "dependency")
10115 options = OptionsConfig()
10116 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
10117
10118 def testDependencyMode_141(self):
10119 """
10120 Test with actions=[ one, five, collect, store, three, stage, four, purge, two ],
10121 and one extension for which a dependency does not exist.
10122 """
10123 actions = [
10124 "one",
10125 "five",
10126 "collect",
10127 "store",
10128 "three",
10129 "stage",
10130 "four",
10131 "purge",
10132 "two",
10133 ]
10134 dependencies1 = ActionDependencies(["collect", "stage", "store", "purge"], [])
10135 dependencies2 = ActionDependencies(["stage", "store", "purge"], ["collect"])
10136 dependencies3 = ActionDependencies(["store", "bogus"], ["collect", "stage"])
10137 dependencies4 = ActionDependencies(["purge"], ["collect", "stage", "store"])
10138 dependencies5 = ActionDependencies([], ["collect", "stage", "store", "purge"])
10139 eaction1 = ExtendedAction("one", "os.path", "isdir", dependencies=dependencies1)
10140 eaction2 = ExtendedAction("two", "os.path", "isfile", dependencies=dependencies2)
10141 eaction3 = ExtendedAction("three", "os.path", "islink", dependencies=dependencies3)
10142 eaction4 = ExtendedAction("four", "os.path", "isabs", dependencies=dependencies4)
10143 eaction5 = ExtendedAction("five", "os.path", "exists", dependencies=dependencies5)
10144 extensions = ExtensionsConfig([eaction1, eaction2, eaction3, eaction4, eaction5], "dependency")
10145 options = OptionsConfig()
10146 self.assertRaises(ValueError, _ActionSet, actions, extensions, options, None, False, True)
10147
10148 #########################################
10149 # Test constructor, with managed peers
10150 #########################################
10151
10152 def testManagedPeer_001(self):
10153 """
10154 Test with actions=[ collect ], extensions=[], peers=None, managed=True,
10155 local=True
10156 """
10157 actions = [
10158 "collect",
10159 ]
10160 extensions = ExtensionsConfig([], None)
10161 options = OptionsConfig()
10162 options.managedActions = [
10163 "collect",
10164 "purge",
10165 "one",
10166 ]
10167 actionSet = _ActionSet(actions, extensions, options, None, True, True)
10168 self.assertFalse(actionSet.actionSet is None)
10169 self.assertTrue(len(actionSet.actionSet) == 1)
10170 self.assertEqual(100, actionSet.actionSet[0].index)
10171 self.assertEqual("collect", actionSet.actionSet[0].name)
10172 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
10173
10174 def testManagedPeer_002(self):
10175 """
10176 Test with actions=[ stage ], extensions=[], peers=None, managed=True,
10177 local=True
10178 """
10179 actions = [
10180 "stage",
10181 ]
10182 extensions = ExtensionsConfig([], None)
10183 options = OptionsConfig()
10184 options.managedActions = [
10185 "collect",
10186 "purge",
10187 "one",
10188 ]
10189 actionSet = _ActionSet(actions, extensions, options, None, True, True)
10190 self.assertFalse(actionSet.actionSet is None)
10191 self.assertTrue(len(actionSet.actionSet) == 1)
10192 self.assertEqual(200, actionSet.actionSet[0].index)
10193 self.assertEqual("stage", actionSet.actionSet[0].name)
10194 self.assertEqual(executeStage, actionSet.actionSet[0].function)
10195
10196 def testManagedPeer_003(self):
10197 """
10198 Test with actions=[ store ], extensions=[], peers=None, managed=True,
10199 local=True
10200 """
10201 actions = [
10202 "store",
10203 ]
10204 extensions = ExtensionsConfig([], None)
10205 options = OptionsConfig()
10206 options.managedActions = [
10207 "collect",
10208 "purge",
10209 "one",
10210 ]
10211 actionSet = _ActionSet(actions, extensions, options, None, True, True)
10212 self.assertFalse(actionSet.actionSet is None)
10213 self.assertTrue(len(actionSet.actionSet) == 1)
10214 self.assertEqual(300, actionSet.actionSet[0].index)
10215 self.assertEqual("store", actionSet.actionSet[0].name)
10216 self.assertEqual(executeStore, actionSet.actionSet[0].function)
10217
10218 def testManagedPeer_004(self):
10219 """
10220 Test with actions=[ purge ], extensions=[], peers=None, managed=True,
10221 local=True
10222 """
10223 actions = [
10224 "purge",
10225 ]
10226 extensions = ExtensionsConfig([], None)
10227 options = OptionsConfig()
10228 options.managedActions = [
10229 "collect",
10230 "purge",
10231 "one",
10232 ]
10233 actionSet = _ActionSet(actions, extensions, options, None, True, True)
10234 self.assertFalse(actionSet.actionSet is None)
10235 self.assertTrue(len(actionSet.actionSet) == 1)
10236 self.assertEqual(400, actionSet.actionSet[0].index)
10237 self.assertEqual("purge", actionSet.actionSet[0].name)
10238 self.assertEqual(executePurge, actionSet.actionSet[0].function)
10239
10240 def testManagedPeer_005(self):
10241 """
10242 Test with actions=[ all ], extensions=[], peers=None, managed=True,
10243 local=True
10244 """
10245 actions = [
10246 "all",
10247 ]
10248 extensions = ExtensionsConfig([], None)
10249 options = OptionsConfig()
10250 options.managedActions = [
10251 "collect",
10252 "purge",
10253 "one",
10254 ]
10255 actionSet = _ActionSet(actions, extensions, options, None, True, True)
10256 self.assertFalse(actionSet.actionSet is None)
10257 self.assertTrue(len(actionSet.actionSet) == 4)
10258 self.assertEqual(100, actionSet.actionSet[0].index)
10259 self.assertEqual("collect", actionSet.actionSet[0].name)
10260 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
10261 self.assertEqual(200, actionSet.actionSet[1].index)
10262 self.assertEqual("stage", actionSet.actionSet[1].name)
10263 self.assertEqual(executeStage, actionSet.actionSet[1].function)
10264 self.assertEqual(300, actionSet.actionSet[2].index)
10265 self.assertEqual("store", actionSet.actionSet[2].name)
10266 self.assertEqual(executeStore, actionSet.actionSet[2].function)
10267 self.assertEqual(400, actionSet.actionSet[3].index)
10268 self.assertEqual("purge", actionSet.actionSet[3].name)
10269 self.assertEqual(executePurge, actionSet.actionSet[3].function)
10270
10271 def testManagedPeer_006(self):
10272 """
10273 Test with actions=[ rebuild ], extensions=[], peers=None, managed=True,
10274 local=True
10275 """
10276 actions = [
10277 "rebuild",
10278 ]
10279 extensions = ExtensionsConfig([], None)
10280 options = OptionsConfig()
10281 options.managedActions = [
10282 "collect",
10283 "purge",
10284 "one",
10285 ]
10286 actionSet = _ActionSet(actions, extensions, options, None, True, True)
10287 self.assertTrue(len(actionSet.actionSet) == 1)
10288 self.assertEqual(0, actionSet.actionSet[0].index)
10289 self.assertEqual("rebuild", actionSet.actionSet[0].name)
10290 self.assertEqual(executeRebuild, actionSet.actionSet[0].function)
10291
10292 def testManagedPeer_007(self):
10293 """
10294 Test with actions=[ validate ], extensions=[], peers=None, managed=True,
10295 local=True
10296 """
10297 actions = [
10298 "validate",
10299 ]
10300 extensions = ExtensionsConfig([], None)
10301 options = OptionsConfig()
10302 options.managedActions = [
10303 "collect",
10304 "purge",
10305 "one",
10306 ]
10307 actionSet = _ActionSet(actions, extensions, options, None, True, True)
10308 self.assertTrue(len(actionSet.actionSet) == 1)
10309 self.assertEqual(0, actionSet.actionSet[0].index)
10310 self.assertEqual("validate", actionSet.actionSet[0].name)
10311 self.assertEqual(executeValidate, actionSet.actionSet[0].function)
10312
10313 def testManagedPeer_008(self):
10314 """
10315 Test with actions=[ collect, stage ], extensions=[], peers=None,
10316 managed=True, local=True
10317 """
10318 actions = [
10319 "collect",
10320 "stage",
10321 ]
10322 extensions = ExtensionsConfig([], None)
10323 options = OptionsConfig()
10324 options.managedActions = [
10325 "collect",
10326 "purge",
10327 "one",
10328 ]
10329 actionSet = _ActionSet(actions, extensions, options, None, True, True)
10330 self.assertTrue(len(actionSet.actionSet) == 2)
10331 self.assertEqual(100, actionSet.actionSet[0].index)
10332 self.assertEqual("collect", actionSet.actionSet[0].name)
10333 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
10334 self.assertEqual(200, actionSet.actionSet[1].index)
10335 self.assertEqual("stage", actionSet.actionSet[1].name)
10336 self.assertEqual(executeStage, actionSet.actionSet[1].function)
10337
10338 def testManagedPeer_009(self):
10339 """
10340 Test with actions=[ collect, store ], extensions=[], peers=None,
10341 managed=True, local=True
10342 """
10343 actions = [
10344 "collect",
10345 "store",
10346 ]
10347 extensions = ExtensionsConfig([], None)
10348 options = OptionsConfig()
10349 options.managedActions = [
10350 "collect",
10351 "purge",
10352 "one",
10353 ]
10354 actionSet = _ActionSet(actions, extensions, options, None, True, True)
10355 self.assertTrue(len(actionSet.actionSet) == 2)
10356 self.assertEqual(100, actionSet.actionSet[0].index)
10357 self.assertEqual("collect", actionSet.actionSet[0].name)
10358 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
10359 self.assertEqual(300, actionSet.actionSet[1].index)
10360 self.assertEqual("store", actionSet.actionSet[1].name)
10361 self.assertEqual(executeStore, actionSet.actionSet[1].function)
10362
10363 def testManagedPeer_010(self):
10364 """
10365 Test with actions=[ collect, purge ], extensions=[], peers=None,
10366 managed=True, local=True
10367 """
10368 actions = [
10369 "collect",
10370 "purge",
10371 ]
10372 extensions = ExtensionsConfig([], None)
10373 options = OptionsConfig()
10374 options.managedActions = [
10375 "collect",
10376 "purge",
10377 "one",
10378 ]
10379 actionSet = _ActionSet(actions, extensions, options, None, True, True)
10380 self.assertTrue(len(actionSet.actionSet) == 2)
10381 self.assertEqual(100, actionSet.actionSet[0].index)
10382 self.assertEqual("collect", actionSet.actionSet[0].name)
10383 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
10384 self.assertEqual(400, actionSet.actionSet[1].index)
10385 self.assertEqual("purge", actionSet.actionSet[1].name)
10386 self.assertEqual(executePurge, actionSet.actionSet[1].function)
10387
10388 def testManagedPeer_011(self):
10389 """
10390 Test with actions=[ stage, collect ], extensions=[], peers=None,
10391 managed=True, local=True
10392 """
10393 actions = [
10394 "stage",
10395 "collect",
10396 ]
10397 extensions = ExtensionsConfig([], None)
10398 options = OptionsConfig()
10399 options.managedActions = [
10400 "collect",
10401 "purge",
10402 "one",
10403 ]
10404 actionSet = _ActionSet(actions, extensions, options, None, True, True)
10405 self.assertTrue(len(actionSet.actionSet) == 2)
10406 self.assertEqual(100, actionSet.actionSet[0].index)
10407 self.assertEqual("collect", actionSet.actionSet[0].name)
10408 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
10409 self.assertEqual(200, actionSet.actionSet[1].index)
10410 self.assertEqual("stage", actionSet.actionSet[1].name)
10411 self.assertEqual(executeStage, actionSet.actionSet[1].function)
10412
10413 def testManagedPeer_012(self):
10414 """
10415 Test with actions=[ stage, stage ], extensions=[], peers=None,
10416 managed=True, local=True
10417 """
10418 actions = [
10419 "stage",
10420 "stage",
10421 ]
10422 extensions = ExtensionsConfig([], None)
10423 options = OptionsConfig()
10424 options.managedActions = [
10425 "collect",
10426 "purge",
10427 "one",
10428 ]
10429 actionSet = _ActionSet(actions, extensions, options, None, True, True)
10430 self.assertTrue(len(actionSet.actionSet) == 2)
10431 self.assertEqual(200, actionSet.actionSet[0].index)
10432 self.assertEqual("stage", actionSet.actionSet[0].name)
10433 self.assertEqual(executeStage, actionSet.actionSet[0].function)
10434 self.assertEqual(200, actionSet.actionSet[1].index)
10435 self.assertEqual("stage", actionSet.actionSet[1].name)
10436 self.assertEqual(executeStage, actionSet.actionSet[1].function)
10437
10438 def testManagedPeer_013(self):
10439 """
10440 Test with actions=[ stage, store ], extensions=[], peers=None,
10441 managed=True, local=True
10442 """
10443 actions = [
10444 "stage",
10445 "store",
10446 ]
10447 extensions = ExtensionsConfig([], None)
10448 options = OptionsConfig()
10449 options.managedActions = [
10450 "collect",
10451 "purge",
10452 "one",
10453 ]
10454 actionSet = _ActionSet(actions, extensions, options, None, True, True)
10455 self.assertTrue(len(actionSet.actionSet) == 2)
10456 self.assertEqual(200, actionSet.actionSet[0].index)
10457 self.assertEqual("stage", actionSet.actionSet[0].name)
10458 self.assertEqual(executeStage, actionSet.actionSet[0].function)
10459 self.assertEqual(300, actionSet.actionSet[1].index)
10460 self.assertEqual("store", actionSet.actionSet[1].name)
10461 self.assertEqual(executeStore, actionSet.actionSet[1].function)
10462
10463 def testManagedPeer_014(self):
10464 """
10465 Test with actions=[ stage, purge ], extensions=[], peers=None,
10466 managed=True, local=True
10467 """
10468 actions = [
10469 "stage",
10470 "purge",
10471 ]
10472 extensions = ExtensionsConfig([], None)
10473 options = OptionsConfig()
10474 options.managedActions = [
10475 "collect",
10476 "purge",
10477 "one",
10478 ]
10479 actionSet = _ActionSet(actions, extensions, options, None, True, True)
10480 self.assertTrue(len(actionSet.actionSet) == 2)
10481 self.assertEqual(200, actionSet.actionSet[0].index)
10482 self.assertEqual("stage", actionSet.actionSet[0].name)
10483 self.assertEqual(executeStage, actionSet.actionSet[0].function)
10484 self.assertEqual(400, actionSet.actionSet[1].index)
10485 self.assertEqual("purge", actionSet.actionSet[1].name)
10486 self.assertEqual(executePurge, actionSet.actionSet[1].function)
10487
10488 def testManagedPeer_015(self):
10489 """
10490 Test with actions=[ collect, one ], extensions=[ (one, index 50) ],
10491 peers=None, managed=True, local=True
10492 """
10493 actions = [
10494 "collect",
10495 "one",
10496 ]
10497 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
10498 options = OptionsConfig()
10499 options.managedActions = [
10500 "collect",
10501 "purge",
10502 "one",
10503 ]
10504 actionSet = _ActionSet(actions, extensions, options, None, True, True)
10505 self.assertTrue(len(actionSet.actionSet) == 2)
10506 self.assertEqual(50, actionSet.actionSet[0].index)
10507 self.assertEqual("one", actionSet.actionSet[0].name)
10508 self.assertEqual(isdir, actionSet.actionSet[0].function)
10509 self.assertEqual(100, actionSet.actionSet[1].index)
10510 self.assertEqual("collect", actionSet.actionSet[1].name)
10511 self.assertEqual(executeCollect, actionSet.actionSet[1].function)
10512
10513 def testManagedPeer_016(self):
10514 """
10515 Test with actions=[ store, one ], extensions=[ (one, index 50) ],
10516 peers=None, managed=True, local=True
10517 """
10518 actions = [
10519 "store",
10520 "one",
10521 ]
10522 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
10523 options = OptionsConfig()
10524 options.managedActions = [
10525 "collect",
10526 "purge",
10527 "one",
10528 ]
10529 actionSet = _ActionSet(actions, extensions, options, None, True, True)
10530 self.assertTrue(len(actionSet.actionSet) == 2)
10531 self.assertEqual(50, actionSet.actionSet[0].index)
10532 self.assertEqual("one", actionSet.actionSet[0].name)
10533 self.assertEqual(isdir, actionSet.actionSet[0].function)
10534 self.assertEqual(300, actionSet.actionSet[1].index)
10535 self.assertEqual("store", actionSet.actionSet[1].name)
10536 self.assertEqual(executeStore, actionSet.actionSet[1].function)
10537
10538 def testManagedPeer_017(self):
10539 """
10540 Test with actions=[ collect, one ], extensions=[ (one, index 150) ],
10541 peers=None, managed=True, local=True
10542 """
10543 actions = [
10544 "collect",
10545 "one",
10546 ]
10547 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 150)], None)
10548 options = OptionsConfig()
10549 options.managedActions = [
10550 "collect",
10551 "purge",
10552 "one",
10553 ]
10554 actionSet = _ActionSet(actions, extensions, options, None, True, True)
10555 self.assertTrue(len(actionSet.actionSet) == 2)
10556 self.assertEqual(100, actionSet.actionSet[0].index)
10557 self.assertEqual("collect", actionSet.actionSet[0].name)
10558 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
10559 self.assertEqual(150, actionSet.actionSet[1].index)
10560 self.assertEqual("one", actionSet.actionSet[1].name)
10561 self.assertEqual(isdir, actionSet.actionSet[1].function)
10562
10563 def testManagedPeer_018(self):
10564 """
10565 Test with actions=[ store, one ], extensions=[ (one, index 150) ],
10566 peers=None, managed=True, local=True
10567 """
10568 actions = [
10569 "store",
10570 "one",
10571 ]
10572 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 150)], None)
10573 options = OptionsConfig()
10574 options.managedActions = [
10575 "collect",
10576 "purge",
10577 "one",
10578 ]
10579 actionSet = _ActionSet(actions, extensions, options, None, True, True)
10580 self.assertTrue(len(actionSet.actionSet) == 2)
10581 self.assertEqual(150, actionSet.actionSet[0].index)
10582 self.assertEqual("one", actionSet.actionSet[0].name)
10583 self.assertEqual(isdir, actionSet.actionSet[0].function)
10584 self.assertEqual(300, actionSet.actionSet[1].index)
10585 self.assertEqual("store", actionSet.actionSet[1].name)
10586 self.assertEqual(executeStore, actionSet.actionSet[1].function)
10587
10588 def testManagedPeer_019(self):
10589 """
10590 Test with actions=[ collect, stage, store, purge ], extensions=[],
10591 peers=None, managed=True, local=True
10592 """
10593 actions = [
10594 "collect",
10595 "stage",
10596 "store",
10597 "purge",
10598 ]
10599 extensions = ExtensionsConfig([], None)
10600 options = OptionsConfig()
10601 options.managedActions = [
10602 "collect",
10603 "purge",
10604 "one",
10605 ]
10606 actionSet = _ActionSet(actions, extensions, options, None, True, True)
10607 self.assertTrue(len(actionSet.actionSet) == 4)
10608 self.assertEqual(100, actionSet.actionSet[0].index)
10609 self.assertEqual("collect", actionSet.actionSet[0].name)
10610 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
10611 self.assertEqual(200, actionSet.actionSet[1].index)
10612 self.assertEqual("stage", actionSet.actionSet[1].name)
10613 self.assertEqual(executeStage, actionSet.actionSet[1].function)
10614 self.assertEqual(300, actionSet.actionSet[2].index)
10615 self.assertEqual("store", actionSet.actionSet[2].name)
10616 self.assertEqual(executeStore, actionSet.actionSet[2].function)
10617 self.assertEqual(400, actionSet.actionSet[3].index)
10618 self.assertEqual("purge", actionSet.actionSet[3].name)
10619 self.assertEqual(executePurge, actionSet.actionSet[3].function)
10620
10621 def testManagedPeer_020(self):
10622 """
10623 Test with actions=[ collect, stage, store, purge, one, two, three, four,
10624 five ], extensions=[ (index 50, 150, 250, 350, 450)], peers=None,
10625 managed=True, local=True
10626 """
10627 actions = [
10628 "collect",
10629 "stage",
10630 "store",
10631 "purge",
10632 "one",
10633 "two",
10634 "three",
10635 "four",
10636 "five",
10637 ]
10638 extensions = ExtensionsConfig(
10639 [
10640 ExtendedAction("one", "os.path", "isdir", 50),
10641 ExtendedAction("two", "os.path", "isfile", 150),
10642 ExtendedAction("three", "os.path", "islink", 250),
10643 ExtendedAction("four", "os.path", "isabs", 350),
10644 ExtendedAction("five", "os.path", "exists", 450),
10645 ],
10646 None,
10647 )
10648 options = OptionsConfig()
10649 options.managedActions = [
10650 "collect",
10651 "purge",
10652 "one",
10653 ]
10654 actionSet = _ActionSet(actions, extensions, options, None, True, True)
10655 self.assertTrue(len(actionSet.actionSet) == 9)
10656 self.assertEqual(50, actionSet.actionSet[0].index)
10657 self.assertEqual("one", actionSet.actionSet[0].name)
10658 self.assertEqual(isdir, actionSet.actionSet[0].function)
10659 self.assertEqual(100, actionSet.actionSet[1].index)
10660 self.assertEqual("collect", actionSet.actionSet[1].name)
10661 self.assertEqual(executeCollect, actionSet.actionSet[1].function)
10662 self.assertEqual(150, actionSet.actionSet[2].index)
10663 self.assertEqual("two", actionSet.actionSet[2].name)
10664 self.assertEqual(isfile, actionSet.actionSet[2].function)
10665 self.assertEqual(200, actionSet.actionSet[3].index)
10666 self.assertEqual("stage", actionSet.actionSet[3].name)
10667 self.assertEqual(executeStage, actionSet.actionSet[3].function)
10668 self.assertEqual(250, actionSet.actionSet[4].index)
10669 self.assertEqual("three", actionSet.actionSet[4].name)
10670 self.assertEqual(islink, actionSet.actionSet[4].function)
10671 self.assertEqual(300, actionSet.actionSet[5].index)
10672 self.assertEqual("store", actionSet.actionSet[5].name)
10673 self.assertEqual(executeStore, actionSet.actionSet[5].function)
10674 self.assertEqual(350, actionSet.actionSet[6].index)
10675 self.assertEqual("four", actionSet.actionSet[6].name)
10676 self.assertEqual(isabs, actionSet.actionSet[6].function)
10677 self.assertEqual(400, actionSet.actionSet[7].index)
10678 self.assertEqual("purge", actionSet.actionSet[7].name)
10679 self.assertEqual(executePurge, actionSet.actionSet[7].function)
10680 self.assertEqual(450, actionSet.actionSet[8].index)
10681 self.assertEqual("five", actionSet.actionSet[8].name)
10682 self.assertEqual(exists, actionSet.actionSet[8].function)
10683
10684 def testManagedPeer_021(self):
10685 """
10686 Test with actions=[ one ], extensions=[ (one, index 50) ], peers=None,
10687 managed=True, local=True
10688 """
10689 actions = [
10690 "one",
10691 ]
10692 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
10693 options = OptionsConfig()
10694 options.managedActions = [
10695 "collect",
10696 "purge",
10697 "one",
10698 ]
10699 actionSet = _ActionSet(actions, extensions, options, None, True, True)
10700 self.assertTrue(len(actionSet.actionSet) == 1)
10701 self.assertEqual(50, actionSet.actionSet[0].index)
10702 self.assertEqual("one", actionSet.actionSet[0].name)
10703 self.assertEqual(isdir, actionSet.actionSet[0].function)
10704
10705 def testManagedPeer_022(self):
10706 """
10707 Test with actions=[ collect ], extensions=[], no peers, managed=True,
10708 local=True
10709 """
10710 actions = [
10711 "collect",
10712 ]
10713 extensions = ExtensionsConfig([], None)
10714 options = OptionsConfig()
10715 options.managedActions = [
10716 "collect",
10717 "purge",
10718 "one",
10719 ]
10720 peers = PeersConfig()
10721 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
10722 self.assertFalse(actionSet.actionSet is None)
10723 self.assertTrue(len(actionSet.actionSet) == 1)
10724 self.assertEqual(100, actionSet.actionSet[0].index)
10725 self.assertEqual("collect", actionSet.actionSet[0].name)
10726 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
10727
10728 def testManagedPeer_023(self):
10729 """
10730 Test with actions=[ stage ], extensions=[], no peers, managed=True,
10731 local=True
10732 """
10733 actions = [
10734 "stage",
10735 ]
10736 extensions = ExtensionsConfig([], None)
10737 options = OptionsConfig()
10738 options.managedActions = [
10739 "collect",
10740 "purge",
10741 "one",
10742 ]
10743 peers = PeersConfig()
10744 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
10745 self.assertFalse(actionSet.actionSet is None)
10746 self.assertTrue(len(actionSet.actionSet) == 1)
10747 self.assertEqual(200, actionSet.actionSet[0].index)
10748 self.assertEqual("stage", actionSet.actionSet[0].name)
10749 self.assertEqual(executeStage, actionSet.actionSet[0].function)
10750
10751 def testManagedPeer_024(self):
10752 """
10753 Test with actions=[ store ], extensions=[], no peers, managed=True,
10754 local=True
10755 """
10756 actions = [
10757 "store",
10758 ]
10759 extensions = ExtensionsConfig([], None)
10760 options = OptionsConfig()
10761 options.managedActions = [
10762 "collect",
10763 "purge",
10764 "one",
10765 ]
10766 peers = PeersConfig()
10767 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
10768 self.assertFalse(actionSet.actionSet is None)
10769 self.assertTrue(len(actionSet.actionSet) == 1)
10770 self.assertEqual(300, actionSet.actionSet[0].index)
10771 self.assertEqual("store", actionSet.actionSet[0].name)
10772 self.assertEqual(executeStore, actionSet.actionSet[0].function)
10773
10774 def testManagedPeer_025(self):
10775 """
10776 Test with actions=[ purge ], extensions=[], no peers, managed=True,
10777 local=True
10778 """
10779 actions = [
10780 "purge",
10781 ]
10782 extensions = ExtensionsConfig([], None)
10783 options = OptionsConfig()
10784 options.managedActions = [
10785 "collect",
10786 "purge",
10787 "one",
10788 ]
10789 peers = PeersConfig()
10790 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
10791 self.assertFalse(actionSet.actionSet is None)
10792 self.assertTrue(len(actionSet.actionSet) == 1)
10793 self.assertEqual(400, actionSet.actionSet[0].index)
10794 self.assertEqual("purge", actionSet.actionSet[0].name)
10795 self.assertEqual(executePurge, actionSet.actionSet[0].function)
10796
10797 def testManagedPeer_026(self):
10798 """
10799 Test with actions=[ all ], extensions=[], no peers, managed=True,
10800 local=True
10801 """
10802 actions = [
10803 "all",
10804 ]
10805 extensions = ExtensionsConfig([], None)
10806 options = OptionsConfig()
10807 options.managedActions = [
10808 "collect",
10809 "purge",
10810 "one",
10811 ]
10812 peers = PeersConfig()
10813 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
10814 self.assertFalse(actionSet.actionSet is None)
10815 self.assertTrue(len(actionSet.actionSet) == 4)
10816 self.assertEqual(100, actionSet.actionSet[0].index)
10817 self.assertEqual("collect", actionSet.actionSet[0].name)
10818 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
10819 self.assertEqual(200, actionSet.actionSet[1].index)
10820 self.assertEqual("stage", actionSet.actionSet[1].name)
10821 self.assertEqual(executeStage, actionSet.actionSet[1].function)
10822 self.assertEqual(300, actionSet.actionSet[2].index)
10823 self.assertEqual("store", actionSet.actionSet[2].name)
10824 self.assertEqual(executeStore, actionSet.actionSet[2].function)
10825 self.assertEqual(400, actionSet.actionSet[3].index)
10826 self.assertEqual("purge", actionSet.actionSet[3].name)
10827 self.assertEqual(executePurge, actionSet.actionSet[3].function)
10828
10829 def testManagedPeer_027(self):
10830 """
10831 Test with actions=[ rebuild ], extensions=[], no peers, managed=True,
10832 local=True
10833 """
10834 actions = [
10835 "rebuild",
10836 ]
10837 extensions = ExtensionsConfig([], None)
10838 options = OptionsConfig()
10839 options.managedActions = [
10840 "collect",
10841 "purge",
10842 "one",
10843 ]
10844 peers = PeersConfig()
10845 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
10846 self.assertTrue(len(actionSet.actionSet) == 1)
10847 self.assertEqual(0, actionSet.actionSet[0].index)
10848 self.assertEqual("rebuild", actionSet.actionSet[0].name)
10849 self.assertEqual(executeRebuild, actionSet.actionSet[0].function)
10850
10851 def testManagedPeer_028(self):
10852 """
10853 Test with actions=[ validate ], extensions=[], no peers, managed=True,
10854 local=True
10855 """
10856 actions = [
10857 "validate",
10858 ]
10859 extensions = ExtensionsConfig([], None)
10860 options = OptionsConfig()
10861 options.managedActions = [
10862 "collect",
10863 "purge",
10864 "one",
10865 ]
10866 peers = PeersConfig()
10867 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
10868 self.assertTrue(len(actionSet.actionSet) == 1)
10869 self.assertEqual(0, actionSet.actionSet[0].index)
10870 self.assertEqual("validate", actionSet.actionSet[0].name)
10871 self.assertEqual(executeValidate, actionSet.actionSet[0].function)
10872
10873 def testManagedPeer_029(self):
10874 """
10875 Test with actions=[ collect, stage ], extensions=[], no peers,
10876 managed=True, local=True
10877 """
10878 actions = [
10879 "collect",
10880 "stage",
10881 ]
10882 extensions = ExtensionsConfig([], None)
10883 options = OptionsConfig()
10884 options.managedActions = [
10885 "collect",
10886 "purge",
10887 "one",
10888 ]
10889 peers = PeersConfig()
10890 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
10891 self.assertTrue(len(actionSet.actionSet) == 2)
10892 self.assertEqual(100, actionSet.actionSet[0].index)
10893 self.assertEqual("collect", actionSet.actionSet[0].name)
10894 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
10895 self.assertEqual(200, actionSet.actionSet[1].index)
10896 self.assertEqual("stage", actionSet.actionSet[1].name)
10897 self.assertEqual(executeStage, actionSet.actionSet[1].function)
10898
10899 def testManagedPeer_030(self):
10900 """
10901 Test with actions=[ collect, store ], extensions=[], no peers,
10902 managed=True, local=True
10903 """
10904 actions = [
10905 "collect",
10906 "store",
10907 ]
10908 extensions = ExtensionsConfig([], None)
10909 options = OptionsConfig()
10910 options.managedActions = [
10911 "collect",
10912 "purge",
10913 "one",
10914 ]
10915 peers = PeersConfig()
10916 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
10917 self.assertTrue(len(actionSet.actionSet) == 2)
10918 self.assertEqual(100, actionSet.actionSet[0].index)
10919 self.assertEqual("collect", actionSet.actionSet[0].name)
10920 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
10921 self.assertEqual(300, actionSet.actionSet[1].index)
10922 self.assertEqual("store", actionSet.actionSet[1].name)
10923 self.assertEqual(executeStore, actionSet.actionSet[1].function)
10924
10925 def testManagedPeer_031(self):
10926 """
10927 Test with actions=[ collect, purge ], extensions=[], no peers,
10928 managed=True, local=True
10929 """
10930 actions = [
10931 "collect",
10932 "purge",
10933 ]
10934 extensions = ExtensionsConfig([], None)
10935 options = OptionsConfig()
10936 options.managedActions = [
10937 "collect",
10938 "purge",
10939 "one",
10940 ]
10941 peers = PeersConfig()
10942 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
10943 self.assertTrue(len(actionSet.actionSet) == 2)
10944 self.assertEqual(100, actionSet.actionSet[0].index)
10945 self.assertEqual("collect", actionSet.actionSet[0].name)
10946 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
10947 self.assertEqual(400, actionSet.actionSet[1].index)
10948 self.assertEqual("purge", actionSet.actionSet[1].name)
10949 self.assertEqual(executePurge, actionSet.actionSet[1].function)
10950
10951 def testManagedPeer_032(self):
10952 """
10953 Test with actions=[ stage, collect ], extensions=[], no peers,
10954 managed=True, local=True
10955 """
10956 actions = [
10957 "stage",
10958 "collect",
10959 ]
10960 extensions = ExtensionsConfig([], None)
10961 options = OptionsConfig()
10962 options.managedActions = [
10963 "collect",
10964 "purge",
10965 "one",
10966 ]
10967 peers = PeersConfig()
10968 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
10969 self.assertTrue(len(actionSet.actionSet) == 2)
10970 self.assertEqual(100, actionSet.actionSet[0].index)
10971 self.assertEqual("collect", actionSet.actionSet[0].name)
10972 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
10973 self.assertEqual(200, actionSet.actionSet[1].index)
10974 self.assertEqual("stage", actionSet.actionSet[1].name)
10975 self.assertEqual(executeStage, actionSet.actionSet[1].function)
10976
10977 def testManagedPeer_033(self):
10978 """
10979 Test with actions=[ stage, stage ], extensions=[], no peers,
10980 managed=True, local=True
10981 """
10982 actions = [
10983 "stage",
10984 "stage",
10985 ]
10986 extensions = ExtensionsConfig([], None)
10987 options = OptionsConfig()
10988 options.managedActions = [
10989 "collect",
10990 "purge",
10991 "one",
10992 ]
10993 peers = PeersConfig()
10994 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
10995 self.assertTrue(len(actionSet.actionSet) == 2)
10996 self.assertEqual(200, actionSet.actionSet[0].index)
10997 self.assertEqual("stage", actionSet.actionSet[0].name)
10998 self.assertEqual(executeStage, actionSet.actionSet[0].function)
10999 self.assertEqual(200, actionSet.actionSet[1].index)
11000 self.assertEqual("stage", actionSet.actionSet[1].name)
11001 self.assertEqual(executeStage, actionSet.actionSet[1].function)
11002
11003 def testManagedPeer_034(self):
11004 """
11005 Test with actions=[ stage, store ], extensions=[], no peers,
11006 managed=True, local=True
11007 """
11008 actions = [
11009 "stage",
11010 "store",
11011 ]
11012 extensions = ExtensionsConfig([], None)
11013 options = OptionsConfig()
11014 options.managedActions = [
11015 "collect",
11016 "purge",
11017 "one",
11018 ]
11019 peers = PeersConfig()
11020 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
11021 self.assertTrue(len(actionSet.actionSet) == 2)
11022 self.assertEqual(200, actionSet.actionSet[0].index)
11023 self.assertEqual("stage", actionSet.actionSet[0].name)
11024 self.assertEqual(executeStage, actionSet.actionSet[0].function)
11025 self.assertEqual(300, actionSet.actionSet[1].index)
11026 self.assertEqual("store", actionSet.actionSet[1].name)
11027 self.assertEqual(executeStore, actionSet.actionSet[1].function)
11028
11029 def testManagedPeer_035(self):
11030 """
11031 Test with actions=[ stage, purge ], extensions=[], no peers,
11032 managed=True, local=True
11033 """
11034 actions = [
11035 "stage",
11036 "purge",
11037 ]
11038 extensions = ExtensionsConfig([], None)
11039 options = OptionsConfig()
11040 options.managedActions = [
11041 "collect",
11042 "purge",
11043 "one",
11044 ]
11045 peers = PeersConfig()
11046 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
11047 self.assertTrue(len(actionSet.actionSet) == 2)
11048 self.assertEqual(200, actionSet.actionSet[0].index)
11049 self.assertEqual("stage", actionSet.actionSet[0].name)
11050 self.assertEqual(executeStage, actionSet.actionSet[0].function)
11051 self.assertEqual(400, actionSet.actionSet[1].index)
11052 self.assertEqual("purge", actionSet.actionSet[1].name)
11053 self.assertEqual(executePurge, actionSet.actionSet[1].function)
11054
11055 def testManagedPeer_036(self):
11056 """
11057 Test with actions=[ collect, one ], extensions=[ (one, index 50) ],
11058 no peers, managed=True, local=True
11059 """
11060 actions = [
11061 "collect",
11062 "one",
11063 ]
11064 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
11065 options = OptionsConfig()
11066 options.managedActions = [
11067 "collect",
11068 "purge",
11069 "one",
11070 ]
11071 peers = PeersConfig()
11072 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
11073 self.assertTrue(len(actionSet.actionSet) == 2)
11074 self.assertEqual(50, actionSet.actionSet[0].index)
11075 self.assertEqual("one", actionSet.actionSet[0].name)
11076 self.assertEqual(isdir, actionSet.actionSet[0].function)
11077 self.assertEqual(100, actionSet.actionSet[1].index)
11078 self.assertEqual("collect", actionSet.actionSet[1].name)
11079 self.assertEqual(executeCollect, actionSet.actionSet[1].function)
11080
11081 def testManagedPeer_037(self):
11082 """
11083 Test with actions=[ store, one ], extensions=[ (one, index 50) ],
11084 no peers, managed=True, local=True
11085 """
11086 actions = [
11087 "store",
11088 "one",
11089 ]
11090 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
11091 options = OptionsConfig()
11092 options.managedActions = [
11093 "collect",
11094 "purge",
11095 "one",
11096 ]
11097 peers = PeersConfig()
11098 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
11099 self.assertTrue(len(actionSet.actionSet) == 2)
11100 self.assertEqual(50, actionSet.actionSet[0].index)
11101 self.assertEqual("one", actionSet.actionSet[0].name)
11102 self.assertEqual(isdir, actionSet.actionSet[0].function)
11103 self.assertEqual(300, actionSet.actionSet[1].index)
11104 self.assertEqual("store", actionSet.actionSet[1].name)
11105 self.assertEqual(executeStore, actionSet.actionSet[1].function)
11106
11107 def testManagedPeer_038(self):
11108 """
11109 Test with actions=[ collect, one ], extensions=[ (one, index 150) ],
11110 no peers, managed=True, local=True
11111 """
11112 actions = [
11113 "collect",
11114 "one",
11115 ]
11116 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 150)], None)
11117 options = OptionsConfig()
11118 options.managedActions = [
11119 "collect",
11120 "purge",
11121 "one",
11122 ]
11123 peers = PeersConfig()
11124 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
11125 self.assertTrue(len(actionSet.actionSet) == 2)
11126 self.assertEqual(100, actionSet.actionSet[0].index)
11127 self.assertEqual("collect", actionSet.actionSet[0].name)
11128 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
11129 self.assertEqual(150, actionSet.actionSet[1].index)
11130 self.assertEqual("one", actionSet.actionSet[1].name)
11131 self.assertEqual(isdir, actionSet.actionSet[1].function)
11132
11133 def testManagedPeer_039(self):
11134 """
11135 Test with actions=[ store, one ], extensions=[ (one, index 150) ],
11136 no peers, managed=True, local=True
11137 """
11138 actions = [
11139 "store",
11140 "one",
11141 ]
11142 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 150)], None)
11143 options = OptionsConfig()
11144 options.managedActions = [
11145 "collect",
11146 "purge",
11147 "one",
11148 ]
11149 peers = PeersConfig()
11150 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
11151 self.assertTrue(len(actionSet.actionSet) == 2)
11152 self.assertEqual(150, actionSet.actionSet[0].index)
11153 self.assertEqual("one", actionSet.actionSet[0].name)
11154 self.assertEqual(isdir, actionSet.actionSet[0].function)
11155 self.assertEqual(300, actionSet.actionSet[1].index)
11156 self.assertEqual("store", actionSet.actionSet[1].name)
11157 self.assertEqual(executeStore, actionSet.actionSet[1].function)
11158
11159 def testManagedPeer_040(self):
11160 """
11161 Test with actions=[ collect, stage, store, purge ], extensions=[],
11162 no peers, managed=True, local=True
11163 """
11164 actions = [
11165 "collect",
11166 "stage",
11167 "store",
11168 "purge",
11169 ]
11170 extensions = ExtensionsConfig([], None)
11171 options = OptionsConfig()
11172 options.managedActions = [
11173 "collect",
11174 "purge",
11175 "one",
11176 ]
11177 peers = PeersConfig()
11178 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
11179 self.assertTrue(len(actionSet.actionSet) == 4)
11180 self.assertEqual(100, actionSet.actionSet[0].index)
11181 self.assertEqual("collect", actionSet.actionSet[0].name)
11182 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
11183 self.assertEqual(200, actionSet.actionSet[1].index)
11184 self.assertEqual("stage", actionSet.actionSet[1].name)
11185 self.assertEqual(executeStage, actionSet.actionSet[1].function)
11186 self.assertEqual(300, actionSet.actionSet[2].index)
11187 self.assertEqual("store", actionSet.actionSet[2].name)
11188 self.assertEqual(executeStore, actionSet.actionSet[2].function)
11189 self.assertEqual(400, actionSet.actionSet[3].index)
11190 self.assertEqual("purge", actionSet.actionSet[3].name)
11191 self.assertEqual(executePurge, actionSet.actionSet[3].function)
11192
11193 def testManagedPeer_041(self):
11194 """
11195 Test with actions=[ collect, stage, store, purge, one, two, three, four,
11196 five ], extensions=[ (index 50, 150, 250, 350, 450)], no peers,
11197 managed=True, local=True
11198 """
11199 actions = [
11200 "collect",
11201 "stage",
11202 "store",
11203 "purge",
11204 "one",
11205 "two",
11206 "three",
11207 "four",
11208 "five",
11209 ]
11210 extensions = ExtensionsConfig(
11211 [
11212 ExtendedAction("one", "os.path", "isdir", 50),
11213 ExtendedAction("two", "os.path", "isfile", 150),
11214 ExtendedAction("three", "os.path", "islink", 250),
11215 ExtendedAction("four", "os.path", "isabs", 350),
11216 ExtendedAction("five", "os.path", "exists", 450),
11217 ],
11218 None,
11219 )
11220 options = OptionsConfig()
11221 options.managedActions = [
11222 "collect",
11223 "purge",
11224 "one",
11225 ]
11226 peers = PeersConfig()
11227 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
11228 self.assertTrue(len(actionSet.actionSet) == 9)
11229 self.assertEqual(50, actionSet.actionSet[0].index)
11230 self.assertEqual("one", actionSet.actionSet[0].name)
11231 self.assertEqual(isdir, actionSet.actionSet[0].function)
11232 self.assertEqual(100, actionSet.actionSet[1].index)
11233 self.assertEqual("collect", actionSet.actionSet[1].name)
11234 self.assertEqual(executeCollect, actionSet.actionSet[1].function)
11235 self.assertEqual(150, actionSet.actionSet[2].index)
11236 self.assertEqual("two", actionSet.actionSet[2].name)
11237 self.assertEqual(isfile, actionSet.actionSet[2].function)
11238 self.assertEqual(200, actionSet.actionSet[3].index)
11239 self.assertEqual("stage", actionSet.actionSet[3].name)
11240 self.assertEqual(executeStage, actionSet.actionSet[3].function)
11241 self.assertEqual(250, actionSet.actionSet[4].index)
11242 self.assertEqual("three", actionSet.actionSet[4].name)
11243 self.assertEqual(islink, actionSet.actionSet[4].function)
11244 self.assertEqual(300, actionSet.actionSet[5].index)
11245 self.assertEqual("store", actionSet.actionSet[5].name)
11246 self.assertEqual(executeStore, actionSet.actionSet[5].function)
11247 self.assertEqual(350, actionSet.actionSet[6].index)
11248 self.assertEqual("four", actionSet.actionSet[6].name)
11249 self.assertEqual(isabs, actionSet.actionSet[6].function)
11250 self.assertEqual(400, actionSet.actionSet[7].index)
11251 self.assertEqual("purge", actionSet.actionSet[7].name)
11252 self.assertEqual(executePurge, actionSet.actionSet[7].function)
11253 self.assertEqual(450, actionSet.actionSet[8].index)
11254 self.assertEqual("five", actionSet.actionSet[8].name)
11255 self.assertEqual(exists, actionSet.actionSet[8].function)
11256
11257 def testManagedPeer_042(self):
11258 """
11259 Test with actions=[ one ], extensions=[ (one, index 50) ], no peers,
11260 managed=True, local=True
11261 """
11262 actions = [
11263 "one",
11264 ]
11265 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
11266 options = OptionsConfig()
11267 options.managedActions = [
11268 "collect",
11269 "purge",
11270 "one",
11271 ]
11272 peers = PeersConfig()
11273 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
11274 self.assertTrue(len(actionSet.actionSet) == 1)
11275 self.assertEqual(50, actionSet.actionSet[0].index)
11276 self.assertEqual("one", actionSet.actionSet[0].name)
11277 self.assertEqual(isdir, actionSet.actionSet[0].function)
11278
11279 def testManagedPeer_043(self):
11280 """
11281 Test with actions=[ collect ], extensions=[], no peers, managed=True,
11282 local=False
11283 """
11284 actions = [
11285 "collect",
11286 ]
11287 extensions = ExtensionsConfig([], None)
11288 options = OptionsConfig()
11289 options.managedActions = [
11290 "collect",
11291 "purge",
11292 "one",
11293 ]
11294 peers = PeersConfig()
11295 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
11296 self.assertFalse(actionSet.actionSet is None)
11297 self.assertTrue(len(actionSet.actionSet) == 0)
11298
11299 def testManagedPeer_044(self):
11300 """
11301 Test with actions=[ stage ], extensions=[], no peers, managed=True,
11302 local=False
11303 """
11304 actions = [
11305 "stage",
11306 ]
11307 extensions = ExtensionsConfig([], None)
11308 options = OptionsConfig()
11309 options.managedActions = [
11310 "collect",
11311 "purge",
11312 "one",
11313 ]
11314 peers = PeersConfig()
11315 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
11316 self.assertFalse(actionSet.actionSet is None)
11317 self.assertTrue(len(actionSet.actionSet) == 0)
11318
11319 def testManagedPeer_045(self):
11320 """
11321 Test with actions=[ store ], extensions=[], no peers, managed=True,
11322 local=False
11323 """
11324 actions = [
11325 "store",
11326 ]
11327 extensions = ExtensionsConfig([], None)
11328 options = OptionsConfig()
11329 options.managedActions = [
11330 "collect",
11331 "purge",
11332 "one",
11333 ]
11334 peers = PeersConfig()
11335 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
11336 self.assertFalse(actionSet.actionSet is None)
11337 self.assertTrue(len(actionSet.actionSet) == 0)
11338
11339 def testManagedPeer_046(self):
11340 """
11341 Test with actions=[ purge ], extensions=[], no peers, managed=True,
11342 local=False
11343 """
11344 actions = [
11345 "purge",
11346 ]
11347 extensions = ExtensionsConfig([], None)
11348 options = OptionsConfig()
11349 options.managedActions = [
11350 "collect",
11351 "purge",
11352 "one",
11353 ]
11354 peers = PeersConfig()
11355 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
11356 self.assertFalse(actionSet.actionSet is None)
11357 self.assertTrue(len(actionSet.actionSet) == 0)
11358
11359 def testManagedPeer_047(self):
11360 """
11361 Test with actions=[ all ], extensions=[], no peers, managed=True,
11362 local=False
11363 """
11364 actions = [
11365 "all",
11366 ]
11367 extensions = ExtensionsConfig([], None)
11368 options = OptionsConfig()
11369 options.managedActions = [
11370 "collect",
11371 "purge",
11372 "one",
11373 ]
11374 peers = PeersConfig()
11375 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
11376 self.assertFalse(actionSet.actionSet is None)
11377 self.assertTrue(len(actionSet.actionSet) == 0)
11378
11379 def testManagedPeer_048(self):
11380 """
11381 Test with actions=[ rebuild ], extensions=[], no peers, managed=True,
11382 local=False
11383 """
11384 actions = [
11385 "rebuild",
11386 ]
11387 extensions = ExtensionsConfig([], None)
11388 options = OptionsConfig()
11389 options.managedActions = [
11390 "collect",
11391 "purge",
11392 "one",
11393 ]
11394 peers = PeersConfig()
11395 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
11396 self.assertTrue(len(actionSet.actionSet) == 0)
11397
11398 def testManagedPeer_049(self):
11399 """
11400 Test with actions=[ validate ], extensions=[], no peers, managed=True,
11401 local=False
11402 """
11403 actions = [
11404 "validate",
11405 ]
11406 extensions = ExtensionsConfig([], None)
11407 options = OptionsConfig()
11408 options.managedActions = [
11409 "collect",
11410 "purge",
11411 "one",
11412 ]
11413 peers = PeersConfig()
11414 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
11415 self.assertTrue(len(actionSet.actionSet) == 0)
11416
11417 def testManagedPeer_050(self):
11418 """
11419 Test with actions=[ collect, stage ], extensions=[], no peers,
11420 managed=True, local=False
11421 """
11422 actions = [
11423 "collect",
11424 "stage",
11425 ]
11426 extensions = ExtensionsConfig([], None)
11427 options = OptionsConfig()
11428 options.managedActions = [
11429 "collect",
11430 "purge",
11431 "one",
11432 ]
11433 peers = PeersConfig()
11434 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
11435 self.assertTrue(len(actionSet.actionSet) == 0)
11436
11437 def testManagedPeer_051(self):
11438 """
11439 Test with actions=[ collect, store ], extensions=[], no peers,
11440 managed=True, local=False
11441 """
11442 actions = [
11443 "collect",
11444 "store",
11445 ]
11446 extensions = ExtensionsConfig([], None)
11447 options = OptionsConfig()
11448 options.managedActions = [
11449 "collect",
11450 "purge",
11451 "one",
11452 ]
11453 peers = PeersConfig()
11454 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
11455 self.assertTrue(len(actionSet.actionSet) == 0)
11456
11457 def testManagedPeer_052(self):
11458 """
11459 Test with actions=[ collect, purge ], extensions=[], no peers,
11460 managed=True, local=False
11461 """
11462 actions = [
11463 "collect",
11464 "purge",
11465 ]
11466 extensions = ExtensionsConfig([], None)
11467 options = OptionsConfig()
11468 options.managedActions = [
11469 "collect",
11470 "purge",
11471 "one",
11472 ]
11473 peers = PeersConfig()
11474 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
11475 self.assertTrue(len(actionSet.actionSet) == 0)
11476
11477 def testManagedPeer_053(self):
11478 """
11479 Test with actions=[ stage, collect ], extensions=[], no peers,
11480 managed=True, local=False
11481 """
11482 actions = [
11483 "stage",
11484 "collect",
11485 ]
11486 extensions = ExtensionsConfig([], None)
11487 options = OptionsConfig()
11488 options.managedActions = [
11489 "collect",
11490 "purge",
11491 "one",
11492 ]
11493 peers = PeersConfig()
11494 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
11495 self.assertTrue(len(actionSet.actionSet) == 0)
11496
11497 def testManagedPeer_054(self):
11498 """
11499 Test with actions=[ stage, stage ], extensions=[], no peers,
11500 managed=True, local=False
11501 """
11502 actions = [
11503 "stage",
11504 "stage",
11505 ]
11506 extensions = ExtensionsConfig([], None)
11507 options = OptionsConfig()
11508 options.managedActions = [
11509 "collect",
11510 "purge",
11511 "one",
11512 ]
11513 peers = PeersConfig()
11514 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
11515 self.assertTrue(len(actionSet.actionSet) == 0)
11516
11517 def testManagedPeer_055(self):
11518 """
11519 Test with actions=[ stage, store ], extensions=[], no peers,
11520 managed=True, local=False
11521 """
11522 actions = [
11523 "stage",
11524 "store",
11525 ]
11526 extensions = ExtensionsConfig([], None)
11527 options = OptionsConfig()
11528 options.managedActions = [
11529 "collect",
11530 "purge",
11531 "one",
11532 ]
11533 peers = PeersConfig()
11534 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
11535 self.assertTrue(len(actionSet.actionSet) == 0)
11536
11537 def testManagedPeer_056(self):
11538 """
11539 Test with actions=[ stage, purge ], extensions=[], no peers,
11540 managed=True, local=False
11541 """
11542 actions = [
11543 "stage",
11544 "purge",
11545 ]
11546 extensions = ExtensionsConfig([], None)
11547 options = OptionsConfig()
11548 options.managedActions = [
11549 "collect",
11550 "purge",
11551 "one",
11552 ]
11553 peers = PeersConfig()
11554 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
11555 self.assertTrue(len(actionSet.actionSet) == 0)
11556
11557 def testManagedPeer_057(self):
11558 """
11559 Test with actions=[ collect, one ], extensions=[ (one, index 50) ],
11560 no peers, managed=True, local=False
11561 """
11562 actions = [
11563 "collect",
11564 "one",
11565 ]
11566 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
11567 options = OptionsConfig()
11568 options.managedActions = [
11569 "collect",
11570 "purge",
11571 "one",
11572 ]
11573 peers = PeersConfig()
11574 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
11575 self.assertTrue(len(actionSet.actionSet) == 0)
11576
11577 def testManagedPeer_058(self):
11578 """
11579 Test with actions=[ store, one ], extensions=[ (one, index 50) ],
11580 no peers, managed=True, local=False
11581 """
11582 actions = [
11583 "store",
11584 "one",
11585 ]
11586 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
11587 options = OptionsConfig()
11588 options.managedActions = [
11589 "collect",
11590 "purge",
11591 "one",
11592 ]
11593 peers = PeersConfig()
11594 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
11595 self.assertTrue(len(actionSet.actionSet) == 0)
11596
11597 def testManagedPeer_059(self):
11598 """
11599 Test with actions=[ collect, one ], extensions=[ (one, index 150) ],
11600 no peers, managed=True, local=False
11601 """
11602 actions = [
11603 "collect",
11604 "one",
11605 ]
11606 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 150)], None)
11607 options = OptionsConfig()
11608 options.managedActions = [
11609 "collect",
11610 "purge",
11611 "one",
11612 ]
11613 peers = PeersConfig()
11614 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
11615 self.assertTrue(len(actionSet.actionSet) == 0)
11616
11617 def testManagedPeer_060(self):
11618 """
11619 Test with actions=[ store, one ], extensions=[ (one, index 150) ],
11620 no peers, managed=True, local=False
11621 """
11622 actions = [
11623 "store",
11624 "one",
11625 ]
11626 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 150)], None)
11627 options = OptionsConfig()
11628 options.managedActions = [
11629 "collect",
11630 "purge",
11631 "one",
11632 ]
11633 peers = PeersConfig()
11634 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
11635 self.assertTrue(len(actionSet.actionSet) == 0)
11636
11637 def testManagedPeer_061(self):
11638 """
11639 Test with actions=[ collect, stage, store, purge ], extensions=[],
11640 no peers, managed=True, local=False
11641 """
11642 actions = [
11643 "collect",
11644 "stage",
11645 "store",
11646 "purge",
11647 ]
11648 extensions = ExtensionsConfig([], None)
11649 options = OptionsConfig()
11650 options.managedActions = [
11651 "collect",
11652 "purge",
11653 "one",
11654 ]
11655 peers = PeersConfig()
11656 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
11657 self.assertTrue(len(actionSet.actionSet) == 0)
11658
11659 def testManagedPeer_062(self):
11660 """
11661 Test with actions=[ collect, stage, store, purge, one, two, three, four,
11662 five ], extensions=[ (index 50, 150, 250, 350, 450)], no peers,
11663 managed=True, local=False
11664 """
11665 actions = [
11666 "collect",
11667 "stage",
11668 "store",
11669 "purge",
11670 "one",
11671 "two",
11672 "three",
11673 "four",
11674 "five",
11675 ]
11676 extensions = ExtensionsConfig(
11677 [
11678 ExtendedAction("one", "os.path", "isdir", 50),
11679 ExtendedAction("two", "os.path", "isfile", 150),
11680 ExtendedAction("three", "os.path", "islink", 250),
11681 ExtendedAction("four", "os.path", "isabs", 350),
11682 ExtendedAction("five", "os.path", "exists", 450),
11683 ],
11684 None,
11685 )
11686 options = OptionsConfig()
11687 options.managedActions = [
11688 "collect",
11689 "purge",
11690 "one",
11691 ]
11692 peers = PeersConfig()
11693 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
11694 self.assertTrue(len(actionSet.actionSet) == 0)
11695
11696 def testManagedPeer_063(self):
11697 """
11698 Test with actions=[ one ], extensions=[ (one, index 50) ], no peers,
11699 managed=True, local=False
11700 """
11701 actions = [
11702 "one",
11703 ]
11704 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
11705 options = OptionsConfig()
11706 options.managedActions = [
11707 "collect",
11708 "purge",
11709 "one",
11710 ]
11711 peers = PeersConfig()
11712 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
11713 self.assertTrue(len(actionSet.actionSet) == 0)
11714
11715 def testManagedPeer_064(self):
11716 """
11717 Test with actions=[ collect ], extensions=[], one peer (not managed), managed=True,
11718 local=False
11719 """
11720 actions = [
11721 "collect",
11722 ]
11723 extensions = ExtensionsConfig([], None)
11724 options = OptionsConfig()
11725 options.managedActions = [
11726 "collect",
11727 "purge",
11728 "one",
11729 ]
11730 peers = PeersConfig()
11731 peers.localPeers = [
11732 LocalPeer("local", "/collect"),
11733 ]
11734 peers.remotePeers = [
11735 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=False),
11736 ]
11737 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
11738 self.assertFalse(actionSet.actionSet is None)
11739 self.assertTrue(len(actionSet.actionSet) == 0)
11740
11741 def testManagedPeer_065(self):
11742 """
11743 Test with actions=[ stage ], extensions=[], one peer (not managed), managed=True,
11744 local=False
11745 """
11746 actions = [
11747 "stage",
11748 ]
11749 extensions = ExtensionsConfig([], None)
11750 options = OptionsConfig()
11751 options.managedActions = [
11752 "collect",
11753 "purge",
11754 "one",
11755 ]
11756 peers = PeersConfig()
11757 peers.localPeers = [
11758 LocalPeer("local", "/collect"),
11759 ]
11760 peers.remotePeers = [
11761 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=False),
11762 ]
11763 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
11764 self.assertFalse(actionSet.actionSet is None)
11765 self.assertTrue(len(actionSet.actionSet) == 0)
11766
11767 def testManagedPeer_066(self):
11768 """
11769 Test with actions=[ store ], extensions=[], one peer (not managed), managed=True,
11770 local=False
11771 """
11772 actions = [
11773 "store",
11774 ]
11775 extensions = ExtensionsConfig([], None)
11776 options = OptionsConfig()
11777 options.managedActions = [
11778 "collect",
11779 "purge",
11780 "one",
11781 ]
11782 peers = PeersConfig()
11783 peers.localPeers = [
11784 LocalPeer("local", "/collect"),
11785 ]
11786 peers.remotePeers = [
11787 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=False),
11788 ]
11789 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
11790 self.assertFalse(actionSet.actionSet is None)
11791 self.assertTrue(len(actionSet.actionSet) == 0)
11792
11793 def testManagedPeer_067(self):
11794 """
11795 Test with actions=[ purge ], extensions=[], one peer (not managed), managed=True,
11796 local=False
11797 """
11798 actions = [
11799 "purge",
11800 ]
11801 extensions = ExtensionsConfig([], None)
11802 options = OptionsConfig()
11803 options.managedActions = [
11804 "collect",
11805 "purge",
11806 "one",
11807 ]
11808 peers = PeersConfig()
11809 peers.localPeers = [
11810 LocalPeer("local", "/collect"),
11811 ]
11812 peers.remotePeers = [
11813 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=False),
11814 ]
11815 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
11816 self.assertFalse(actionSet.actionSet is None)
11817 self.assertTrue(len(actionSet.actionSet) == 0)
11818
11819 def testManagedPeer_068(self):
11820 """
11821 Test with actions=[ all ], extensions=[], one peer (not managed), managed=True,
11822 local=False
11823 """
11824 actions = [
11825 "all",
11826 ]
11827 extensions = ExtensionsConfig([], None)
11828 options = OptionsConfig()
11829 options.managedActions = [
11830 "collect",
11831 "purge",
11832 "one",
11833 ]
11834 peers = PeersConfig()
11835 peers.localPeers = [
11836 LocalPeer("local", "/collect"),
11837 ]
11838 peers.remotePeers = [
11839 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=False),
11840 ]
11841 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
11842 self.assertFalse(actionSet.actionSet is None)
11843 self.assertTrue(len(actionSet.actionSet) == 0)
11844
11845 def testManagedPeer_069(self):
11846 """
11847 Test with actions=[ rebuild ], extensions=[], one peer (not managed), managed=True,
11848 local=False
11849 """
11850 actions = [
11851 "rebuild",
11852 ]
11853 extensions = ExtensionsConfig([], None)
11854 options = OptionsConfig()
11855 options.managedActions = [
11856 "collect",
11857 "purge",
11858 "one",
11859 ]
11860 peers = PeersConfig()
11861 peers.localPeers = [
11862 LocalPeer("local", "/collect"),
11863 ]
11864 peers.remotePeers = [
11865 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=False),
11866 ]
11867 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
11868 self.assertTrue(len(actionSet.actionSet) == 0)
11869
11870 def testManagedPeer_070(self):
11871 """
11872 Test with actions=[ validate ], extensions=[], one peer (not managed), managed=True,
11873 local=False
11874 """
11875 actions = [
11876 "validate",
11877 ]
11878 extensions = ExtensionsConfig([], None)
11879 options = OptionsConfig()
11880 options.managedActions = [
11881 "collect",
11882 "purge",
11883 "one",
11884 ]
11885 peers = PeersConfig()
11886 peers.localPeers = [
11887 LocalPeer("local", "/collect"),
11888 ]
11889 peers.remotePeers = [
11890 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=False),
11891 ]
11892 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
11893 self.assertTrue(len(actionSet.actionSet) == 0)
11894
11895 def testManagedPeer_071(self):
11896 """
11897 Test with actions=[ collect, stage ], extensions=[], one peer (not managed),
11898 managed=True, local=False
11899 """
11900 actions = [
11901 "collect",
11902 "stage",
11903 ]
11904 extensions = ExtensionsConfig([], None)
11905 options = OptionsConfig()
11906 options.managedActions = [
11907 "collect",
11908 "purge",
11909 "one",
11910 ]
11911 peers = PeersConfig()
11912 peers.localPeers = [
11913 LocalPeer("local", "/collect"),
11914 ]
11915 peers.remotePeers = [
11916 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=False),
11917 ]
11918 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
11919 self.assertTrue(len(actionSet.actionSet) == 0)
11920
11921 def testManagedPeer_072(self):
11922 """
11923 Test with actions=[ collect, store ], extensions=[], one peer (not managed),
11924 managed=True, local=False
11925 """
11926 actions = [
11927 "collect",
11928 "store",
11929 ]
11930 extensions = ExtensionsConfig([], None)
11931 options = OptionsConfig()
11932 options.managedActions = [
11933 "collect",
11934 "purge",
11935 "one",
11936 ]
11937 peers = PeersConfig()
11938 peers.localPeers = [
11939 LocalPeer("local", "/collect"),
11940 ]
11941 peers.remotePeers = [
11942 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=False),
11943 ]
11944 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
11945 self.assertTrue(len(actionSet.actionSet) == 0)
11946
11947 def testManagedPeer_073(self):
11948 """
11949 Test with actions=[ collect, purge ], extensions=[], one peer (not managed),
11950 managed=True, local=False
11951 """
11952 actions = [
11953 "collect",
11954 "purge",
11955 ]
11956 extensions = ExtensionsConfig([], None)
11957 options = OptionsConfig()
11958 options.managedActions = [
11959 "collect",
11960 "purge",
11961 "one",
11962 ]
11963 peers = PeersConfig()
11964 peers.localPeers = [
11965 LocalPeer("local", "/collect"),
11966 ]
11967 peers.remotePeers = [
11968 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=False),
11969 ]
11970 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
11971 self.assertTrue(len(actionSet.actionSet) == 0)
11972
11973 def testManagedPeer_074(self):
11974 """
11975 Test with actions=[ stage, collect ], extensions=[], one peer (not managed),
11976 managed=True, local=False
11977 """
11978 actions = [
11979 "stage",
11980 "collect",
11981 ]
11982 extensions = ExtensionsConfig([], None)
11983 options = OptionsConfig()
11984 options.managedActions = [
11985 "collect",
11986 "purge",
11987 "one",
11988 ]
11989 peers = PeersConfig()
11990 peers.localPeers = [
11991 LocalPeer("local", "/collect"),
11992 ]
11993 peers.remotePeers = [
11994 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=False),
11995 ]
11996 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
11997 self.assertTrue(len(actionSet.actionSet) == 0)
11998
11999 def testManagedPeer_075(self):
12000 """
12001 Test with actions=[ stage, stage ], extensions=[], one peer (not managed),
12002 managed=True, local=False
12003 """
12004 actions = [
12005 "stage",
12006 "stage",
12007 ]
12008 extensions = ExtensionsConfig([], None)
12009 options = OptionsConfig()
12010 options.managedActions = [
12011 "collect",
12012 "purge",
12013 "one",
12014 ]
12015 peers = PeersConfig()
12016 peers.localPeers = [
12017 LocalPeer("local", "/collect"),
12018 ]
12019 peers.remotePeers = [
12020 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=False),
12021 ]
12022 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
12023 self.assertTrue(len(actionSet.actionSet) == 0)
12024
12025 def testManagedPeer_076(self):
12026 """
12027 Test with actions=[ stage, store ], extensions=[], one peer (not managed),
12028 managed=True, local=False
12029 """
12030 actions = [
12031 "stage",
12032 "store",
12033 ]
12034 extensions = ExtensionsConfig([], None)
12035 options = OptionsConfig()
12036 options.managedActions = [
12037 "collect",
12038 "purge",
12039 "one",
12040 ]
12041 peers = PeersConfig()
12042 peers.localPeers = [
12043 LocalPeer("local", "/collect"),
12044 ]
12045 peers.remotePeers = [
12046 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=False),
12047 ]
12048 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
12049 self.assertTrue(len(actionSet.actionSet) == 0)
12050
12051 def testManagedPeer_077(self):
12052 """
12053 Test with actions=[ stage, purge ], extensions=[], one peer (not managed),
12054 managed=True, local=False
12055 """
12056 actions = [
12057 "stage",
12058 "purge",
12059 ]
12060 extensions = ExtensionsConfig([], None)
12061 options = OptionsConfig()
12062 options.managedActions = [
12063 "collect",
12064 "purge",
12065 "one",
12066 ]
12067 peers = PeersConfig()
12068 peers.localPeers = [
12069 LocalPeer("local", "/collect"),
12070 ]
12071 peers.remotePeers = [
12072 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=False),
12073 ]
12074 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
12075 self.assertTrue(len(actionSet.actionSet) == 0)
12076
12077 def testManagedPeer_078(self):
12078 """
12079 Test with actions=[ collect, one ], extensions=[ (one, index 50) ],
12080 one peer (not managed), managed=True, local=False
12081 """
12082 actions = [
12083 "collect",
12084 "one",
12085 ]
12086 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
12087 options = OptionsConfig()
12088 options.managedActions = [
12089 "collect",
12090 "purge",
12091 "one",
12092 ]
12093 peers = PeersConfig()
12094 peers.localPeers = [
12095 LocalPeer("local", "/collect"),
12096 ]
12097 peers.remotePeers = [
12098 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=False),
12099 ]
12100 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
12101 self.assertTrue(len(actionSet.actionSet) == 0)
12102
12103 def testManagedPeer_079(self):
12104 """
12105 Test with actions=[ store, one ], extensions=[ (one, index 50) ],
12106 one peer (not managed), managed=True, local=False
12107 """
12108 actions = [
12109 "store",
12110 "one",
12111 ]
12112 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
12113 options = OptionsConfig()
12114 options.managedActions = [
12115 "collect",
12116 "purge",
12117 "one",
12118 ]
12119 peers = PeersConfig()
12120 peers.localPeers = [
12121 LocalPeer("local", "/collect"),
12122 ]
12123 peers.remotePeers = [
12124 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=False),
12125 ]
12126 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
12127 self.assertTrue(len(actionSet.actionSet) == 0)
12128
12129 def testManagedPeer_080(self):
12130 """
12131 Test with actions=[ collect, one ], extensions=[ (one, index 150) ],
12132 one peer (not managed), managed=True, local=False
12133 """
12134 actions = [
12135 "collect",
12136 "one",
12137 ]
12138 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 150)], None)
12139 options = OptionsConfig()
12140 options.managedActions = [
12141 "collect",
12142 "purge",
12143 "one",
12144 ]
12145 peers = PeersConfig()
12146 peers.localPeers = [
12147 LocalPeer("local", "/collect"),
12148 ]
12149 peers.remotePeers = [
12150 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=False),
12151 ]
12152 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
12153 self.assertTrue(len(actionSet.actionSet) == 0)
12154
12155 def testManagedPeer_081(self):
12156 """
12157 Test with actions=[ store, one ], extensions=[ (one, index 150) ],
12158 one peer (not managed), managed=True, local=False
12159 """
12160 actions = [
12161 "store",
12162 "one",
12163 ]
12164 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 150)], None)
12165 options = OptionsConfig()
12166 options.managedActions = [
12167 "collect",
12168 "purge",
12169 "one",
12170 ]
12171 peers = PeersConfig()
12172 peers.localPeers = [
12173 LocalPeer("local", "/collect"),
12174 ]
12175 peers.remotePeers = [
12176 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=False),
12177 ]
12178 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
12179 self.assertTrue(len(actionSet.actionSet) == 0)
12180
12181 def testManagedPeer_082(self):
12182 """
12183 Test with actions=[ collect, stage, store, purge ], extensions=[],
12184 one peer (not managed), managed=True, local=False
12185 """
12186 actions = [
12187 "collect",
12188 "stage",
12189 "store",
12190 "purge",
12191 ]
12192 extensions = ExtensionsConfig([], None)
12193 options = OptionsConfig()
12194 options.managedActions = [
12195 "collect",
12196 "purge",
12197 "one",
12198 ]
12199 peers = PeersConfig()
12200 peers.localPeers = [
12201 LocalPeer("local", "/collect"),
12202 ]
12203 peers.remotePeers = [
12204 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=False),
12205 ]
12206 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
12207 self.assertTrue(len(actionSet.actionSet) == 0)
12208
12209 def testManagedPeer_083(self):
12210 """
12211 Test with actions=[ collect, stage, store, purge, one, two, three, four,
12212 five ], extensions=[ (index 50, 150, 250, 350, 450)], one peer (not managed),
12213 managed=True, local=False
12214 """
12215 actions = [
12216 "collect",
12217 "stage",
12218 "store",
12219 "purge",
12220 "one",
12221 "two",
12222 "three",
12223 "four",
12224 "five",
12225 ]
12226 extensions = ExtensionsConfig(
12227 [
12228 ExtendedAction("one", "os.path", "isdir", 50),
12229 ExtendedAction("two", "os.path", "isfile", 150),
12230 ExtendedAction("three", "os.path", "islink", 250),
12231 ExtendedAction("four", "os.path", "isabs", 350),
12232 ExtendedAction("five", "os.path", "exists", 450),
12233 ],
12234 None,
12235 )
12236 options = OptionsConfig()
12237 options.managedActions = [
12238 "collect",
12239 "purge",
12240 "one",
12241 ]
12242 peers = PeersConfig()
12243 peers.localPeers = [
12244 LocalPeer("local", "/collect"),
12245 ]
12246 peers.remotePeers = [
12247 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=False),
12248 ]
12249 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
12250 self.assertTrue(len(actionSet.actionSet) == 0)
12251
12252 def testManagedPeer_084(self):
12253 """
12254 Test with actions=[ one ], extensions=[ (one, index 50) ], one peer (not managed),
12255 managed=True, local=False
12256 """
12257 actions = [
12258 "one",
12259 ]
12260 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
12261 options = OptionsConfig()
12262 options.managedActions = [
12263 "collect",
12264 "purge",
12265 "one",
12266 ]
12267 peers = PeersConfig()
12268 peers.localPeers = [
12269 LocalPeer("local", "/collect"),
12270 ]
12271 peers.remotePeers = [
12272 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=False),
12273 ]
12274 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
12275 self.assertTrue(len(actionSet.actionSet) == 0)
12276
12277 def testManagedPeer_085(self):
12278 """
12279 Test with actions=[ collect ], extensions=[], one peer (managed), managed=True,
12280 local=False
12281 """
12282 actions = [
12283 "collect",
12284 ]
12285 extensions = ExtensionsConfig([], None)
12286 options = OptionsConfig()
12287 options.managedActions = [
12288 "collect",
12289 "purge",
12290 "one",
12291 ]
12292 peers = PeersConfig()
12293 peers.localPeers = [
12294 LocalPeer("local", "/collect"),
12295 ]
12296 peers.remotePeers = [
12297 RemotePeer("remote", None, "ruser", None, "rsh", "cback", managed=True),
12298 ]
12299 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
12300 self.assertFalse(actionSet.actionSet is None)
12301 self.assertTrue(len(actionSet.actionSet) == 1)
12302
12303 self.assertEqual(100, actionSet.actionSet[0].index)
12304 self.assertEqual("collect", actionSet.actionSet[0].name)
12305 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
12306 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 1)
12307 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
12308 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
12309 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
12310 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
12311 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
12312
12313 def testManagedPeer_086(self):
12314 """
12315 Test with actions=[ stage ], extensions=[], one peer (managed), managed=True,
12316 local=False
12317 """
12318 actions = [
12319 "stage",
12320 ]
12321 extensions = ExtensionsConfig([], None)
12322 options = OptionsConfig()
12323 options.managedActions = [
12324 "collect",
12325 "purge",
12326 "one",
12327 ]
12328 peers = PeersConfig()
12329 peers.localPeers = [
12330 LocalPeer("local", "/collect"),
12331 ]
12332 peers.remotePeers = [
12333 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
12334 ]
12335 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
12336 self.assertFalse(actionSet.actionSet is None)
12337 self.assertTrue(len(actionSet.actionSet) == 0)
12338
12339 def testManagedPeer_087(self):
12340 """
12341 Test with actions=[ store ], extensions=[], one peer (managed), managed=True,
12342 local=False
12343 """
12344 actions = [
12345 "store",
12346 ]
12347 extensions = ExtensionsConfig([], None)
12348 options = OptionsConfig()
12349 options.managedActions = [
12350 "collect",
12351 "purge",
12352 "one",
12353 ]
12354 peers = PeersConfig()
12355 peers.localPeers = [
12356 LocalPeer("local", "/collect"),
12357 ]
12358 peers.remotePeers = [
12359 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
12360 ]
12361 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
12362 self.assertFalse(actionSet.actionSet is None)
12363 self.assertTrue(len(actionSet.actionSet) == 0)
12364
12365 def testManagedPeer_088(self):
12366 """
12367 Test with actions=[ purge ], extensions=[], one peer (managed), managed=True,
12368 local=False
12369 """
12370 actions = [
12371 "purge",
12372 ]
12373 extensions = ExtensionsConfig([], None)
12374 options = OptionsConfig()
12375 options.managedActions = [
12376 "collect",
12377 "purge",
12378 "one",
12379 ]
12380 peers = PeersConfig()
12381 peers.localPeers = [
12382 LocalPeer("local", "/collect"),
12383 ]
12384 peers.remotePeers = [
12385 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
12386 ]
12387 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
12388 self.assertFalse(actionSet.actionSet is None)
12389 self.assertTrue(len(actionSet.actionSet) == 1)
12390
12391 self.assertEqual(400, actionSet.actionSet[0].index)
12392 self.assertEqual("purge", actionSet.actionSet[0].name)
12393 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
12394 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 1)
12395 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
12396 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
12397 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
12398 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
12399 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
12400
12401 def testManagedPeer_089(self):
12402 """
12403 Test with actions=[ all ], extensions=[], one peer (managed), managed=True,
12404 local=False
12405 """
12406 actions = [
12407 "all",
12408 ]
12409 extensions = ExtensionsConfig([], None)
12410 options = OptionsConfig()
12411 options.managedActions = [
12412 "collect",
12413 "purge",
12414 "one",
12415 ]
12416 peers = PeersConfig()
12417 peers.localPeers = [
12418 LocalPeer("local", "/collect"),
12419 ]
12420 peers.remotePeers = [
12421 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
12422 ]
12423 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
12424 self.assertFalse(actionSet.actionSet is None)
12425 self.assertTrue(len(actionSet.actionSet) == 2)
12426
12427 self.assertEqual(100, actionSet.actionSet[0].index)
12428 self.assertEqual("collect", actionSet.actionSet[0].name)
12429 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
12430 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 1)
12431 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
12432 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
12433 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
12434 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
12435 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
12436
12437 self.assertEqual(400, actionSet.actionSet[1].index)
12438 self.assertEqual("purge", actionSet.actionSet[1].name)
12439 self.assertFalse(actionSet.actionSet[1].remotePeers is None)
12440 self.assertTrue(len(actionSet.actionSet[1].remotePeers) == 1)
12441 self.assertEqual("remote", actionSet.actionSet[1].remotePeers[0].name)
12442 self.assertEqual("ruser", actionSet.actionSet[1].remotePeers[0].remoteUser)
12443 self.assertEqual(None, actionSet.actionSet[1].remotePeers[0].localUser)
12444 self.assertEqual("rsh", actionSet.actionSet[1].remotePeers[0].rshCommand)
12445 self.assertEqual("cback", actionSet.actionSet[1].remotePeers[0].cbackCommand)
12446
12447 def testManagedPeer_090(self):
12448 """
12449 Test with actions=[ rebuild ], extensions=[], one peer (managed), managed=True,
12450 local=False
12451 """
12452 actions = [
12453 "rebuild",
12454 ]
12455 extensions = ExtensionsConfig([], None)
12456 options = OptionsConfig()
12457 options.managedActions = [
12458 "collect",
12459 "purge",
12460 "one",
12461 ]
12462 peers = PeersConfig()
12463 peers.localPeers = [
12464 LocalPeer("local", "/collect"),
12465 ]
12466 peers.remotePeers = [
12467 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
12468 ]
12469 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
12470 self.assertTrue(len(actionSet.actionSet) == 0)
12471
12472 def testManagedPeer_091(self):
12473 """
12474 Test with actions=[ validate ], extensions=[], one peer (managed), managed=True,
12475 local=False
12476 """
12477 actions = [
12478 "validate",
12479 ]
12480 extensions = ExtensionsConfig([], None)
12481 options = OptionsConfig()
12482 options.managedActions = [
12483 "collect",
12484 "purge",
12485 "one",
12486 ]
12487 peers = PeersConfig()
12488 peers.localPeers = [
12489 LocalPeer("local", "/collect"),
12490 ]
12491 peers.remotePeers = [
12492 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
12493 ]
12494 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
12495 self.assertTrue(len(actionSet.actionSet) == 0)
12496
12497 def testManagedPeer_092(self):
12498 """
12499 Test with actions=[ collect, stage ], extensions=[], one peer (managed),
12500 managed=True, local=False
12501 """
12502 actions = [
12503 "collect",
12504 "stage",
12505 ]
12506 extensions = ExtensionsConfig([], None)
12507 options = OptionsConfig()
12508 options.managedActions = [
12509 "collect",
12510 "purge",
12511 "one",
12512 ]
12513 peers = PeersConfig()
12514 peers.localPeers = [
12515 LocalPeer("local", "/collect"),
12516 ]
12517 peers.remotePeers = [
12518 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
12519 ]
12520 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
12521 self.assertTrue(len(actionSet.actionSet) == 1)
12522 self.assertEqual(100, actionSet.actionSet[0].index)
12523 self.assertEqual("collect", actionSet.actionSet[0].name)
12524 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
12525 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 1)
12526
12527 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
12528 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
12529 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
12530 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
12531 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
12532
12533 def testManagedPeer_093(self):
12534 """
12535 Test with actions=[ collect, store ], extensions=[], one peer (managed),
12536 managed=True, local=False
12537 """
12538 actions = [
12539 "collect",
12540 "store",
12541 ]
12542 extensions = ExtensionsConfig([], None)
12543 options = OptionsConfig()
12544 options.managedActions = [
12545 "collect",
12546 "purge",
12547 "one",
12548 ]
12549 peers = PeersConfig()
12550 peers.localPeers = [
12551 LocalPeer("local", "/collect"),
12552 ]
12553 peers.remotePeers = [
12554 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
12555 ]
12556 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
12557 self.assertTrue(len(actionSet.actionSet) == 1)
12558 self.assertEqual(100, actionSet.actionSet[0].index)
12559 self.assertEqual("collect", actionSet.actionSet[0].name)
12560 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
12561 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 1)
12562
12563 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
12564 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
12565 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
12566 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
12567 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
12568
12569 def testManagedPeer_094(self):
12570 """
12571 Test with actions=[ collect, purge ], extensions=[], one peer (managed),
12572 managed=True, local=False
12573 """
12574 actions = [
12575 "collect",
12576 "purge",
12577 ]
12578 extensions = ExtensionsConfig([], None)
12579 options = OptionsConfig()
12580 options.managedActions = [
12581 "collect",
12582 "purge",
12583 "one",
12584 ]
12585 peers = PeersConfig()
12586 peers.localPeers = [
12587 LocalPeer("local", "/collect"),
12588 ]
12589 peers.remotePeers = [
12590 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
12591 ]
12592 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
12593 self.assertTrue(len(actionSet.actionSet) == 2)
12594
12595 self.assertEqual(100, actionSet.actionSet[0].index)
12596 self.assertEqual("collect", actionSet.actionSet[0].name)
12597 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
12598 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 1)
12599 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
12600 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
12601 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
12602 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
12603 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
12604
12605 self.assertEqual(400, actionSet.actionSet[1].index)
12606 self.assertEqual("purge", actionSet.actionSet[1].name)
12607 self.assertFalse(actionSet.actionSet[1].remotePeers is None)
12608 self.assertTrue(len(actionSet.actionSet[1].remotePeers) == 1)
12609 self.assertEqual("remote", actionSet.actionSet[1].remotePeers[0].name)
12610 self.assertEqual("ruser", actionSet.actionSet[1].remotePeers[0].remoteUser)
12611 self.assertEqual(None, actionSet.actionSet[1].remotePeers[0].localUser)
12612 self.assertEqual("rsh", actionSet.actionSet[1].remotePeers[0].rshCommand)
12613 self.assertEqual("cback", actionSet.actionSet[1].remotePeers[0].cbackCommand)
12614
12615 def testManagedPeer_095(self):
12616 """
12617 Test with actions=[ stage, collect ], extensions=[], one peer (managed),
12618 managed=True, local=False
12619 """
12620 actions = [
12621 "stage",
12622 "collect",
12623 ]
12624 extensions = ExtensionsConfig([], None)
12625 options = OptionsConfig()
12626 options.managedActions = [
12627 "collect",
12628 "purge",
12629 "one",
12630 ]
12631 peers = PeersConfig()
12632 peers.localPeers = [
12633 LocalPeer("local", "/collect"),
12634 ]
12635 peers.remotePeers = [
12636 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
12637 ]
12638 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
12639 self.assertTrue(len(actionSet.actionSet) == 1)
12640
12641 self.assertEqual(100, actionSet.actionSet[0].index)
12642 self.assertEqual("collect", actionSet.actionSet[0].name)
12643 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
12644 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 1)
12645 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
12646 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
12647 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
12648 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
12649 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
12650
12651 def testManagedPeer_096(self):
12652 """
12653 Test with actions=[ stage, stage ], extensions=[], one peer (managed),
12654 managed=True, local=False
12655 """
12656 actions = [
12657 "stage",
12658 "stage",
12659 ]
12660 extensions = ExtensionsConfig([], None)
12661 options = OptionsConfig()
12662 options.managedActions = [
12663 "collect",
12664 "purge",
12665 "one",
12666 ]
12667 peers = PeersConfig()
12668 peers.localPeers = [
12669 LocalPeer("local", "/collect"),
12670 ]
12671 peers.remotePeers = [
12672 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
12673 ]
12674 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
12675 self.assertTrue(len(actionSet.actionSet) == 0)
12676
12677 def testManagedPeer_097(self):
12678 """
12679 Test with actions=[ stage, store ], extensions=[], one peer (managed),
12680 managed=True, local=False
12681 """
12682 actions = [
12683 "stage",
12684 "store",
12685 ]
12686 extensions = ExtensionsConfig([], None)
12687 options = OptionsConfig()
12688 options.managedActions = [
12689 "collect",
12690 "purge",
12691 "one",
12692 ]
12693 peers = PeersConfig()
12694 peers.localPeers = [
12695 LocalPeer("local", "/collect"),
12696 ]
12697 peers.remotePeers = [
12698 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
12699 ]
12700 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
12701 self.assertTrue(len(actionSet.actionSet) == 0)
12702
12703 def testManagedPeer_098(self):
12704 """
12705 Test with actions=[ stage, purge ], extensions=[], one peer (managed),
12706 managed=True, local=False
12707 """
12708 actions = [
12709 "stage",
12710 "purge",
12711 ]
12712 extensions = ExtensionsConfig([], None)
12713 options = OptionsConfig()
12714 options.managedActions = [
12715 "collect",
12716 "purge",
12717 "one",
12718 ]
12719 peers = PeersConfig()
12720 peers.localPeers = [
12721 LocalPeer("local", "/collect"),
12722 ]
12723 peers.remotePeers = [
12724 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
12725 ]
12726 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
12727 self.assertTrue(len(actionSet.actionSet) == 1)
12728
12729 self.assertEqual(400, actionSet.actionSet[0].index)
12730 self.assertEqual("purge", actionSet.actionSet[0].name)
12731 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
12732 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 1)
12733 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
12734 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
12735 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
12736 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
12737 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
12738
12739 def testManagedPeer_099(self):
12740 """
12741 Test with actions=[ collect, one ], extensions=[ (one, index 50) ],
12742 one peer (managed), managed=True, local=False
12743 """
12744 actions = [
12745 "collect",
12746 "one",
12747 ]
12748 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
12749 options = OptionsConfig()
12750 options.managedActions = [
12751 "collect",
12752 "purge",
12753 "one",
12754 ]
12755 peers = PeersConfig()
12756 peers.localPeers = [
12757 LocalPeer("local", "/collect"),
12758 ]
12759 peers.remotePeers = [
12760 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
12761 ]
12762 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
12763 self.assertTrue(len(actionSet.actionSet) == 2)
12764
12765 self.assertEqual(50, actionSet.actionSet[0].index)
12766 self.assertEqual("one", actionSet.actionSet[0].name)
12767 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
12768 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 1)
12769 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
12770 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
12771 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
12772 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
12773 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
12774
12775 self.assertEqual(100, actionSet.actionSet[1].index)
12776 self.assertEqual("collect", actionSet.actionSet[1].name)
12777 self.assertFalse(actionSet.actionSet[1].remotePeers is None)
12778 self.assertTrue(len(actionSet.actionSet[1].remotePeers) == 1)
12779 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
12780 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
12781 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
12782 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
12783 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
12784
12785 def testManagedPeer_100(self):
12786 """
12787 Test with actions=[ store, one ], extensions=[ (one, index 50) ],
12788 one peer (managed), managed=True, local=False
12789 """
12790 actions = [
12791 "store",
12792 "one",
12793 ]
12794 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
12795 options = OptionsConfig()
12796 options.managedActions = [
12797 "collect",
12798 "purge",
12799 "one",
12800 ]
12801 peers = PeersConfig()
12802 peers.localPeers = [
12803 LocalPeer("local", "/collect"),
12804 ]
12805 peers.remotePeers = [
12806 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
12807 ]
12808 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
12809 self.assertTrue(len(actionSet.actionSet) == 1)
12810
12811 self.assertEqual(50, actionSet.actionSet[0].index)
12812 self.assertEqual("one", actionSet.actionSet[0].name)
12813 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
12814 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 1)
12815 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
12816 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
12817 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
12818 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
12819 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
12820
12821 def testManagedPeer_101(self):
12822 """
12823 Test with actions=[ collect, one ], extensions=[ (one, index 150) ],
12824 one peer (managed), managed=True, local=False
12825 """
12826 actions = [
12827 "collect",
12828 "one",
12829 ]
12830 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 150)], None)
12831 options = OptionsConfig()
12832 options.managedActions = [
12833 "collect",
12834 "purge",
12835 "one",
12836 ]
12837 peers = PeersConfig()
12838 peers.localPeers = [
12839 LocalPeer("local", "/collect"),
12840 ]
12841 peers.remotePeers = [
12842 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
12843 ]
12844 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
12845 self.assertTrue(len(actionSet.actionSet) == 2)
12846
12847 self.assertEqual(100, actionSet.actionSet[0].index)
12848 self.assertEqual("collect", actionSet.actionSet[0].name)
12849 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
12850 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 1)
12851 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
12852 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
12853 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
12854 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
12855 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
12856
12857 self.assertEqual(150, actionSet.actionSet[1].index)
12858 self.assertEqual("one", actionSet.actionSet[1].name)
12859 self.assertFalse(actionSet.actionSet[1].remotePeers is None)
12860 self.assertTrue(len(actionSet.actionSet[1].remotePeers) == 1)
12861 self.assertEqual("remote", actionSet.actionSet[1].remotePeers[0].name)
12862 self.assertEqual("ruser", actionSet.actionSet[1].remotePeers[0].remoteUser)
12863 self.assertEqual(None, actionSet.actionSet[1].remotePeers[0].localUser)
12864 self.assertEqual("rsh", actionSet.actionSet[1].remotePeers[0].rshCommand)
12865 self.assertEqual("cback", actionSet.actionSet[1].remotePeers[0].cbackCommand)
12866
12867 def testManagedPeer_102(self):
12868 """
12869 Test with actions=[ store, one ], extensions=[ (one, index 150) ],
12870 one peer (managed), managed=True, local=False
12871 """
12872 actions = [
12873 "store",
12874 "one",
12875 ]
12876 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 150)], None)
12877 options = OptionsConfig()
12878 options.managedActions = [
12879 "collect",
12880 "purge",
12881 "one",
12882 ]
12883 peers = PeersConfig()
12884 peers.localPeers = [
12885 LocalPeer("local", "/collect"),
12886 ]
12887 peers.remotePeers = [
12888 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
12889 ]
12890 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
12891 self.assertTrue(len(actionSet.actionSet) == 1)
12892
12893 self.assertEqual(150, actionSet.actionSet[0].index)
12894 self.assertEqual("one", actionSet.actionSet[0].name)
12895 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
12896 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 1)
12897 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
12898 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
12899 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
12900 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
12901 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
12902
12903 def testManagedPeer_103(self):
12904 """
12905 Test with actions=[ collect, stage, store, purge ], extensions=[],
12906 one peer (managed), managed=True, local=False
12907 """
12908 actions = [
12909 "collect",
12910 "stage",
12911 "store",
12912 "purge",
12913 ]
12914 extensions = ExtensionsConfig([], None)
12915 options = OptionsConfig()
12916 options.managedActions = [
12917 "collect",
12918 "purge",
12919 "one",
12920 ]
12921 peers = PeersConfig()
12922 peers.localPeers = [
12923 LocalPeer("local", "/collect"),
12924 ]
12925 peers.remotePeers = [
12926 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
12927 ]
12928 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
12929 self.assertTrue(len(actionSet.actionSet) == 2)
12930
12931 self.assertEqual(100, actionSet.actionSet[0].index)
12932 self.assertEqual("collect", actionSet.actionSet[0].name)
12933 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
12934 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 1)
12935 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
12936 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
12937 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
12938 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
12939 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
12940
12941 self.assertEqual(400, actionSet.actionSet[1].index)
12942 self.assertEqual("purge", actionSet.actionSet[1].name)
12943 self.assertFalse(actionSet.actionSet[1].remotePeers is None)
12944 self.assertTrue(len(actionSet.actionSet[1].remotePeers) == 1)
12945 self.assertEqual("remote", actionSet.actionSet[1].remotePeers[0].name)
12946 self.assertEqual("ruser", actionSet.actionSet[1].remotePeers[0].remoteUser)
12947 self.assertEqual(None, actionSet.actionSet[1].remotePeers[0].localUser)
12948 self.assertEqual("rsh", actionSet.actionSet[1].remotePeers[0].rshCommand)
12949 self.assertEqual("cback", actionSet.actionSet[1].remotePeers[0].cbackCommand)
12950
12951 def testManagedPeer_104(self):
12952 """
12953 Test with actions=[ collect, stage, store, purge, one, two, three, four,
12954 five ], extensions=[ (index 50, 150, 250, 350, 450)], one peer (managed),
12955 managed=True, local=False
12956 """
12957 actions = [
12958 "collect",
12959 "stage",
12960 "store",
12961 "purge",
12962 "one",
12963 "two",
12964 "three",
12965 "four",
12966 "five",
12967 ]
12968 extensions = ExtensionsConfig(
12969 [
12970 ExtendedAction("one", "os.path", "isdir", 50),
12971 ExtendedAction("two", "os.path", "isfile", 150),
12972 ExtendedAction("three", "os.path", "islink", 250),
12973 ExtendedAction("four", "os.path", "isabs", 350),
12974 ExtendedAction("five", "os.path", "exists", 450),
12975 ],
12976 None,
12977 )
12978 options = OptionsConfig()
12979 options.managedActions = [
12980 "collect",
12981 "purge",
12982 "one",
12983 ]
12984 peers = PeersConfig()
12985 peers.localPeers = [
12986 LocalPeer("local", "/collect"),
12987 ]
12988 peers.remotePeers = [
12989 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
12990 ]
12991 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
12992 self.assertTrue(len(actionSet.actionSet) == 3)
12993
12994 self.assertEqual(50, actionSet.actionSet[0].index)
12995 self.assertEqual("one", actionSet.actionSet[0].name)
12996 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
12997 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 1)
12998 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
12999 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
13000 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
13001 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
13002 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
13003
13004 self.assertEqual(100, actionSet.actionSet[1].index)
13005 self.assertEqual("collect", actionSet.actionSet[1].name)
13006 self.assertFalse(actionSet.actionSet[1].remotePeers is None)
13007 self.assertTrue(len(actionSet.actionSet[1].remotePeers) == 1)
13008 self.assertEqual("remote", actionSet.actionSet[1].remotePeers[0].name)
13009 self.assertEqual("ruser", actionSet.actionSet[1].remotePeers[0].remoteUser)
13010 self.assertEqual(None, actionSet.actionSet[1].remotePeers[0].localUser)
13011 self.assertEqual("rsh", actionSet.actionSet[1].remotePeers[0].rshCommand)
13012 self.assertEqual("cback", actionSet.actionSet[1].remotePeers[0].cbackCommand)
13013
13014 self.assertEqual(400, actionSet.actionSet[2].index)
13015 self.assertEqual("purge", actionSet.actionSet[2].name)
13016 self.assertFalse(actionSet.actionSet[2].remotePeers is None)
13017 self.assertTrue(len(actionSet.actionSet[2].remotePeers) == 1)
13018 self.assertEqual("remote", actionSet.actionSet[2].remotePeers[0].name)
13019 self.assertEqual("ruser", actionSet.actionSet[2].remotePeers[0].remoteUser)
13020 self.assertEqual(None, actionSet.actionSet[2].remotePeers[0].localUser)
13021 self.assertEqual("rsh", actionSet.actionSet[2].remotePeers[0].rshCommand)
13022 self.assertEqual("cback", actionSet.actionSet[2].remotePeers[0].cbackCommand)
13023
13024 def testManagedPeer_105(self):
13025 """
13026 Test with actions=[ one ], extensions=[ (one, index 50) ], one peer (managed),
13027 managed=True, local=False
13028 """
13029 actions = [
13030 "one",
13031 ]
13032 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
13033 options = OptionsConfig()
13034 options.managedActions = [
13035 "collect",
13036 "purge",
13037 "one",
13038 ]
13039 peers = PeersConfig()
13040 peers.localPeers = [
13041 LocalPeer("local", "/collect"),
13042 ]
13043 peers.remotePeers = [
13044 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
13045 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=False),
13046 ]
13047 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
13048 self.assertTrue(len(actionSet.actionSet) == 1)
13049
13050 self.assertEqual(50, actionSet.actionSet[0].index)
13051 self.assertEqual("one", actionSet.actionSet[0].name)
13052 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
13053 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 1)
13054 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
13055 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
13056 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
13057 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
13058 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
13059
13060 def testManagedPeer_106(self):
13061 """
13062 Test with actions=[ collect ], extensions=[], two peers (one managed, one not), managed=True,
13063 local=False
13064 """
13065 actions = [
13066 "collect",
13067 ]
13068 extensions = ExtensionsConfig([], None)
13069 options = OptionsConfig()
13070 options.managedActions = [
13071 "collect",
13072 "purge",
13073 "one",
13074 ]
13075 peers = PeersConfig()
13076 peers.localPeers = [
13077 LocalPeer("local", "/collect"),
13078 ]
13079 peers.remotePeers = [
13080 RemotePeer("remote", None, "ruser", None, "rsh", "cback", managed=True),
13081 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=False),
13082 ]
13083 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
13084 self.assertFalse(actionSet.actionSet is None)
13085 self.assertTrue(len(actionSet.actionSet) == 1)
13086
13087 self.assertEqual(100, actionSet.actionSet[0].index)
13088 self.assertEqual("collect", actionSet.actionSet[0].name)
13089 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
13090 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 1)
13091 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
13092 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
13093 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
13094 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
13095 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
13096
13097 def testManagedPeer_107(self):
13098 """
13099 Test with actions=[ stage ], extensions=[], two peers (one managed, one not), managed=True,
13100 local=False
13101 """
13102 actions = [
13103 "stage",
13104 ]
13105 extensions = ExtensionsConfig([], None)
13106 options = OptionsConfig()
13107 options.managedActions = [
13108 "collect",
13109 "purge",
13110 "one",
13111 ]
13112 peers = PeersConfig()
13113 peers.localPeers = [
13114 LocalPeer("local", "/collect"),
13115 ]
13116 peers.remotePeers = [
13117 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
13118 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=False),
13119 ]
13120 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
13121 self.assertFalse(actionSet.actionSet is None)
13122 self.assertTrue(len(actionSet.actionSet) == 0)
13123
13124 def testManagedPeer_108(self):
13125 """
13126 Test with actions=[ store ], extensions=[], two peers (one managed, one not), managed=True,
13127 local=False
13128 """
13129 actions = [
13130 "store",
13131 ]
13132 extensions = ExtensionsConfig([], None)
13133 options = OptionsConfig()
13134 options.managedActions = [
13135 "collect",
13136 "purge",
13137 "one",
13138 ]
13139 peers = PeersConfig()
13140 peers.localPeers = [
13141 LocalPeer("local", "/collect"),
13142 ]
13143 peers.remotePeers = [
13144 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
13145 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=False),
13146 ]
13147 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
13148 self.assertFalse(actionSet.actionSet is None)
13149 self.assertTrue(len(actionSet.actionSet) == 0)
13150
13151 def testManagedPeer_109(self):
13152 """
13153 Test with actions=[ purge ], extensions=[], two peers (one managed, one not), managed=True,
13154 local=False
13155 """
13156 actions = [
13157 "purge",
13158 ]
13159 extensions = ExtensionsConfig([], None)
13160 options = OptionsConfig()
13161 options.managedActions = [
13162 "collect",
13163 "purge",
13164 "one",
13165 ]
13166 peers = PeersConfig()
13167 peers.localPeers = [
13168 LocalPeer("local", "/collect"),
13169 ]
13170 peers.remotePeers = [
13171 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
13172 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=False),
13173 ]
13174 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
13175 self.assertFalse(actionSet.actionSet is None)
13176 self.assertTrue(len(actionSet.actionSet) == 1)
13177
13178 self.assertEqual(400, actionSet.actionSet[0].index)
13179 self.assertEqual("purge", actionSet.actionSet[0].name)
13180 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
13181 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 1)
13182 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
13183 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
13184 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
13185 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
13186 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
13187
13188 def testManagedPeer_110(self):
13189 """
13190 Test with actions=[ all ], extensions=[], two peers (one managed, one not), managed=True,
13191 local=False
13192 """
13193 actions = [
13194 "all",
13195 ]
13196 extensions = ExtensionsConfig([], None)
13197 options = OptionsConfig()
13198 options.managedActions = [
13199 "collect",
13200 "purge",
13201 "one",
13202 ]
13203 peers = PeersConfig()
13204 peers.localPeers = [
13205 LocalPeer("local", "/collect"),
13206 ]
13207 peers.remotePeers = [
13208 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
13209 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=False),
13210 ]
13211 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
13212 self.assertFalse(actionSet.actionSet is None)
13213 self.assertTrue(len(actionSet.actionSet) == 2)
13214
13215 self.assertEqual(100, actionSet.actionSet[0].index)
13216 self.assertEqual("collect", actionSet.actionSet[0].name)
13217 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
13218 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 1)
13219 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
13220 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
13221 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
13222 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
13223 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
13224
13225 self.assertEqual(400, actionSet.actionSet[1].index)
13226 self.assertEqual("purge", actionSet.actionSet[1].name)
13227 self.assertFalse(actionSet.actionSet[1].remotePeers is None)
13228 self.assertTrue(len(actionSet.actionSet[1].remotePeers) == 1)
13229 self.assertEqual("remote", actionSet.actionSet[1].remotePeers[0].name)
13230 self.assertEqual("ruser", actionSet.actionSet[1].remotePeers[0].remoteUser)
13231 self.assertEqual(None, actionSet.actionSet[1].remotePeers[0].localUser)
13232 self.assertEqual("rsh", actionSet.actionSet[1].remotePeers[0].rshCommand)
13233 self.assertEqual("cback", actionSet.actionSet[1].remotePeers[0].cbackCommand)
13234
13235 def testManagedPeer_111(self):
13236 """
13237 Test with actions=[ rebuild ], extensions=[], two peers (one managed, one not), managed=True,
13238 local=False
13239 """
13240 actions = [
13241 "rebuild",
13242 ]
13243 extensions = ExtensionsConfig([], None)
13244 options = OptionsConfig()
13245 options.managedActions = [
13246 "collect",
13247 "purge",
13248 "one",
13249 ]
13250 peers = PeersConfig()
13251 peers.localPeers = [
13252 LocalPeer("local", "/collect"),
13253 ]
13254 peers.remotePeers = [
13255 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
13256 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=False),
13257 ]
13258 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
13259 self.assertTrue(len(actionSet.actionSet) == 0)
13260
13261 def testManagedPeer_112(self):
13262 """
13263 Test with actions=[ validate ], extensions=[], two peers (one managed, one not), managed=True,
13264 local=False
13265 """
13266 actions = [
13267 "validate",
13268 ]
13269 extensions = ExtensionsConfig([], None)
13270 options = OptionsConfig()
13271 options.managedActions = [
13272 "collect",
13273 "purge",
13274 "one",
13275 ]
13276 peers = PeersConfig()
13277 peers.localPeers = [
13278 LocalPeer("local", "/collect"),
13279 ]
13280 peers.remotePeers = [
13281 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
13282 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=False),
13283 ]
13284 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
13285 self.assertTrue(len(actionSet.actionSet) == 0)
13286
13287 def testManagedPeer_113(self):
13288 """
13289 Test with actions=[ collect, stage ], extensions=[], two peers (one managed, one not),
13290 managed=True, local=False
13291 """
13292 actions = [
13293 "collect",
13294 "stage",
13295 ]
13296 extensions = ExtensionsConfig([], None)
13297 options = OptionsConfig()
13298 options.managedActions = [
13299 "collect",
13300 "purge",
13301 "one",
13302 ]
13303 peers = PeersConfig()
13304 peers.localPeers = [
13305 LocalPeer("local", "/collect"),
13306 ]
13307 peers.remotePeers = [
13308 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
13309 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=False),
13310 ]
13311 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
13312 self.assertTrue(len(actionSet.actionSet) == 1)
13313
13314 self.assertEqual(100, actionSet.actionSet[0].index)
13315 self.assertEqual("collect", actionSet.actionSet[0].name)
13316 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
13317 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 1)
13318 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
13319 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
13320 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
13321 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
13322 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
13323
13324 def testManagedPeer_114(self):
13325 """
13326 Test with actions=[ collect, store ], extensions=[], two peers (one managed, one not),
13327 managed=True, local=False
13328 """
13329 actions = [
13330 "collect",
13331 "store",
13332 ]
13333 extensions = ExtensionsConfig([], None)
13334 options = OptionsConfig()
13335 options.managedActions = [
13336 "collect",
13337 "purge",
13338 "one",
13339 ]
13340 peers = PeersConfig()
13341 peers.localPeers = [
13342 LocalPeer("local", "/collect"),
13343 ]
13344 peers.remotePeers = [
13345 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
13346 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=False),
13347 ]
13348 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
13349 self.assertTrue(len(actionSet.actionSet) == 1)
13350
13351 self.assertEqual(100, actionSet.actionSet[0].index)
13352 self.assertEqual("collect", actionSet.actionSet[0].name)
13353 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
13354 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 1)
13355 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
13356 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
13357 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
13358 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
13359 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
13360
13361 def testManagedPeer_115(self):
13362 """
13363 Test with actions=[ collect, purge ], extensions=[], two peers (one managed, one not),
13364 managed=True, local=False
13365 """
13366 actions = [
13367 "collect",
13368 "purge",
13369 ]
13370 extensions = ExtensionsConfig([], None)
13371 options = OptionsConfig()
13372 options.managedActions = [
13373 "collect",
13374 "purge",
13375 "one",
13376 ]
13377 peers = PeersConfig()
13378 peers.localPeers = [
13379 LocalPeer("local", "/collect"),
13380 ]
13381 peers.remotePeers = [
13382 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
13383 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=False),
13384 ]
13385 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
13386 self.assertTrue(len(actionSet.actionSet) == 2)
13387
13388 self.assertEqual(100, actionSet.actionSet[0].index)
13389 self.assertEqual("collect", actionSet.actionSet[0].name)
13390 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
13391 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 1)
13392 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
13393 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
13394 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
13395 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
13396 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
13397
13398 self.assertEqual(400, actionSet.actionSet[1].index)
13399 self.assertEqual("purge", actionSet.actionSet[1].name)
13400 self.assertFalse(actionSet.actionSet[1].remotePeers is None)
13401 self.assertTrue(len(actionSet.actionSet[1].remotePeers) == 1)
13402 self.assertEqual("remote", actionSet.actionSet[1].remotePeers[0].name)
13403 self.assertEqual("ruser", actionSet.actionSet[1].remotePeers[0].remoteUser)
13404 self.assertEqual(None, actionSet.actionSet[1].remotePeers[0].localUser)
13405 self.assertEqual("rsh", actionSet.actionSet[1].remotePeers[0].rshCommand)
13406 self.assertEqual("cback", actionSet.actionSet[1].remotePeers[0].cbackCommand)
13407
13408 def testManagedPeer_116(self):
13409 """
13410 Test with actions=[ stage, collect ], extensions=[], two peers (one managed, one not),
13411 managed=True, local=False
13412 """
13413 actions = [
13414 "stage",
13415 "collect",
13416 ]
13417 extensions = ExtensionsConfig([], None)
13418 options = OptionsConfig()
13419 options.managedActions = [
13420 "collect",
13421 "purge",
13422 "one",
13423 ]
13424 peers = PeersConfig()
13425 peers.localPeers = [
13426 LocalPeer("local", "/collect"),
13427 ]
13428 peers.remotePeers = [
13429 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
13430 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=False),
13431 ]
13432 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
13433 self.assertTrue(len(actionSet.actionSet) == 1)
13434
13435 self.assertEqual(100, actionSet.actionSet[0].index)
13436 self.assertEqual("collect", actionSet.actionSet[0].name)
13437 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
13438 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 1)
13439 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
13440 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
13441 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
13442 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
13443 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
13444
13445 def testManagedPeer_117(self):
13446 """
13447 Test with actions=[ stage, stage ], extensions=[], two peers (one managed, one not),
13448 managed=True, local=False
13449 """
13450 actions = [
13451 "stage",
13452 "stage",
13453 ]
13454 extensions = ExtensionsConfig([], None)
13455 options = OptionsConfig()
13456 options.managedActions = [
13457 "collect",
13458 "purge",
13459 "one",
13460 ]
13461 peers = PeersConfig()
13462 peers.localPeers = [
13463 LocalPeer("local", "/collect"),
13464 ]
13465 peers.remotePeers = [
13466 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
13467 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=False),
13468 ]
13469 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
13470 self.assertTrue(len(actionSet.actionSet) == 0)
13471
13472 def testManagedPeer_118(self):
13473 """
13474 Test with actions=[ stage, store ], extensions=[], two peers (one managed, one not),
13475 managed=True, local=False
13476 """
13477 actions = [
13478 "stage",
13479 "store",
13480 ]
13481 extensions = ExtensionsConfig([], None)
13482 options = OptionsConfig()
13483 options.managedActions = [
13484 "collect",
13485 "purge",
13486 "one",
13487 ]
13488 peers = PeersConfig()
13489 peers.localPeers = [
13490 LocalPeer("local", "/collect"),
13491 ]
13492 peers.remotePeers = [
13493 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
13494 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=False),
13495 ]
13496 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
13497 self.assertTrue(len(actionSet.actionSet) == 0)
13498
13499 def testManagedPeer_119(self):
13500 """
13501 Test with actions=[ stage, purge ], extensions=[], two peers (one managed, one not),
13502 managed=True, local=False
13503 """
13504 actions = [
13505 "stage",
13506 "purge",
13507 ]
13508 extensions = ExtensionsConfig([], None)
13509 options = OptionsConfig()
13510 options.managedActions = [
13511 "collect",
13512 "purge",
13513 "one",
13514 ]
13515 peers = PeersConfig()
13516 peers.localPeers = [
13517 LocalPeer("local", "/collect"),
13518 ]
13519 peers.remotePeers = [
13520 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
13521 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=False),
13522 ]
13523 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
13524 self.assertTrue(len(actionSet.actionSet) == 1)
13525
13526 self.assertEqual(400, actionSet.actionSet[0].index)
13527 self.assertEqual("purge", actionSet.actionSet[0].name)
13528 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
13529 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 1)
13530 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
13531 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
13532 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
13533 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
13534 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
13535
13536 def testManagedPeer_120(self):
13537 """
13538 Test with actions=[ collect, one ], extensions=[ (one, index 50) ],
13539 two peers (one managed, one not), managed=True, local=False
13540 """
13541 actions = [
13542 "collect",
13543 "one",
13544 ]
13545 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
13546 options = OptionsConfig()
13547 options.managedActions = [
13548 "collect",
13549 "purge",
13550 "one",
13551 ]
13552 peers = PeersConfig()
13553 peers.localPeers = [
13554 LocalPeer("local", "/collect"),
13555 ]
13556 peers.remotePeers = [
13557 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
13558 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=False),
13559 ]
13560 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
13561 self.assertTrue(len(actionSet.actionSet) == 2)
13562
13563 self.assertEqual(50, actionSet.actionSet[0].index)
13564 self.assertEqual("one", actionSet.actionSet[0].name)
13565 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
13566 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 1)
13567 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
13568 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
13569 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
13570 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
13571 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
13572
13573 self.assertEqual(100, actionSet.actionSet[1].index)
13574 self.assertEqual("collect", actionSet.actionSet[1].name)
13575 self.assertFalse(actionSet.actionSet[1].remotePeers is None)
13576 self.assertTrue(len(actionSet.actionSet[1].remotePeers) == 1)
13577 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
13578 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
13579 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
13580 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
13581 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
13582
13583 def testManagedPeer_121(self):
13584 """
13585 Test with actions=[ store, one ], extensions=[ (one, index 50) ],
13586 two peers (one managed, one not), managed=True, local=False
13587 """
13588 actions = [
13589 "store",
13590 "one",
13591 ]
13592 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
13593 options = OptionsConfig()
13594 options.managedActions = [
13595 "collect",
13596 "purge",
13597 "one",
13598 ]
13599 peers = PeersConfig()
13600 peers.localPeers = [
13601 LocalPeer("local", "/collect"),
13602 ]
13603 peers.remotePeers = [
13604 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
13605 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=False),
13606 ]
13607 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
13608 self.assertTrue(len(actionSet.actionSet) == 1)
13609
13610 self.assertEqual(50, actionSet.actionSet[0].index)
13611 self.assertEqual("one", actionSet.actionSet[0].name)
13612 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
13613 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 1)
13614 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
13615 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
13616 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
13617 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
13618 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
13619
13620 def testManagedPeer_122(self):
13621 """
13622 Test with actions=[ collect, one ], extensions=[ (one, index 150) ],
13623 two peers (one managed, one not), managed=True, local=False
13624 """
13625 actions = [
13626 "collect",
13627 "one",
13628 ]
13629 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 150)], None)
13630 options = OptionsConfig()
13631 options.managedActions = [
13632 "collect",
13633 "purge",
13634 "one",
13635 ]
13636 peers = PeersConfig()
13637 peers.localPeers = [
13638 LocalPeer("local", "/collect"),
13639 ]
13640 peers.remotePeers = [
13641 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
13642 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=False),
13643 ]
13644 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
13645 self.assertTrue(len(actionSet.actionSet) == 2)
13646
13647 self.assertEqual(100, actionSet.actionSet[0].index)
13648 self.assertEqual("collect", actionSet.actionSet[0].name)
13649 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
13650 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 1)
13651 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
13652 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
13653 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
13654 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
13655 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
13656
13657 self.assertEqual(150, actionSet.actionSet[1].index)
13658 self.assertEqual("one", actionSet.actionSet[1].name)
13659 self.assertFalse(actionSet.actionSet[1].remotePeers is None)
13660 self.assertTrue(len(actionSet.actionSet[1].remotePeers) == 1)
13661 self.assertEqual("remote", actionSet.actionSet[1].remotePeers[0].name)
13662 self.assertEqual("ruser", actionSet.actionSet[1].remotePeers[0].remoteUser)
13663 self.assertEqual(None, actionSet.actionSet[1].remotePeers[0].localUser)
13664 self.assertEqual("rsh", actionSet.actionSet[1].remotePeers[0].rshCommand)
13665 self.assertEqual("cback", actionSet.actionSet[1].remotePeers[0].cbackCommand)
13666
13667 def testManagedPeer_123(self):
13668 """
13669 Test with actions=[ store, one ], extensions=[ (one, index 150) ],
13670 two peers (one managed, one not), managed=True, local=False
13671 """
13672 actions = [
13673 "store",
13674 "one",
13675 ]
13676 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 150)], None)
13677 options = OptionsConfig()
13678 options.managedActions = [
13679 "collect",
13680 "purge",
13681 "one",
13682 ]
13683 peers = PeersConfig()
13684 peers.localPeers = [
13685 LocalPeer("local", "/collect"),
13686 ]
13687 peers.remotePeers = [
13688 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
13689 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=False),
13690 ]
13691 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
13692 self.assertTrue(len(actionSet.actionSet) == 1)
13693
13694 self.assertEqual(150, actionSet.actionSet[0].index)
13695 self.assertEqual("one", actionSet.actionSet[0].name)
13696 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
13697 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 1)
13698 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
13699 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
13700 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
13701 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
13702 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
13703
13704 def testManagedPeer_124(self):
13705 """
13706 Test with actions=[ collect, stage, store, purge ], extensions=[],
13707 two peers (one managed, one not), managed=True, local=False
13708 """
13709 actions = [
13710 "collect",
13711 "stage",
13712 "store",
13713 "purge",
13714 ]
13715 extensions = ExtensionsConfig([], None)
13716 options = OptionsConfig()
13717 options.managedActions = [
13718 "collect",
13719 "purge",
13720 "one",
13721 ]
13722 peers = PeersConfig()
13723 peers.localPeers = [
13724 LocalPeer("local", "/collect"),
13725 ]
13726 peers.remotePeers = [
13727 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
13728 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=False),
13729 ]
13730 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
13731 self.assertTrue(len(actionSet.actionSet) == 2)
13732
13733 self.assertEqual(100, actionSet.actionSet[0].index)
13734 self.assertEqual("collect", actionSet.actionSet[0].name)
13735 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
13736 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 1)
13737 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
13738 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
13739 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
13740 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
13741 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
13742
13743 self.assertEqual(400, actionSet.actionSet[1].index)
13744 self.assertEqual("purge", actionSet.actionSet[1].name)
13745 self.assertFalse(actionSet.actionSet[1].remotePeers is None)
13746 self.assertTrue(len(actionSet.actionSet[1].remotePeers) == 1)
13747 self.assertEqual("remote", actionSet.actionSet[1].remotePeers[0].name)
13748 self.assertEqual("ruser", actionSet.actionSet[1].remotePeers[0].remoteUser)
13749 self.assertEqual(None, actionSet.actionSet[1].remotePeers[0].localUser)
13750 self.assertEqual("rsh", actionSet.actionSet[1].remotePeers[0].rshCommand)
13751 self.assertEqual("cback", actionSet.actionSet[1].remotePeers[0].cbackCommand)
13752
13753 def testManagedPeer_125(self):
13754 """
13755 Test with actions=[ collect, stage, store, purge, one, two, three, four,
13756 five ], extensions=[ (index 50, 150, 250, 350, 450)], two peers (one managed, one not),
13757 managed=True, local=False
13758 """
13759 actions = [
13760 "collect",
13761 "stage",
13762 "store",
13763 "purge",
13764 "one",
13765 "two",
13766 "three",
13767 "four",
13768 "five",
13769 ]
13770 extensions = ExtensionsConfig(
13771 [
13772 ExtendedAction("one", "os.path", "isdir", 50),
13773 ExtendedAction("two", "os.path", "isfile", 150),
13774 ExtendedAction("three", "os.path", "islink", 250),
13775 ExtendedAction("four", "os.path", "isabs", 350),
13776 ExtendedAction("five", "os.path", "exists", 450),
13777 ],
13778 None,
13779 )
13780 options = OptionsConfig()
13781 options.managedActions = [
13782 "collect",
13783 "purge",
13784 "one",
13785 ]
13786 peers = PeersConfig()
13787 peers.localPeers = [
13788 LocalPeer("local", "/collect"),
13789 ]
13790 peers.remotePeers = [
13791 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
13792 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=False),
13793 ]
13794 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
13795 self.assertTrue(len(actionSet.actionSet) == 3)
13796
13797 self.assertEqual(50, actionSet.actionSet[0].index)
13798 self.assertEqual("one", actionSet.actionSet[0].name)
13799 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
13800 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 1)
13801 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
13802 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
13803 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
13804 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
13805 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
13806
13807 self.assertEqual(100, actionSet.actionSet[1].index)
13808 self.assertEqual("collect", actionSet.actionSet[1].name)
13809 self.assertFalse(actionSet.actionSet[1].remotePeers is None)
13810 self.assertTrue(len(actionSet.actionSet[1].remotePeers) == 1)
13811 self.assertEqual("remote", actionSet.actionSet[1].remotePeers[0].name)
13812 self.assertEqual("ruser", actionSet.actionSet[1].remotePeers[0].remoteUser)
13813 self.assertEqual(None, actionSet.actionSet[1].remotePeers[0].localUser)
13814 self.assertEqual("rsh", actionSet.actionSet[1].remotePeers[0].rshCommand)
13815 self.assertEqual("cback", actionSet.actionSet[1].remotePeers[0].cbackCommand)
13816
13817 self.assertEqual(400, actionSet.actionSet[2].index)
13818 self.assertEqual("purge", actionSet.actionSet[2].name)
13819 self.assertFalse(actionSet.actionSet[2].remotePeers is None)
13820 self.assertTrue(len(actionSet.actionSet[2].remotePeers) == 1)
13821 self.assertEqual("remote", actionSet.actionSet[2].remotePeers[0].name)
13822 self.assertEqual("ruser", actionSet.actionSet[2].remotePeers[0].remoteUser)
13823 self.assertEqual(None, actionSet.actionSet[2].remotePeers[0].localUser)
13824 self.assertEqual("rsh", actionSet.actionSet[2].remotePeers[0].rshCommand)
13825 self.assertEqual("cback", actionSet.actionSet[2].remotePeers[0].cbackCommand)
13826
13827 def testManagedPeer_126(self):
13828 """
13829 Test with actions=[ one ], extensions=[ (one, index 50) ], two peers (one managed, one not),
13830 managed=True, local=False
13831 """
13832 actions = [
13833 "one",
13834 ]
13835 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
13836 options = OptionsConfig()
13837 options.managedActions = [
13838 "collect",
13839 "purge",
13840 "one",
13841 ]
13842 peers = PeersConfig()
13843 peers.localPeers = [
13844 LocalPeer("local", "/collect"),
13845 ]
13846 peers.remotePeers = [
13847 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
13848 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=False),
13849 ]
13850 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
13851 self.assertTrue(len(actionSet.actionSet) == 1)
13852
13853 self.assertEqual(50, actionSet.actionSet[0].index)
13854 self.assertEqual("one", actionSet.actionSet[0].name)
13855 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
13856 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 1)
13857 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
13858 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
13859 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
13860 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
13861 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
13862
13863 def testManagedPeer_127(self):
13864 """
13865 Test with actions=[ collect ], extensions=[], two peers (both managed), managed=True,
13866 local=False
13867 """
13868 actions = [
13869 "collect",
13870 ]
13871 extensions = ExtensionsConfig([], None)
13872 options = OptionsConfig()
13873 options.managedActions = [
13874 "collect",
13875 "purge",
13876 "one",
13877 ]
13878 peers = PeersConfig()
13879 peers.localPeers = [
13880 LocalPeer("local", "/collect"),
13881 ]
13882 peers.remotePeers = [
13883 RemotePeer("remote", None, "ruser", None, "rsh", "cback", managed=True),
13884 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
13885 ]
13886 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
13887 self.assertFalse(actionSet.actionSet is None)
13888 self.assertTrue(len(actionSet.actionSet) == 1)
13889
13890 self.assertEqual(100, actionSet.actionSet[0].index)
13891 self.assertEqual("collect", actionSet.actionSet[0].name)
13892 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
13893 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 2)
13894 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
13895 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
13896 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
13897 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
13898 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
13899 self.assertEqual("remote2", actionSet.actionSet[0].remotePeers[1].name)
13900 self.assertEqual("ruser2", actionSet.actionSet[0].remotePeers[1].remoteUser)
13901 self.assertEqual(None, actionSet.actionSet[0].remotePeers[1].localUser)
13902 self.assertEqual("rsh2", actionSet.actionSet[0].remotePeers[1].rshCommand)
13903 self.assertEqual("cback2", actionSet.actionSet[0].remotePeers[1].cbackCommand)
13904
13905 def testManagedPeer_128(self):
13906 """
13907 Test with actions=[ stage ], extensions=[], two peers (both managed), managed=True,
13908 local=False
13909 """
13910 actions = [
13911 "stage",
13912 ]
13913 extensions = ExtensionsConfig([], None)
13914 options = OptionsConfig()
13915 options.managedActions = [
13916 "collect",
13917 "purge",
13918 "one",
13919 ]
13920 peers = PeersConfig()
13921 peers.localPeers = [
13922 LocalPeer("local", "/collect"),
13923 ]
13924 peers.remotePeers = [
13925 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
13926 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
13927 ]
13928 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
13929 self.assertFalse(actionSet.actionSet is None)
13930 self.assertTrue(len(actionSet.actionSet) == 0)
13931
13932 def testManagedPeer_129(self):
13933 """
13934 Test with actions=[ store ], extensions=[], two peers (both managed), managed=True,
13935 local=False
13936 """
13937 actions = [
13938 "store",
13939 ]
13940 extensions = ExtensionsConfig([], None)
13941 options = OptionsConfig()
13942 options.managedActions = [
13943 "collect",
13944 "purge",
13945 "one",
13946 ]
13947 peers = PeersConfig()
13948 peers.localPeers = [
13949 LocalPeer("local", "/collect"),
13950 ]
13951 peers.remotePeers = [
13952 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
13953 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
13954 ]
13955 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
13956 self.assertFalse(actionSet.actionSet is None)
13957 self.assertTrue(len(actionSet.actionSet) == 0)
13958
13959 def testManagedPeer_130(self):
13960 """
13961 Test with actions=[ purge ], extensions=[], two peers (both managed), managed=True,
13962 local=False
13963 """
13964 actions = [
13965 "purge",
13966 ]
13967 extensions = ExtensionsConfig([], None)
13968 options = OptionsConfig()
13969 options.managedActions = [
13970 "collect",
13971 "purge",
13972 "one",
13973 ]
13974 peers = PeersConfig()
13975 peers.localPeers = [
13976 LocalPeer("local", "/collect"),
13977 ]
13978 peers.remotePeers = [
13979 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
13980 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
13981 ]
13982 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
13983 self.assertFalse(actionSet.actionSet is None)
13984 self.assertTrue(len(actionSet.actionSet) == 1)
13985
13986 self.assertEqual(400, actionSet.actionSet[0].index)
13987 self.assertEqual("purge", actionSet.actionSet[0].name)
13988 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
13989 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 2)
13990 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
13991 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
13992 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
13993 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
13994 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
13995 self.assertEqual("remote2", actionSet.actionSet[0].remotePeers[1].name)
13996 self.assertEqual("ruser2", actionSet.actionSet[0].remotePeers[1].remoteUser)
13997 self.assertEqual(None, actionSet.actionSet[0].remotePeers[1].localUser)
13998 self.assertEqual("rsh2", actionSet.actionSet[0].remotePeers[1].rshCommand)
13999 self.assertEqual("cback2", actionSet.actionSet[0].remotePeers[1].cbackCommand)
14000
14001 def testManagedPeer_131(self):
14002 """
14003 Test with actions=[ all ], extensions=[], two peers (both managed), managed=True,
14004 local=False
14005 """
14006 actions = [
14007 "all",
14008 ]
14009 extensions = ExtensionsConfig([], None)
14010 options = OptionsConfig()
14011 options.managedActions = [
14012 "collect",
14013 "purge",
14014 "one",
14015 ]
14016 peers = PeersConfig()
14017 peers.localPeers = [
14018 LocalPeer("local", "/collect"),
14019 ]
14020 peers.remotePeers = [
14021 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
14022 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
14023 ]
14024 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
14025 self.assertFalse(actionSet.actionSet is None)
14026 self.assertTrue(len(actionSet.actionSet) == 2)
14027 self.assertEqual(100, actionSet.actionSet[0].index)
14028 self.assertEqual("collect", actionSet.actionSet[0].name)
14029 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
14030 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 2)
14031 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
14032 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
14033 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
14034 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
14035 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
14036 self.assertEqual("remote2", actionSet.actionSet[0].remotePeers[1].name)
14037 self.assertEqual("ruser2", actionSet.actionSet[0].remotePeers[1].remoteUser)
14038 self.assertEqual(None, actionSet.actionSet[0].remotePeers[1].localUser)
14039 self.assertEqual("rsh2", actionSet.actionSet[0].remotePeers[1].rshCommand)
14040 self.assertEqual("cback2", actionSet.actionSet[0].remotePeers[1].cbackCommand)
14041
14042 self.assertEqual(400, actionSet.actionSet[1].index)
14043 self.assertEqual("purge", actionSet.actionSet[1].name)
14044 self.assertFalse(actionSet.actionSet[1].remotePeers is None)
14045 self.assertTrue(len(actionSet.actionSet[1].remotePeers) == 2)
14046 self.assertEqual("remote", actionSet.actionSet[1].remotePeers[0].name)
14047 self.assertEqual("ruser", actionSet.actionSet[1].remotePeers[0].remoteUser)
14048 self.assertEqual(None, actionSet.actionSet[1].remotePeers[0].localUser)
14049 self.assertEqual("rsh", actionSet.actionSet[1].remotePeers[0].rshCommand)
14050 self.assertEqual("cback", actionSet.actionSet[1].remotePeers[0].cbackCommand)
14051 self.assertEqual("remote2", actionSet.actionSet[1].remotePeers[1].name)
14052 self.assertEqual("ruser2", actionSet.actionSet[1].remotePeers[1].remoteUser)
14053 self.assertEqual(None, actionSet.actionSet[1].remotePeers[1].localUser)
14054 self.assertEqual("rsh2", actionSet.actionSet[1].remotePeers[1].rshCommand)
14055 self.assertEqual("cback2", actionSet.actionSet[1].remotePeers[1].cbackCommand)
14056
14057 def testManagedPeer_132(self):
14058 """
14059 Test with actions=[ rebuild ], extensions=[], two peers (both managed), managed=True,
14060 local=False
14061 """
14062 actions = [
14063 "rebuild",
14064 ]
14065 extensions = ExtensionsConfig([], None)
14066 options = OptionsConfig()
14067 options.managedActions = [
14068 "collect",
14069 "purge",
14070 "one",
14071 ]
14072 peers = PeersConfig()
14073 peers.localPeers = [
14074 LocalPeer("local", "/collect"),
14075 ]
14076 peers.remotePeers = [
14077 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
14078 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
14079 ]
14080 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
14081 self.assertTrue(len(actionSet.actionSet) == 0)
14082
14083 def testManagedPeer_133(self):
14084 """
14085 Test with actions=[ validate ], extensions=[], two peers (both managed), managed=True,
14086 local=False
14087 """
14088 actions = [
14089 "validate",
14090 ]
14091 extensions = ExtensionsConfig([], None)
14092 options = OptionsConfig()
14093 options.managedActions = [
14094 "collect",
14095 "purge",
14096 "one",
14097 ]
14098 peers = PeersConfig()
14099 peers.localPeers = [
14100 LocalPeer("local", "/collect"),
14101 ]
14102 peers.remotePeers = [
14103 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
14104 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
14105 ]
14106 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
14107 self.assertTrue(len(actionSet.actionSet) == 0)
14108
14109 def testManagedPeer_134(self):
14110 """
14111 Test with actions=[ collect, stage ], extensions=[], two peers (both managed),
14112 managed=True, local=False
14113 """
14114 actions = [
14115 "collect",
14116 "stage",
14117 ]
14118 extensions = ExtensionsConfig([], None)
14119 options = OptionsConfig()
14120 options.managedActions = [
14121 "collect",
14122 "purge",
14123 "one",
14124 ]
14125 peers = PeersConfig()
14126 peers.localPeers = [
14127 LocalPeer("local", "/collect"),
14128 ]
14129 peers.remotePeers = [
14130 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
14131 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
14132 ]
14133 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
14134 self.assertTrue(len(actionSet.actionSet) == 1)
14135
14136 self.assertEqual(100, actionSet.actionSet[0].index)
14137 self.assertEqual("collect", actionSet.actionSet[0].name)
14138 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
14139 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 2)
14140 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
14141 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
14142 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
14143 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
14144 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
14145 self.assertEqual("remote2", actionSet.actionSet[0].remotePeers[1].name)
14146 self.assertEqual("ruser2", actionSet.actionSet[0].remotePeers[1].remoteUser)
14147 self.assertEqual(None, actionSet.actionSet[0].remotePeers[1].localUser)
14148 self.assertEqual("rsh2", actionSet.actionSet[0].remotePeers[1].rshCommand)
14149 self.assertEqual("cback2", actionSet.actionSet[0].remotePeers[1].cbackCommand)
14150
14151 def testManagedPeer_135(self):
14152 """
14153 Test with actions=[ collect, store ], extensions=[], two peers (both managed),
14154 managed=True, local=False
14155 """
14156 actions = [
14157 "collect",
14158 "store",
14159 ]
14160 extensions = ExtensionsConfig([], None)
14161 options = OptionsConfig()
14162 options.managedActions = [
14163 "collect",
14164 "purge",
14165 "one",
14166 ]
14167 peers = PeersConfig()
14168 peers.localPeers = [
14169 LocalPeer("local", "/collect"),
14170 ]
14171 peers.remotePeers = [
14172 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
14173 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
14174 ]
14175 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
14176 self.assertTrue(len(actionSet.actionSet) == 1)
14177
14178 self.assertEqual(100, actionSet.actionSet[0].index)
14179 self.assertEqual("collect", actionSet.actionSet[0].name)
14180 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
14181 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 2)
14182 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
14183 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
14184 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
14185 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
14186 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
14187 self.assertEqual("remote2", actionSet.actionSet[0].remotePeers[1].name)
14188 self.assertEqual("ruser2", actionSet.actionSet[0].remotePeers[1].remoteUser)
14189 self.assertEqual(None, actionSet.actionSet[0].remotePeers[1].localUser)
14190 self.assertEqual("rsh2", actionSet.actionSet[0].remotePeers[1].rshCommand)
14191 self.assertEqual("cback2", actionSet.actionSet[0].remotePeers[1].cbackCommand)
14192
14193 def testManagedPeer_136(self):
14194 """
14195 Test with actions=[ collect, purge ], extensions=[], two peers (both managed),
14196 managed=True, local=False
14197 """
14198 actions = [
14199 "collect",
14200 "purge",
14201 ]
14202 extensions = ExtensionsConfig([], None)
14203 options = OptionsConfig()
14204 options.managedActions = [
14205 "collect",
14206 "purge",
14207 "one",
14208 ]
14209 peers = PeersConfig()
14210 peers.localPeers = [
14211 LocalPeer("local", "/collect"),
14212 ]
14213 peers.remotePeers = [
14214 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
14215 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
14216 ]
14217 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
14218 self.assertTrue(len(actionSet.actionSet) == 2)
14219
14220 self.assertEqual(100, actionSet.actionSet[0].index)
14221 self.assertEqual("collect", actionSet.actionSet[0].name)
14222 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
14223 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 2)
14224 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
14225 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
14226 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
14227 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
14228 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
14229 self.assertEqual("remote2", actionSet.actionSet[0].remotePeers[1].name)
14230 self.assertEqual("ruser2", actionSet.actionSet[0].remotePeers[1].remoteUser)
14231 self.assertEqual(None, actionSet.actionSet[0].remotePeers[1].localUser)
14232 self.assertEqual("rsh2", actionSet.actionSet[0].remotePeers[1].rshCommand)
14233 self.assertEqual("cback2", actionSet.actionSet[0].remotePeers[1].cbackCommand)
14234
14235 self.assertEqual(400, actionSet.actionSet[1].index)
14236 self.assertEqual("purge", actionSet.actionSet[1].name)
14237 self.assertFalse(actionSet.actionSet[1].remotePeers is None)
14238 self.assertTrue(len(actionSet.actionSet[1].remotePeers) == 2)
14239 self.assertEqual("remote", actionSet.actionSet[1].remotePeers[0].name)
14240 self.assertEqual("ruser", actionSet.actionSet[1].remotePeers[0].remoteUser)
14241 self.assertEqual(None, actionSet.actionSet[1].remotePeers[0].localUser)
14242 self.assertEqual("rsh", actionSet.actionSet[1].remotePeers[0].rshCommand)
14243 self.assertEqual("cback", actionSet.actionSet[1].remotePeers[0].cbackCommand)
14244 self.assertEqual("remote2", actionSet.actionSet[1].remotePeers[1].name)
14245 self.assertEqual("ruser2", actionSet.actionSet[1].remotePeers[1].remoteUser)
14246 self.assertEqual(None, actionSet.actionSet[1].remotePeers[1].localUser)
14247 self.assertEqual("rsh2", actionSet.actionSet[1].remotePeers[1].rshCommand)
14248 self.assertEqual("cback2", actionSet.actionSet[1].remotePeers[1].cbackCommand)
14249
14250 def testManagedPeer_137(self):
14251 """
14252 Test with actions=[ stage, collect ], extensions=[], two peers (both managed),
14253 managed=True, local=False
14254 """
14255 actions = [
14256 "stage",
14257 "collect",
14258 ]
14259 extensions = ExtensionsConfig([], None)
14260 options = OptionsConfig()
14261 options.managedActions = [
14262 "collect",
14263 "purge",
14264 "one",
14265 ]
14266 peers = PeersConfig()
14267 peers.localPeers = [
14268 LocalPeer("local", "/collect"),
14269 ]
14270 peers.remotePeers = [
14271 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
14272 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
14273 ]
14274 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
14275 self.assertTrue(len(actionSet.actionSet) == 1)
14276
14277 self.assertEqual(100, actionSet.actionSet[0].index)
14278 self.assertEqual("collect", actionSet.actionSet[0].name)
14279 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
14280 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 2)
14281 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
14282 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
14283 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
14284 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
14285 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
14286 self.assertEqual("remote2", actionSet.actionSet[0].remotePeers[1].name)
14287 self.assertEqual("ruser2", actionSet.actionSet[0].remotePeers[1].remoteUser)
14288 self.assertEqual(None, actionSet.actionSet[0].remotePeers[1].localUser)
14289 self.assertEqual("rsh2", actionSet.actionSet[0].remotePeers[1].rshCommand)
14290 self.assertEqual("cback2", actionSet.actionSet[0].remotePeers[1].cbackCommand)
14291
14292 def testManagedPeer_138(self):
14293 """
14294 Test with actions=[ stage, stage ], extensions=[], two peers (both managed),
14295 managed=True, local=False
14296 """
14297 actions = [
14298 "stage",
14299 "stage",
14300 ]
14301 extensions = ExtensionsConfig([], None)
14302 options = OptionsConfig()
14303 options.managedActions = [
14304 "collect",
14305 "purge",
14306 "one",
14307 ]
14308 peers = PeersConfig()
14309 peers.localPeers = [
14310 LocalPeer("local", "/collect"),
14311 ]
14312 peers.remotePeers = [
14313 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
14314 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
14315 ]
14316 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
14317 self.assertTrue(len(actionSet.actionSet) == 0)
14318
14319 def testManagedPeer_139(self):
14320 """
14321 Test with actions=[ stage, store ], extensions=[], two peers (both managed),
14322 managed=True, local=False
14323 """
14324 actions = [
14325 "stage",
14326 "store",
14327 ]
14328 extensions = ExtensionsConfig([], None)
14329 options = OptionsConfig()
14330 options.managedActions = [
14331 "collect",
14332 "purge",
14333 "one",
14334 ]
14335 peers = PeersConfig()
14336 peers.localPeers = [
14337 LocalPeer("local", "/collect"),
14338 ]
14339 peers.remotePeers = [
14340 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
14341 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
14342 ]
14343 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
14344 self.assertTrue(len(actionSet.actionSet) == 0)
14345
14346 def testManagedPeer_140(self):
14347 """
14348 Test with actions=[ stage, purge ], extensions=[], two peers (both managed),
14349 managed=True, local=False
14350 """
14351 actions = [
14352 "stage",
14353 "purge",
14354 ]
14355 extensions = ExtensionsConfig([], None)
14356 options = OptionsConfig()
14357 options.managedActions = [
14358 "collect",
14359 "purge",
14360 "one",
14361 ]
14362 peers = PeersConfig()
14363 peers.localPeers = [
14364 LocalPeer("local", "/collect"),
14365 ]
14366 peers.remotePeers = [
14367 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
14368 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
14369 ]
14370 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
14371 self.assertTrue(len(actionSet.actionSet) == 1)
14372
14373 self.assertEqual(400, actionSet.actionSet[0].index)
14374 self.assertEqual("purge", actionSet.actionSet[0].name)
14375 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
14376 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 2)
14377 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
14378 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
14379 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
14380 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
14381 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
14382 self.assertEqual("remote2", actionSet.actionSet[0].remotePeers[1].name)
14383 self.assertEqual("ruser2", actionSet.actionSet[0].remotePeers[1].remoteUser)
14384 self.assertEqual(None, actionSet.actionSet[0].remotePeers[1].localUser)
14385 self.assertEqual("rsh2", actionSet.actionSet[0].remotePeers[1].rshCommand)
14386 self.assertEqual("cback2", actionSet.actionSet[0].remotePeers[1].cbackCommand)
14387
14388 def testManagedPeer_141(self):
14389 """
14390 Test with actions=[ collect, one ], extensions=[ (one, index 50) ],
14391 two peers (both managed), managed=True, local=False
14392 """
14393 actions = [
14394 "collect",
14395 "one",
14396 ]
14397 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
14398 options = OptionsConfig()
14399 options.managedActions = [
14400 "collect",
14401 "purge",
14402 "one",
14403 ]
14404 peers = PeersConfig()
14405 peers.localPeers = [
14406 LocalPeer("local", "/collect"),
14407 ]
14408 peers.remotePeers = [
14409 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
14410 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
14411 ]
14412 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
14413 self.assertTrue(len(actionSet.actionSet) == 2)
14414
14415 self.assertEqual(50, actionSet.actionSet[0].index)
14416 self.assertEqual("one", actionSet.actionSet[0].name)
14417 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
14418 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 2)
14419 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
14420 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
14421 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
14422 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
14423 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
14424 self.assertEqual("remote2", actionSet.actionSet[0].remotePeers[1].name)
14425 self.assertEqual("ruser2", actionSet.actionSet[0].remotePeers[1].remoteUser)
14426 self.assertEqual(None, actionSet.actionSet[0].remotePeers[1].localUser)
14427 self.assertEqual("rsh2", actionSet.actionSet[0].remotePeers[1].rshCommand)
14428 self.assertEqual("cback2", actionSet.actionSet[0].remotePeers[1].cbackCommand)
14429
14430 self.assertEqual(100, actionSet.actionSet[1].index)
14431 self.assertEqual("collect", actionSet.actionSet[1].name)
14432 self.assertFalse(actionSet.actionSet[1].remotePeers is None)
14433 self.assertTrue(len(actionSet.actionSet[1].remotePeers) == 2)
14434 self.assertEqual("remote", actionSet.actionSet[1].remotePeers[0].name)
14435 self.assertEqual("ruser", actionSet.actionSet[1].remotePeers[0].remoteUser)
14436 self.assertEqual(None, actionSet.actionSet[1].remotePeers[0].localUser)
14437 self.assertEqual("rsh", actionSet.actionSet[1].remotePeers[0].rshCommand)
14438 self.assertEqual("cback", actionSet.actionSet[1].remotePeers[0].cbackCommand)
14439 self.assertEqual("remote2", actionSet.actionSet[1].remotePeers[1].name)
14440 self.assertEqual("ruser2", actionSet.actionSet[1].remotePeers[1].remoteUser)
14441 self.assertEqual(None, actionSet.actionSet[1].remotePeers[1].localUser)
14442 self.assertEqual("rsh2", actionSet.actionSet[1].remotePeers[1].rshCommand)
14443 self.assertEqual("cback2", actionSet.actionSet[1].remotePeers[1].cbackCommand)
14444
14445 def testManagedPeer_142(self):
14446 """
14447 Test with actions=[ store, one ], extensions=[ (one, index 50) ],
14448 two peers (both managed), managed=True, local=False
14449 """
14450 actions = [
14451 "store",
14452 "one",
14453 ]
14454 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
14455 options = OptionsConfig()
14456 options.managedActions = [
14457 "collect",
14458 "purge",
14459 "one",
14460 ]
14461 peers = PeersConfig()
14462 peers.localPeers = [
14463 LocalPeer("local", "/collect"),
14464 ]
14465 peers.remotePeers = [
14466 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
14467 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
14468 ]
14469 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
14470 self.assertTrue(len(actionSet.actionSet) == 1)
14471
14472 self.assertEqual(50, actionSet.actionSet[0].index)
14473 self.assertEqual("one", actionSet.actionSet[0].name)
14474 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
14475 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 2)
14476 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
14477 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
14478 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
14479 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
14480 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
14481 self.assertEqual("remote2", actionSet.actionSet[0].remotePeers[1].name)
14482 self.assertEqual("ruser2", actionSet.actionSet[0].remotePeers[1].remoteUser)
14483 self.assertEqual(None, actionSet.actionSet[0].remotePeers[1].localUser)
14484 self.assertEqual("rsh2", actionSet.actionSet[0].remotePeers[1].rshCommand)
14485 self.assertEqual("cback2", actionSet.actionSet[0].remotePeers[1].cbackCommand)
14486
14487 def testManagedPeer_143(self):
14488 """
14489 Test with actions=[ collect, one ], extensions=[ (one, index 150) ],
14490 two peers (both managed), managed=True, local=False
14491 """
14492 actions = [
14493 "collect",
14494 "one",
14495 ]
14496 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 150)], None)
14497 options = OptionsConfig()
14498 options.managedActions = [
14499 "collect",
14500 "purge",
14501 "one",
14502 ]
14503 peers = PeersConfig()
14504 peers.localPeers = [
14505 LocalPeer("local", "/collect"),
14506 ]
14507 peers.remotePeers = [
14508 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
14509 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
14510 ]
14511 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
14512 self.assertTrue(len(actionSet.actionSet) == 2)
14513
14514 self.assertEqual(100, actionSet.actionSet[0].index)
14515 self.assertEqual("collect", actionSet.actionSet[0].name)
14516 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
14517 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 2)
14518 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
14519 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
14520 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
14521 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
14522 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
14523 self.assertEqual("remote2", actionSet.actionSet[0].remotePeers[1].name)
14524 self.assertEqual("ruser2", actionSet.actionSet[0].remotePeers[1].remoteUser)
14525 self.assertEqual(None, actionSet.actionSet[0].remotePeers[1].localUser)
14526 self.assertEqual("rsh2", actionSet.actionSet[0].remotePeers[1].rshCommand)
14527 self.assertEqual("cback2", actionSet.actionSet[0].remotePeers[1].cbackCommand)
14528
14529 self.assertEqual(150, actionSet.actionSet[1].index)
14530 self.assertEqual("one", actionSet.actionSet[1].name)
14531 self.assertFalse(actionSet.actionSet[1].remotePeers is None)
14532 self.assertTrue(len(actionSet.actionSet[1].remotePeers) == 2)
14533 self.assertEqual("remote", actionSet.actionSet[1].remotePeers[0].name)
14534 self.assertEqual("ruser", actionSet.actionSet[1].remotePeers[0].remoteUser)
14535 self.assertEqual(None, actionSet.actionSet[1].remotePeers[0].localUser)
14536 self.assertEqual("rsh", actionSet.actionSet[1].remotePeers[0].rshCommand)
14537 self.assertEqual("cback", actionSet.actionSet[1].remotePeers[0].cbackCommand)
14538 self.assertEqual("remote2", actionSet.actionSet[1].remotePeers[1].name)
14539 self.assertEqual("ruser2", actionSet.actionSet[1].remotePeers[1].remoteUser)
14540 self.assertEqual(None, actionSet.actionSet[1].remotePeers[1].localUser)
14541 self.assertEqual("rsh2", actionSet.actionSet[1].remotePeers[1].rshCommand)
14542 self.assertEqual("cback2", actionSet.actionSet[1].remotePeers[1].cbackCommand)
14543
14544 def testManagedPeer_144(self):
14545 """
14546 Test with actions=[ store, one ], extensions=[ (one, index 150) ],
14547 two peers (both managed), managed=True, local=False
14548 """
14549 actions = [
14550 "store",
14551 "one",
14552 ]
14553 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 150)], None)
14554 options = OptionsConfig()
14555 options.managedActions = [
14556 "collect",
14557 "purge",
14558 "one",
14559 ]
14560 peers = PeersConfig()
14561 peers.localPeers = [
14562 LocalPeer("local", "/collect"),
14563 ]
14564 peers.remotePeers = [
14565 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
14566 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
14567 ]
14568 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
14569 self.assertTrue(len(actionSet.actionSet) == 1)
14570
14571 self.assertEqual(150, actionSet.actionSet[0].index)
14572 self.assertEqual("one", actionSet.actionSet[0].name)
14573 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
14574 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 2)
14575 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
14576 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
14577 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
14578 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
14579 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
14580 self.assertEqual("remote2", actionSet.actionSet[0].remotePeers[1].name)
14581 self.assertEqual("ruser2", actionSet.actionSet[0].remotePeers[1].remoteUser)
14582 self.assertEqual(None, actionSet.actionSet[0].remotePeers[1].localUser)
14583 self.assertEqual("rsh2", actionSet.actionSet[0].remotePeers[1].rshCommand)
14584 self.assertEqual("cback2", actionSet.actionSet[0].remotePeers[1].cbackCommand)
14585
14586 def testManagedPeer_145(self):
14587 """
14588 Test with actions=[ collect, stage, store, purge ], extensions=[],
14589 two peers (both managed), managed=True, local=False
14590 """
14591 actions = [
14592 "collect",
14593 "stage",
14594 "store",
14595 "purge",
14596 ]
14597 extensions = ExtensionsConfig([], None)
14598 options = OptionsConfig()
14599 options.managedActions = [
14600 "collect",
14601 "purge",
14602 "one",
14603 ]
14604 peers = PeersConfig()
14605 peers.localPeers = [
14606 LocalPeer("local", "/collect"),
14607 ]
14608 peers.remotePeers = [
14609 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
14610 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
14611 ]
14612 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
14613 self.assertTrue(len(actionSet.actionSet) == 2)
14614
14615 self.assertEqual(100, actionSet.actionSet[0].index)
14616 self.assertEqual("collect", actionSet.actionSet[0].name)
14617 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
14618 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 2)
14619 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
14620 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
14621 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
14622 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
14623 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
14624 self.assertEqual("remote2", actionSet.actionSet[0].remotePeers[1].name)
14625 self.assertEqual("ruser2", actionSet.actionSet[0].remotePeers[1].remoteUser)
14626 self.assertEqual(None, actionSet.actionSet[0].remotePeers[1].localUser)
14627 self.assertEqual("rsh2", actionSet.actionSet[0].remotePeers[1].rshCommand)
14628 self.assertEqual("cback2", actionSet.actionSet[0].remotePeers[1].cbackCommand)
14629
14630 self.assertEqual(400, actionSet.actionSet[1].index)
14631 self.assertEqual("purge", actionSet.actionSet[1].name)
14632 self.assertFalse(actionSet.actionSet[1].remotePeers is None)
14633 self.assertTrue(len(actionSet.actionSet[1].remotePeers) == 2)
14634 self.assertEqual("remote", actionSet.actionSet[1].remotePeers[0].name)
14635 self.assertEqual("ruser", actionSet.actionSet[1].remotePeers[0].remoteUser)
14636 self.assertEqual(None, actionSet.actionSet[1].remotePeers[0].localUser)
14637 self.assertEqual("rsh", actionSet.actionSet[1].remotePeers[0].rshCommand)
14638 self.assertEqual("cback", actionSet.actionSet[1].remotePeers[0].cbackCommand)
14639 self.assertEqual("remote2", actionSet.actionSet[1].remotePeers[1].name)
14640 self.assertEqual("ruser2", actionSet.actionSet[1].remotePeers[1].remoteUser)
14641 self.assertEqual(None, actionSet.actionSet[1].remotePeers[1].localUser)
14642 self.assertEqual("rsh2", actionSet.actionSet[1].remotePeers[1].rshCommand)
14643 self.assertEqual("cback2", actionSet.actionSet[1].remotePeers[1].cbackCommand)
14644
14645 def testManagedPeer_146(self):
14646 """
14647 Test with actions=[ collect, stage, store, purge, one, two, three, four,
14648 five ], extensions=[ (index 50, 150, 250, 350, 450)], two peers (both managed),
14649 managed=True, local=False
14650 """
14651 actions = [
14652 "collect",
14653 "stage",
14654 "store",
14655 "purge",
14656 "one",
14657 "two",
14658 "three",
14659 "four",
14660 "five",
14661 ]
14662 extensions = ExtensionsConfig(
14663 [
14664 ExtendedAction("one", "os.path", "isdir", 50),
14665 ExtendedAction("two", "os.path", "isfile", 150),
14666 ExtendedAction("three", "os.path", "islink", 250),
14667 ExtendedAction("four", "os.path", "isabs", 350),
14668 ExtendedAction("five", "os.path", "exists", 450),
14669 ],
14670 None,
14671 )
14672 options = OptionsConfig()
14673 options.managedActions = [
14674 "collect",
14675 "purge",
14676 "one",
14677 ]
14678 peers = PeersConfig()
14679 peers.localPeers = [
14680 LocalPeer("local", "/collect"),
14681 ]
14682 peers.remotePeers = [
14683 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
14684 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
14685 ]
14686 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
14687 self.assertTrue(len(actionSet.actionSet) == 3)
14688
14689 self.assertEqual(50, actionSet.actionSet[0].index)
14690 self.assertEqual("one", actionSet.actionSet[0].name)
14691 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
14692 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 2)
14693 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
14694 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
14695 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
14696 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
14697 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
14698 self.assertEqual("remote2", actionSet.actionSet[0].remotePeers[1].name)
14699 self.assertEqual("ruser2", actionSet.actionSet[0].remotePeers[1].remoteUser)
14700 self.assertEqual(None, actionSet.actionSet[0].remotePeers[1].localUser)
14701 self.assertEqual("rsh2", actionSet.actionSet[0].remotePeers[1].rshCommand)
14702 self.assertEqual("cback2", actionSet.actionSet[0].remotePeers[1].cbackCommand)
14703
14704 self.assertEqual(100, actionSet.actionSet[1].index)
14705 self.assertEqual("collect", actionSet.actionSet[1].name)
14706 self.assertFalse(actionSet.actionSet[1].remotePeers is None)
14707 self.assertTrue(len(actionSet.actionSet[1].remotePeers) == 2)
14708 self.assertEqual("remote", actionSet.actionSet[1].remotePeers[0].name)
14709 self.assertEqual("ruser", actionSet.actionSet[1].remotePeers[0].remoteUser)
14710 self.assertEqual(None, actionSet.actionSet[1].remotePeers[0].localUser)
14711 self.assertEqual("rsh", actionSet.actionSet[1].remotePeers[0].rshCommand)
14712 self.assertEqual("cback", actionSet.actionSet[1].remotePeers[0].cbackCommand)
14713 self.assertEqual("remote2", actionSet.actionSet[1].remotePeers[1].name)
14714 self.assertEqual("ruser2", actionSet.actionSet[1].remotePeers[1].remoteUser)
14715 self.assertEqual(None, actionSet.actionSet[1].remotePeers[1].localUser)
14716 self.assertEqual("rsh2", actionSet.actionSet[1].remotePeers[1].rshCommand)
14717 self.assertEqual("cback2", actionSet.actionSet[1].remotePeers[1].cbackCommand)
14718
14719 self.assertEqual(400, actionSet.actionSet[2].index)
14720 self.assertEqual("purge", actionSet.actionSet[2].name)
14721 self.assertFalse(actionSet.actionSet[2].remotePeers is None)
14722 self.assertTrue(len(actionSet.actionSet[2].remotePeers) == 2)
14723 self.assertEqual("remote", actionSet.actionSet[2].remotePeers[0].name)
14724 self.assertEqual("ruser", actionSet.actionSet[2].remotePeers[0].remoteUser)
14725 self.assertEqual(None, actionSet.actionSet[2].remotePeers[0].localUser)
14726 self.assertEqual("rsh", actionSet.actionSet[2].remotePeers[0].rshCommand)
14727 self.assertEqual("cback", actionSet.actionSet[2].remotePeers[0].cbackCommand)
14728 self.assertEqual("remote2", actionSet.actionSet[2].remotePeers[1].name)
14729 self.assertEqual("ruser2", actionSet.actionSet[2].remotePeers[1].remoteUser)
14730 self.assertEqual(None, actionSet.actionSet[2].remotePeers[1].localUser)
14731 self.assertEqual("rsh2", actionSet.actionSet[2].remotePeers[1].rshCommand)
14732 self.assertEqual("cback2", actionSet.actionSet[2].remotePeers[1].cbackCommand)
14733
14734 def testManagedPeer_147(self):
14735 """
14736 Test with actions=[ one ], extensions=[ (one, index 50) ], two peers (both managed),
14737 managed=True, local=False
14738 """
14739 actions = [
14740 "one",
14741 ]
14742 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
14743 options = OptionsConfig()
14744 options.managedActions = [
14745 "collect",
14746 "purge",
14747 "one",
14748 ]
14749 peers = PeersConfig()
14750 peers.localPeers = [
14751 LocalPeer("local", "/collect"),
14752 ]
14753 peers.remotePeers = [
14754 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
14755 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
14756 ]
14757 actionSet = _ActionSet(actions, extensions, options, peers, True, False)
14758 self.assertTrue(len(actionSet.actionSet) == 1)
14759
14760 self.assertEqual(50, actionSet.actionSet[0].index)
14761 self.assertEqual("one", actionSet.actionSet[0].name)
14762 self.assertFalse(actionSet.actionSet[0].remotePeers is None)
14763 self.assertTrue(len(actionSet.actionSet[0].remotePeers) == 2)
14764 self.assertEqual("remote", actionSet.actionSet[0].remotePeers[0].name)
14765 self.assertEqual("ruser", actionSet.actionSet[0].remotePeers[0].remoteUser)
14766 self.assertEqual(None, actionSet.actionSet[0].remotePeers[0].localUser)
14767 self.assertEqual("rsh", actionSet.actionSet[0].remotePeers[0].rshCommand)
14768 self.assertEqual("cback", actionSet.actionSet[0].remotePeers[0].cbackCommand)
14769 self.assertEqual("remote2", actionSet.actionSet[0].remotePeers[1].name)
14770 self.assertEqual("ruser2", actionSet.actionSet[0].remotePeers[1].remoteUser)
14771 self.assertEqual(None, actionSet.actionSet[0].remotePeers[1].localUser)
14772 self.assertEqual("rsh2", actionSet.actionSet[0].remotePeers[1].rshCommand)
14773 self.assertEqual("cback2", actionSet.actionSet[0].remotePeers[1].cbackCommand)
14774
14775 def testManagedPeer_148(self):
14776 """
14777 Test with actions=[ collect ], extensions=[], two peers (both managed), managed=True,
14778 local=True
14779 """
14780 actions = [
14781 "collect",
14782 ]
14783 extensions = ExtensionsConfig([], None)
14784 options = OptionsConfig()
14785 options.managedActions = [
14786 "collect",
14787 "purge",
14788 "one",
14789 ]
14790 peers = PeersConfig()
14791 peers.localPeers = [
14792 LocalPeer("local", "/collect"),
14793 ]
14794 peers.remotePeers = [
14795 RemotePeer("remote", None, "ruser", None, "rsh", "cback", managed=True),
14796 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
14797 ]
14798 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
14799 self.assertFalse(actionSet.actionSet is None)
14800 self.assertTrue(len(actionSet.actionSet) == 2)
14801
14802 self.assertEqual(100, actionSet.actionSet[0].index)
14803 self.assertEqual("collect", actionSet.actionSet[0].name)
14804 self.assertEqual(None, actionSet.actionSet[0].preHooks)
14805 self.assertEqual(None, actionSet.actionSet[0].postHooks)
14806 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
14807
14808 self.assertEqual(100, actionSet.actionSet[1].index)
14809 self.assertEqual("collect", actionSet.actionSet[1].name)
14810 self.assertFalse(actionSet.actionSet[1].remotePeers is None)
14811 self.assertTrue(len(actionSet.actionSet[1].remotePeers) == 2)
14812 self.assertEqual("remote", actionSet.actionSet[1].remotePeers[0].name)
14813 self.assertEqual("ruser", actionSet.actionSet[1].remotePeers[0].remoteUser)
14814 self.assertEqual(None, actionSet.actionSet[1].remotePeers[0].localUser)
14815 self.assertEqual("rsh", actionSet.actionSet[1].remotePeers[0].rshCommand)
14816 self.assertEqual("cback", actionSet.actionSet[1].remotePeers[0].cbackCommand)
14817 self.assertEqual("remote2", actionSet.actionSet[1].remotePeers[1].name)
14818 self.assertEqual("ruser2", actionSet.actionSet[1].remotePeers[1].remoteUser)
14819 self.assertEqual(None, actionSet.actionSet[1].remotePeers[1].localUser)
14820 self.assertEqual("rsh2", actionSet.actionSet[1].remotePeers[1].rshCommand)
14821 self.assertEqual("cback2", actionSet.actionSet[1].remotePeers[1].cbackCommand)
14822
14823 def testManagedPeer_149(self):
14824 """
14825 Test with actions=[ stage ], extensions=[], two peers (both managed), managed=True,
14826 local=True
14827 """
14828 actions = [
14829 "stage",
14830 ]
14831 extensions = ExtensionsConfig([], None)
14832 options = OptionsConfig()
14833 options.managedActions = [
14834 "collect",
14835 "purge",
14836 "one",
14837 ]
14838 peers = PeersConfig()
14839 peers.localPeers = [
14840 LocalPeer("local", "/collect"),
14841 ]
14842 peers.remotePeers = [
14843 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
14844 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
14845 ]
14846 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
14847 self.assertFalse(actionSet.actionSet is None)
14848 self.assertTrue(len(actionSet.actionSet) == 1)
14849
14850 self.assertEqual(200, actionSet.actionSet[0].index)
14851 self.assertEqual("stage", actionSet.actionSet[0].name)
14852 self.assertEqual(None, actionSet.actionSet[0].preHooks)
14853 self.assertEqual(None, actionSet.actionSet[0].postHooks)
14854 self.assertEqual(executeStage, actionSet.actionSet[0].function)
14855
14856 def testManagedPeer_150(self):
14857 """
14858 Test with actions=[ store ], extensions=[], two peers (both managed), managed=True,
14859 local=True
14860 """
14861 actions = [
14862 "store",
14863 ]
14864 extensions = ExtensionsConfig([], None)
14865 options = OptionsConfig()
14866 options.managedActions = [
14867 "collect",
14868 "purge",
14869 "one",
14870 ]
14871 peers = PeersConfig()
14872 peers.localPeers = [
14873 LocalPeer("local", "/collect"),
14874 ]
14875 peers.remotePeers = [
14876 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
14877 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
14878 ]
14879 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
14880 self.assertFalse(actionSet.actionSet is None)
14881 self.assertTrue(len(actionSet.actionSet) == 1)
14882
14883 self.assertEqual(300, actionSet.actionSet[0].index)
14884 self.assertEqual("store", actionSet.actionSet[0].name)
14885 self.assertEqual(None, actionSet.actionSet[0].preHooks)
14886 self.assertEqual(None, actionSet.actionSet[0].postHooks)
14887 self.assertEqual(executeStore, actionSet.actionSet[0].function)
14888
14889 def testManagedPeer_151(self):
14890 """
14891 Test with actions=[ purge ], extensions=[], two peers (both managed), managed=True,
14892 local=True
14893 """
14894 actions = [
14895 "purge",
14896 ]
14897 extensions = ExtensionsConfig([], None)
14898 options = OptionsConfig()
14899 options.managedActions = [
14900 "collect",
14901 "purge",
14902 "one",
14903 ]
14904 peers = PeersConfig()
14905 peers.localPeers = [
14906 LocalPeer("local", "/collect"),
14907 ]
14908 peers.remotePeers = [
14909 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
14910 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
14911 ]
14912 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
14913 self.assertFalse(actionSet.actionSet is None)
14914 self.assertTrue(len(actionSet.actionSet) == 2)
14915
14916 self.assertEqual(400, actionSet.actionSet[0].index)
14917 self.assertEqual("purge", actionSet.actionSet[0].name)
14918 self.assertEqual(None, actionSet.actionSet[0].preHooks)
14919 self.assertEqual(None, actionSet.actionSet[0].postHooks)
14920 self.assertEqual(executePurge, actionSet.actionSet[0].function)
14921
14922 self.assertEqual(400, actionSet.actionSet[1].index)
14923 self.assertEqual("purge", actionSet.actionSet[1].name)
14924 self.assertFalse(actionSet.actionSet[1].remotePeers is None)
14925 self.assertTrue(len(actionSet.actionSet[1].remotePeers) == 2)
14926 self.assertEqual("remote", actionSet.actionSet[1].remotePeers[0].name)
14927 self.assertEqual("ruser", actionSet.actionSet[1].remotePeers[0].remoteUser)
14928 self.assertEqual(None, actionSet.actionSet[1].remotePeers[0].localUser)
14929 self.assertEqual("rsh", actionSet.actionSet[1].remotePeers[0].rshCommand)
14930 self.assertEqual("cback", actionSet.actionSet[1].remotePeers[0].cbackCommand)
14931 self.assertEqual("remote2", actionSet.actionSet[1].remotePeers[1].name)
14932 self.assertEqual("ruser2", actionSet.actionSet[1].remotePeers[1].remoteUser)
14933 self.assertEqual(None, actionSet.actionSet[1].remotePeers[1].localUser)
14934 self.assertEqual("rsh2", actionSet.actionSet[1].remotePeers[1].rshCommand)
14935 self.assertEqual("cback2", actionSet.actionSet[1].remotePeers[1].cbackCommand)
14936
14937 def testManagedPeer_152(self):
14938 """
14939 Test with actions=[ all ], extensions=[], two peers (both managed), managed=True,
14940 local=True
14941 """
14942 actions = [
14943 "all",
14944 ]
14945 extensions = ExtensionsConfig([], None)
14946 options = OptionsConfig()
14947 options.managedActions = [
14948 "collect",
14949 "purge",
14950 "one",
14951 ]
14952 peers = PeersConfig()
14953 peers.localPeers = [
14954 LocalPeer("local", "/collect"),
14955 ]
14956 peers.remotePeers = [
14957 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
14958 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
14959 ]
14960 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
14961 self.assertFalse(actionSet.actionSet is None)
14962 self.assertTrue(len(actionSet.actionSet) == 6)
14963
14964 self.assertEqual(100, actionSet.actionSet[0].index)
14965 self.assertEqual("collect", actionSet.actionSet[0].name)
14966 self.assertEqual(None, actionSet.actionSet[0].preHooks)
14967 self.assertEqual(None, actionSet.actionSet[0].postHooks)
14968 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
14969
14970 self.assertEqual(100, actionSet.actionSet[1].index)
14971 self.assertEqual("collect", actionSet.actionSet[1].name)
14972 self.assertFalse(actionSet.actionSet[1].remotePeers is None)
14973 self.assertTrue(len(actionSet.actionSet[1].remotePeers) == 2)
14974 self.assertEqual("remote", actionSet.actionSet[1].remotePeers[0].name)
14975 self.assertEqual("ruser", actionSet.actionSet[1].remotePeers[0].remoteUser)
14976 self.assertEqual(None, actionSet.actionSet[1].remotePeers[0].localUser)
14977 self.assertEqual("rsh", actionSet.actionSet[1].remotePeers[0].rshCommand)
14978 self.assertEqual("cback", actionSet.actionSet[1].remotePeers[0].cbackCommand)
14979 self.assertEqual("remote2", actionSet.actionSet[1].remotePeers[1].name)
14980 self.assertEqual("ruser2", actionSet.actionSet[1].remotePeers[1].remoteUser)
14981 self.assertEqual(None, actionSet.actionSet[1].remotePeers[1].localUser)
14982 self.assertEqual("rsh2", actionSet.actionSet[1].remotePeers[1].rshCommand)
14983 self.assertEqual("cback2", actionSet.actionSet[1].remotePeers[1].cbackCommand)
14984
14985 self.assertEqual(200, actionSet.actionSet[2].index)
14986 self.assertEqual("stage", actionSet.actionSet[2].name)
14987 self.assertEqual(None, actionSet.actionSet[2].preHooks)
14988 self.assertEqual(None, actionSet.actionSet[2].postHooks)
14989 self.assertEqual(executeStage, actionSet.actionSet[2].function)
14990
14991 self.assertEqual(300, actionSet.actionSet[3].index)
14992 self.assertEqual("store", actionSet.actionSet[3].name)
14993 self.assertEqual(None, actionSet.actionSet[3].preHooks)
14994 self.assertEqual(None, actionSet.actionSet[3].postHooks)
14995 self.assertEqual(executeStore, actionSet.actionSet[3].function)
14996
14997 self.assertEqual(400, actionSet.actionSet[4].index)
14998 self.assertEqual("purge", actionSet.actionSet[4].name)
14999 self.assertEqual(None, actionSet.actionSet[4].preHooks)
15000 self.assertEqual(None, actionSet.actionSet[4].postHooks)
15001 self.assertEqual(executePurge, actionSet.actionSet[4].function)
15002
15003 self.assertEqual(400, actionSet.actionSet[5].index)
15004 self.assertEqual("purge", actionSet.actionSet[5].name)
15005 self.assertFalse(actionSet.actionSet[5].remotePeers is None)
15006 self.assertTrue(len(actionSet.actionSet[5].remotePeers) == 2)
15007 self.assertEqual("remote", actionSet.actionSet[5].remotePeers[0].name)
15008 self.assertEqual("ruser", actionSet.actionSet[5].remotePeers[0].remoteUser)
15009 self.assertEqual(None, actionSet.actionSet[5].remotePeers[0].localUser)
15010 self.assertEqual("rsh", actionSet.actionSet[5].remotePeers[0].rshCommand)
15011 self.assertEqual("cback", actionSet.actionSet[5].remotePeers[0].cbackCommand)
15012 self.assertEqual("remote2", actionSet.actionSet[5].remotePeers[1].name)
15013 self.assertEqual("ruser2", actionSet.actionSet[5].remotePeers[1].remoteUser)
15014 self.assertEqual(None, actionSet.actionSet[5].remotePeers[1].localUser)
15015 self.assertEqual("rsh2", actionSet.actionSet[5].remotePeers[1].rshCommand)
15016 self.assertEqual("cback2", actionSet.actionSet[5].remotePeers[1].cbackCommand)
15017
15018 def testManagedPeer_153(self):
15019 """
15020 Test with actions=[ rebuild ], extensions=[], two peers (both managed), managed=True,
15021 local=True
15022 """
15023 actions = [
15024 "rebuild",
15025 ]
15026 extensions = ExtensionsConfig([], None)
15027 options = OptionsConfig()
15028 options.managedActions = [
15029 "collect",
15030 "purge",
15031 "one",
15032 ]
15033 peers = PeersConfig()
15034 peers.localPeers = [
15035 LocalPeer("local", "/collect"),
15036 ]
15037 peers.remotePeers = [
15038 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
15039 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
15040 ]
15041 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
15042 self.assertTrue(len(actionSet.actionSet) == 1)
15043
15044 self.assertEqual(0, actionSet.actionSet[0].index)
15045 self.assertEqual("rebuild", actionSet.actionSet[0].name)
15046 self.assertEqual(None, actionSet.actionSet[0].preHooks)
15047 self.assertEqual(None, actionSet.actionSet[0].postHooks)
15048 self.assertEqual(executeRebuild, actionSet.actionSet[0].function)
15049
15050 def testManagedPeer_154(self):
15051 """
15052 Test with actions=[ validate ], extensions=[], two peers (both managed), managed=True,
15053 local=True
15054 """
15055 actions = [
15056 "validate",
15057 ]
15058 extensions = ExtensionsConfig([], None)
15059 options = OptionsConfig()
15060 options.managedActions = [
15061 "collect",
15062 "purge",
15063 "one",
15064 ]
15065 peers = PeersConfig()
15066 peers.localPeers = [
15067 LocalPeer("local", "/collect"),
15068 ]
15069 peers.remotePeers = [
15070 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
15071 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
15072 ]
15073 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
15074 self.assertTrue(len(actionSet.actionSet) == 1)
15075
15076 self.assertEqual(0, actionSet.actionSet[0].index)
15077 self.assertEqual("validate", actionSet.actionSet[0].name)
15078 self.assertEqual(None, actionSet.actionSet[0].preHooks)
15079 self.assertEqual(None, actionSet.actionSet[0].postHooks)
15080 self.assertEqual(executeValidate, actionSet.actionSet[0].function)
15081
15082 def testManagedPeer_155(self):
15083 """
15084 Test with actions=[ collect, stage ], extensions=[], two peers (both managed),
15085 managed=True, local=True
15086 """
15087 actions = [
15088 "collect",
15089 "stage",
15090 ]
15091 extensions = ExtensionsConfig([], None)
15092 options = OptionsConfig()
15093 options.managedActions = [
15094 "collect",
15095 "purge",
15096 "one",
15097 ]
15098 peers = PeersConfig()
15099 peers.localPeers = [
15100 LocalPeer("local", "/collect"),
15101 ]
15102 peers.remotePeers = [
15103 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
15104 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
15105 ]
15106 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
15107 self.assertTrue(len(actionSet.actionSet) == 3)
15108
15109 self.assertEqual(100, actionSet.actionSet[0].index)
15110 self.assertEqual("collect", actionSet.actionSet[0].name)
15111 self.assertEqual(None, actionSet.actionSet[0].preHooks)
15112 self.assertEqual(None, actionSet.actionSet[0].postHooks)
15113 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
15114
15115 self.assertEqual(100, actionSet.actionSet[1].index)
15116 self.assertEqual("collect", actionSet.actionSet[1].name)
15117 self.assertFalse(actionSet.actionSet[1].remotePeers is None)
15118 self.assertTrue(len(actionSet.actionSet[1].remotePeers) == 2)
15119 self.assertEqual("remote", actionSet.actionSet[1].remotePeers[0].name)
15120 self.assertEqual("ruser", actionSet.actionSet[1].remotePeers[0].remoteUser)
15121 self.assertEqual(None, actionSet.actionSet[1].remotePeers[0].localUser)
15122 self.assertEqual("rsh", actionSet.actionSet[1].remotePeers[0].rshCommand)
15123 self.assertEqual("cback", actionSet.actionSet[1].remotePeers[0].cbackCommand)
15124 self.assertEqual("remote2", actionSet.actionSet[1].remotePeers[1].name)
15125 self.assertEqual("ruser2", actionSet.actionSet[1].remotePeers[1].remoteUser)
15126 self.assertEqual(None, actionSet.actionSet[1].remotePeers[1].localUser)
15127 self.assertEqual("rsh2", actionSet.actionSet[1].remotePeers[1].rshCommand)
15128 self.assertEqual("cback2", actionSet.actionSet[1].remotePeers[1].cbackCommand)
15129
15130 self.assertEqual(200, actionSet.actionSet[2].index)
15131 self.assertEqual("stage", actionSet.actionSet[2].name)
15132 self.assertEqual(None, actionSet.actionSet[2].preHooks)
15133 self.assertEqual(None, actionSet.actionSet[2].postHooks)
15134 self.assertEqual(executeStage, actionSet.actionSet[2].function)
15135
15136 def testManagedPeer_156(self):
15137 """
15138 Test with actions=[ collect, store ], extensions=[], two peers (both managed),
15139 managed=True, local=True
15140 """
15141 actions = [
15142 "collect",
15143 "store",
15144 ]
15145 extensions = ExtensionsConfig([], None)
15146 options = OptionsConfig()
15147 options.managedActions = [
15148 "collect",
15149 "purge",
15150 "one",
15151 ]
15152 peers = PeersConfig()
15153 peers.localPeers = [
15154 LocalPeer("local", "/collect"),
15155 ]
15156 peers.remotePeers = [
15157 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
15158 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
15159 ]
15160 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
15161 self.assertTrue(len(actionSet.actionSet) == 3)
15162
15163 self.assertEqual(100, actionSet.actionSet[0].index)
15164 self.assertEqual("collect", actionSet.actionSet[0].name)
15165 self.assertEqual(None, actionSet.actionSet[0].preHooks)
15166 self.assertEqual(None, actionSet.actionSet[0].postHooks)
15167 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
15168
15169 self.assertEqual(100, actionSet.actionSet[1].index)
15170 self.assertEqual("collect", actionSet.actionSet[1].name)
15171 self.assertFalse(actionSet.actionSet[1].remotePeers is None)
15172 self.assertTrue(len(actionSet.actionSet[1].remotePeers) == 2)
15173 self.assertEqual("remote", actionSet.actionSet[1].remotePeers[0].name)
15174 self.assertEqual("ruser", actionSet.actionSet[1].remotePeers[0].remoteUser)
15175 self.assertEqual(None, actionSet.actionSet[1].remotePeers[0].localUser)
15176 self.assertEqual("rsh", actionSet.actionSet[1].remotePeers[0].rshCommand)
15177 self.assertEqual("cback", actionSet.actionSet[1].remotePeers[0].cbackCommand)
15178 self.assertEqual("remote2", actionSet.actionSet[1].remotePeers[1].name)
15179 self.assertEqual("ruser2", actionSet.actionSet[1].remotePeers[1].remoteUser)
15180 self.assertEqual(None, actionSet.actionSet[1].remotePeers[1].localUser)
15181 self.assertEqual("rsh2", actionSet.actionSet[1].remotePeers[1].rshCommand)
15182 self.assertEqual("cback2", actionSet.actionSet[1].remotePeers[1].cbackCommand)
15183
15184 self.assertEqual(300, actionSet.actionSet[2].index)
15185 self.assertEqual("store", actionSet.actionSet[2].name)
15186 self.assertEqual(None, actionSet.actionSet[2].preHooks)
15187 self.assertEqual(None, actionSet.actionSet[2].postHooks)
15188 self.assertEqual(executeStore, actionSet.actionSet[2].function)
15189
15190 def testManagedPeer_157(self):
15191 """
15192 Test with actions=[ collect, purge ], extensions=[], two peers (both managed),
15193 managed=True, local=True
15194 """
15195 actions = [
15196 "collect",
15197 "purge",
15198 ]
15199 extensions = ExtensionsConfig([], None)
15200 options = OptionsConfig()
15201 options.managedActions = [
15202 "collect",
15203 "purge",
15204 "one",
15205 ]
15206 peers = PeersConfig()
15207 peers.localPeers = [
15208 LocalPeer("local", "/collect"),
15209 ]
15210 peers.remotePeers = [
15211 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
15212 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
15213 ]
15214 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
15215 self.assertTrue(len(actionSet.actionSet) == 4)
15216
15217 self.assertEqual(100, actionSet.actionSet[0].index)
15218 self.assertEqual("collect", actionSet.actionSet[0].name)
15219 self.assertEqual(None, actionSet.actionSet[0].preHooks)
15220 self.assertEqual(None, actionSet.actionSet[0].postHooks)
15221 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
15222
15223 self.assertEqual(100, actionSet.actionSet[1].index)
15224 self.assertEqual("collect", actionSet.actionSet[1].name)
15225 self.assertFalse(actionSet.actionSet[1].remotePeers is None)
15226 self.assertTrue(len(actionSet.actionSet[1].remotePeers) == 2)
15227 self.assertEqual("remote", actionSet.actionSet[1].remotePeers[0].name)
15228 self.assertEqual("ruser", actionSet.actionSet[1].remotePeers[0].remoteUser)
15229 self.assertEqual(None, actionSet.actionSet[1].remotePeers[0].localUser)
15230 self.assertEqual("rsh", actionSet.actionSet[1].remotePeers[0].rshCommand)
15231 self.assertEqual("cback", actionSet.actionSet[1].remotePeers[0].cbackCommand)
15232 self.assertEqual("remote2", actionSet.actionSet[1].remotePeers[1].name)
15233 self.assertEqual("ruser2", actionSet.actionSet[1].remotePeers[1].remoteUser)
15234 self.assertEqual(None, actionSet.actionSet[1].remotePeers[1].localUser)
15235 self.assertEqual("rsh2", actionSet.actionSet[1].remotePeers[1].rshCommand)
15236 self.assertEqual("cback2", actionSet.actionSet[1].remotePeers[1].cbackCommand)
15237
15238 self.assertEqual(400, actionSet.actionSet[2].index)
15239 self.assertEqual("purge", actionSet.actionSet[2].name)
15240 self.assertEqual(None, actionSet.actionSet[2].preHooks)
15241 self.assertEqual(None, actionSet.actionSet[2].postHooks)
15242 self.assertEqual(executePurge, actionSet.actionSet[2].function)
15243
15244 self.assertEqual(400, actionSet.actionSet[3].index)
15245 self.assertEqual("purge", actionSet.actionSet[3].name)
15246 self.assertFalse(actionSet.actionSet[3].remotePeers is None)
15247 self.assertTrue(len(actionSet.actionSet[3].remotePeers) == 2)
15248 self.assertEqual("remote", actionSet.actionSet[3].remotePeers[0].name)
15249 self.assertEqual("ruser", actionSet.actionSet[3].remotePeers[0].remoteUser)
15250 self.assertEqual(None, actionSet.actionSet[3].remotePeers[0].localUser)
15251 self.assertEqual("rsh", actionSet.actionSet[3].remotePeers[0].rshCommand)
15252 self.assertEqual("cback", actionSet.actionSet[3].remotePeers[0].cbackCommand)
15253 self.assertEqual("remote2", actionSet.actionSet[3].remotePeers[1].name)
15254 self.assertEqual("ruser2", actionSet.actionSet[3].remotePeers[1].remoteUser)
15255 self.assertEqual(None, actionSet.actionSet[3].remotePeers[1].localUser)
15256 self.assertEqual("rsh2", actionSet.actionSet[3].remotePeers[1].rshCommand)
15257 self.assertEqual("cback2", actionSet.actionSet[3].remotePeers[1].cbackCommand)
15258
15259 def testManagedPeer_158(self):
15260 """
15261 Test with actions=[ stage, collect ], extensions=[], two peers (both managed),
15262 managed=True, local=True
15263 """
15264 actions = [
15265 "stage",
15266 "collect",
15267 ]
15268 extensions = ExtensionsConfig([], None)
15269 options = OptionsConfig()
15270 options.managedActions = [
15271 "collect",
15272 "purge",
15273 "one",
15274 ]
15275 peers = PeersConfig()
15276 peers.localPeers = [
15277 LocalPeer("local", "/collect"),
15278 ]
15279 peers.remotePeers = [
15280 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
15281 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
15282 ]
15283 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
15284 self.assertTrue(len(actionSet.actionSet) == 3)
15285
15286 self.assertEqual(100, actionSet.actionSet[0].index)
15287 self.assertEqual("collect", actionSet.actionSet[0].name)
15288 self.assertEqual(None, actionSet.actionSet[0].preHooks)
15289 self.assertEqual(None, actionSet.actionSet[0].postHooks)
15290 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
15291
15292 self.assertEqual(100, actionSet.actionSet[1].index)
15293 self.assertEqual("collect", actionSet.actionSet[1].name)
15294 self.assertFalse(actionSet.actionSet[1].remotePeers is None)
15295 self.assertTrue(len(actionSet.actionSet[1].remotePeers) == 2)
15296 self.assertEqual("remote", actionSet.actionSet[1].remotePeers[0].name)
15297 self.assertEqual("ruser", actionSet.actionSet[1].remotePeers[0].remoteUser)
15298 self.assertEqual(None, actionSet.actionSet[1].remotePeers[0].localUser)
15299 self.assertEqual("rsh", actionSet.actionSet[1].remotePeers[0].rshCommand)
15300 self.assertEqual("cback", actionSet.actionSet[1].remotePeers[0].cbackCommand)
15301 self.assertEqual("remote2", actionSet.actionSet[1].remotePeers[1].name)
15302 self.assertEqual("ruser2", actionSet.actionSet[1].remotePeers[1].remoteUser)
15303 self.assertEqual(None, actionSet.actionSet[1].remotePeers[1].localUser)
15304 self.assertEqual("rsh2", actionSet.actionSet[1].remotePeers[1].rshCommand)
15305 self.assertEqual("cback2", actionSet.actionSet[1].remotePeers[1].cbackCommand)
15306
15307 self.assertEqual(200, actionSet.actionSet[2].index)
15308 self.assertEqual("stage", actionSet.actionSet[2].name)
15309 self.assertEqual(None, actionSet.actionSet[2].preHooks)
15310 self.assertEqual(None, actionSet.actionSet[2].postHooks)
15311 self.assertEqual(executeStage, actionSet.actionSet[2].function)
15312
15313 def testManagedPeer_159(self):
15314 """
15315 Test with actions=[ stage, stage ], extensions=[], two peers (both managed),
15316 managed=True, local=True
15317 """
15318 actions = [
15319 "stage",
15320 "stage",
15321 ]
15322 extensions = ExtensionsConfig([], None)
15323 options = OptionsConfig()
15324 options.managedActions = [
15325 "collect",
15326 "purge",
15327 "one",
15328 ]
15329 peers = PeersConfig()
15330 peers.localPeers = [
15331 LocalPeer("local", "/collect"),
15332 ]
15333 peers.remotePeers = [
15334 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
15335 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
15336 ]
15337 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
15338 self.assertTrue(len(actionSet.actionSet) == 2)
15339
15340 self.assertEqual(200, actionSet.actionSet[0].index)
15341 self.assertEqual("stage", actionSet.actionSet[0].name)
15342 self.assertEqual(None, actionSet.actionSet[0].preHooks)
15343 self.assertEqual(None, actionSet.actionSet[0].postHooks)
15344 self.assertEqual(executeStage, actionSet.actionSet[0].function)
15345
15346 self.assertEqual(200, actionSet.actionSet[1].index)
15347 self.assertEqual("stage", actionSet.actionSet[1].name)
15348 self.assertEqual(None, actionSet.actionSet[1].preHooks)
15349 self.assertEqual(None, actionSet.actionSet[1].postHooks)
15350 self.assertEqual(executeStage, actionSet.actionSet[1].function)
15351
15352 def testManagedPeer_160(self):
15353 """
15354 Test with actions=[ stage, store ], extensions=[], two peers (both managed),
15355 managed=True, local=True
15356 """
15357 actions = [
15358 "stage",
15359 "store",
15360 ]
15361 extensions = ExtensionsConfig([], None)
15362 options = OptionsConfig()
15363 options.managedActions = [
15364 "collect",
15365 "purge",
15366 "one",
15367 ]
15368 peers = PeersConfig()
15369 peers.localPeers = [
15370 LocalPeer("local", "/collect"),
15371 ]
15372 peers.remotePeers = [
15373 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
15374 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
15375 ]
15376 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
15377 self.assertTrue(len(actionSet.actionSet) == 2)
15378
15379 self.assertEqual(200, actionSet.actionSet[0].index)
15380 self.assertEqual("stage", actionSet.actionSet[0].name)
15381 self.assertEqual(None, actionSet.actionSet[0].preHooks)
15382 self.assertEqual(None, actionSet.actionSet[0].postHooks)
15383 self.assertEqual(executeStage, actionSet.actionSet[0].function)
15384
15385 self.assertEqual(300, actionSet.actionSet[1].index)
15386 self.assertEqual("store", actionSet.actionSet[1].name)
15387 self.assertEqual(None, actionSet.actionSet[1].preHooks)
15388 self.assertEqual(None, actionSet.actionSet[1].postHooks)
15389 self.assertEqual(executeStore, actionSet.actionSet[1].function)
15390
15391 def testManagedPeer_161(self):
15392 """
15393 Test with actions=[ stage, purge ], extensions=[], two peers (both managed),
15394 managed=True, local=True
15395 """
15396 actions = [
15397 "stage",
15398 "purge",
15399 ]
15400 extensions = ExtensionsConfig([], None)
15401 options = OptionsConfig()
15402 options.managedActions = [
15403 "collect",
15404 "purge",
15405 "one",
15406 ]
15407 peers = PeersConfig()
15408 peers.localPeers = [
15409 LocalPeer("local", "/collect"),
15410 ]
15411 peers.remotePeers = [
15412 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
15413 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
15414 ]
15415 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
15416 self.assertTrue(len(actionSet.actionSet) == 3)
15417
15418 self.assertEqual(200, actionSet.actionSet[0].index)
15419 self.assertEqual("stage", actionSet.actionSet[0].name)
15420 self.assertEqual(None, actionSet.actionSet[0].preHooks)
15421 self.assertEqual(None, actionSet.actionSet[0].postHooks)
15422 self.assertEqual(executeStage, actionSet.actionSet[0].function)
15423
15424 self.assertEqual(400, actionSet.actionSet[1].index)
15425 self.assertEqual("purge", actionSet.actionSet[1].name)
15426 self.assertEqual(None, actionSet.actionSet[1].preHooks)
15427 self.assertEqual(None, actionSet.actionSet[1].postHooks)
15428 self.assertEqual(executePurge, actionSet.actionSet[1].function)
15429
15430 self.assertEqual(400, actionSet.actionSet[2].index)
15431 self.assertEqual("purge", actionSet.actionSet[2].name)
15432 self.assertFalse(actionSet.actionSet[2].remotePeers is None)
15433 self.assertTrue(len(actionSet.actionSet[2].remotePeers) == 2)
15434 self.assertEqual("remote", actionSet.actionSet[2].remotePeers[0].name)
15435 self.assertEqual("ruser", actionSet.actionSet[2].remotePeers[0].remoteUser)
15436 self.assertEqual(None, actionSet.actionSet[2].remotePeers[0].localUser)
15437 self.assertEqual("rsh", actionSet.actionSet[2].remotePeers[0].rshCommand)
15438 self.assertEqual("cback", actionSet.actionSet[2].remotePeers[0].cbackCommand)
15439 self.assertEqual("remote2", actionSet.actionSet[2].remotePeers[1].name)
15440 self.assertEqual("ruser2", actionSet.actionSet[2].remotePeers[1].remoteUser)
15441 self.assertEqual(None, actionSet.actionSet[2].remotePeers[1].localUser)
15442 self.assertEqual("rsh2", actionSet.actionSet[2].remotePeers[1].rshCommand)
15443 self.assertEqual("cback2", actionSet.actionSet[2].remotePeers[1].cbackCommand)
15444
15445 def testManagedPeer_162(self):
15446 """
15447 Test with actions=[ collect, one ], extensions=[ (one, index 50) ],
15448 two peers (both managed), managed=True, local=True
15449 """
15450 actions = [
15451 "collect",
15452 "one",
15453 ]
15454 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
15455 options = OptionsConfig()
15456 options.managedActions = [
15457 "collect",
15458 "purge",
15459 "one",
15460 ]
15461 peers = PeersConfig()
15462 peers.localPeers = [
15463 LocalPeer("local", "/collect"),
15464 ]
15465 peers.remotePeers = [
15466 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
15467 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
15468 ]
15469 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
15470 self.assertTrue(len(actionSet.actionSet) == 4)
15471
15472 self.assertEqual(50, actionSet.actionSet[0].index)
15473 self.assertEqual("one", actionSet.actionSet[0].name)
15474 self.assertEqual(None, actionSet.actionSet[0].preHooks)
15475 self.assertEqual(None, actionSet.actionSet[0].postHooks)
15476 self.assertEqual(isdir, actionSet.actionSet[0].function)
15477
15478 self.assertEqual(50, actionSet.actionSet[1].index)
15479 self.assertEqual("one", actionSet.actionSet[1].name)
15480 self.assertFalse(actionSet.actionSet[1].remotePeers is None)
15481 self.assertTrue(len(actionSet.actionSet[1].remotePeers) == 2)
15482 self.assertEqual("remote", actionSet.actionSet[1].remotePeers[0].name)
15483 self.assertEqual("ruser", actionSet.actionSet[1].remotePeers[0].remoteUser)
15484 self.assertEqual(None, actionSet.actionSet[1].remotePeers[0].localUser)
15485 self.assertEqual("rsh", actionSet.actionSet[1].remotePeers[0].rshCommand)
15486 self.assertEqual("cback", actionSet.actionSet[1].remotePeers[0].cbackCommand)
15487 self.assertEqual("remote2", actionSet.actionSet[1].remotePeers[1].name)
15488 self.assertEqual("ruser2", actionSet.actionSet[1].remotePeers[1].remoteUser)
15489 self.assertEqual(None, actionSet.actionSet[1].remotePeers[1].localUser)
15490 self.assertEqual("rsh2", actionSet.actionSet[1].remotePeers[1].rshCommand)
15491 self.assertEqual("cback2", actionSet.actionSet[1].remotePeers[1].cbackCommand)
15492
15493 self.assertEqual(100, actionSet.actionSet[2].index)
15494 self.assertEqual("collect", actionSet.actionSet[2].name)
15495 self.assertEqual(None, actionSet.actionSet[2].preHooks)
15496 self.assertEqual(None, actionSet.actionSet[2].postHooks)
15497 self.assertEqual(executeCollect, actionSet.actionSet[2].function)
15498
15499 self.assertEqual(100, actionSet.actionSet[3].index)
15500 self.assertEqual("collect", actionSet.actionSet[3].name)
15501 self.assertFalse(actionSet.actionSet[3].remotePeers is None)
15502 self.assertTrue(len(actionSet.actionSet[3].remotePeers) == 2)
15503 self.assertEqual("remote", actionSet.actionSet[3].remotePeers[0].name)
15504 self.assertEqual("ruser", actionSet.actionSet[3].remotePeers[0].remoteUser)
15505 self.assertEqual(None, actionSet.actionSet[3].remotePeers[0].localUser)
15506 self.assertEqual("rsh", actionSet.actionSet[3].remotePeers[0].rshCommand)
15507 self.assertEqual("cback", actionSet.actionSet[3].remotePeers[0].cbackCommand)
15508 self.assertEqual("remote2", actionSet.actionSet[3].remotePeers[1].name)
15509 self.assertEqual("ruser2", actionSet.actionSet[3].remotePeers[1].remoteUser)
15510 self.assertEqual(None, actionSet.actionSet[3].remotePeers[1].localUser)
15511 self.assertEqual("rsh2", actionSet.actionSet[3].remotePeers[1].rshCommand)
15512 self.assertEqual("cback2", actionSet.actionSet[3].remotePeers[1].cbackCommand)
15513
15514 def testManagedPeer_163(self):
15515 """
15516 Test with actions=[ store, one ], extensions=[ (one, index 50) ],
15517 two peers (both managed), managed=True, local=True
15518 """
15519 actions = [
15520 "store",
15521 "one",
15522 ]
15523 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
15524 options = OptionsConfig()
15525 options.managedActions = [
15526 "collect",
15527 "purge",
15528 "one",
15529 ]
15530 peers = PeersConfig()
15531 peers.localPeers = [
15532 LocalPeer("local", "/collect"),
15533 ]
15534 peers.remotePeers = [
15535 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
15536 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
15537 ]
15538 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
15539 self.assertTrue(len(actionSet.actionSet) == 3)
15540
15541 self.assertEqual(50, actionSet.actionSet[0].index)
15542 self.assertEqual("one", actionSet.actionSet[0].name)
15543 self.assertEqual(None, actionSet.actionSet[0].preHooks)
15544 self.assertEqual(None, actionSet.actionSet[0].postHooks)
15545 self.assertEqual(isdir, actionSet.actionSet[0].function)
15546
15547 self.assertEqual(50, actionSet.actionSet[1].index)
15548 self.assertEqual("one", actionSet.actionSet[1].name)
15549 self.assertFalse(actionSet.actionSet[1].remotePeers is None)
15550 self.assertTrue(len(actionSet.actionSet[1].remotePeers) == 2)
15551 self.assertEqual("remote", actionSet.actionSet[1].remotePeers[0].name)
15552 self.assertEqual("ruser", actionSet.actionSet[1].remotePeers[0].remoteUser)
15553 self.assertEqual(None, actionSet.actionSet[1].remotePeers[0].localUser)
15554 self.assertEqual("rsh", actionSet.actionSet[1].remotePeers[0].rshCommand)
15555 self.assertEqual("cback", actionSet.actionSet[1].remotePeers[0].cbackCommand)
15556 self.assertEqual("remote2", actionSet.actionSet[1].remotePeers[1].name)
15557 self.assertEqual("ruser2", actionSet.actionSet[1].remotePeers[1].remoteUser)
15558 self.assertEqual(None, actionSet.actionSet[1].remotePeers[1].localUser)
15559 self.assertEqual("rsh2", actionSet.actionSet[1].remotePeers[1].rshCommand)
15560 self.assertEqual("cback2", actionSet.actionSet[1].remotePeers[1].cbackCommand)
15561
15562 self.assertEqual(300, actionSet.actionSet[2].index)
15563 self.assertEqual("store", actionSet.actionSet[2].name)
15564 self.assertEqual(None, actionSet.actionSet[2].preHooks)
15565 self.assertEqual(None, actionSet.actionSet[2].postHooks)
15566 self.assertEqual(executeStore, actionSet.actionSet[2].function)
15567
15568 def testManagedPeer_164(self):
15569 """
15570 Test with actions=[ collect, one ], extensions=[ (one, index 150) ],
15571 two peers (both managed), managed=True, local=True
15572 """
15573 actions = [
15574 "collect",
15575 "one",
15576 ]
15577 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 150)], None)
15578 options = OptionsConfig()
15579 options.managedActions = [
15580 "collect",
15581 "purge",
15582 "one",
15583 ]
15584 peers = PeersConfig()
15585 peers.localPeers = [
15586 LocalPeer("local", "/collect"),
15587 ]
15588 peers.remotePeers = [
15589 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
15590 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
15591 ]
15592 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
15593 self.assertTrue(len(actionSet.actionSet) == 4)
15594
15595 self.assertEqual(100, actionSet.actionSet[0].index)
15596 self.assertEqual("collect", actionSet.actionSet[0].name)
15597 self.assertEqual(None, actionSet.actionSet[0].preHooks)
15598 self.assertEqual(None, actionSet.actionSet[0].postHooks)
15599 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
15600
15601 self.assertEqual(100, actionSet.actionSet[1].index)
15602 self.assertEqual("collect", actionSet.actionSet[1].name)
15603 self.assertFalse(actionSet.actionSet[1].remotePeers is None)
15604 self.assertTrue(len(actionSet.actionSet[1].remotePeers) == 2)
15605 self.assertEqual("remote", actionSet.actionSet[1].remotePeers[0].name)
15606 self.assertEqual("ruser", actionSet.actionSet[1].remotePeers[0].remoteUser)
15607 self.assertEqual(None, actionSet.actionSet[1].remotePeers[0].localUser)
15608 self.assertEqual("rsh", actionSet.actionSet[1].remotePeers[0].rshCommand)
15609 self.assertEqual("cback", actionSet.actionSet[1].remotePeers[0].cbackCommand)
15610 self.assertEqual("remote2", actionSet.actionSet[1].remotePeers[1].name)
15611 self.assertEqual("ruser2", actionSet.actionSet[1].remotePeers[1].remoteUser)
15612 self.assertEqual(None, actionSet.actionSet[1].remotePeers[1].localUser)
15613 self.assertEqual("rsh2", actionSet.actionSet[1].remotePeers[1].rshCommand)
15614 self.assertEqual("cback2", actionSet.actionSet[1].remotePeers[1].cbackCommand)
15615
15616 self.assertEqual(150, actionSet.actionSet[2].index)
15617 self.assertEqual("one", actionSet.actionSet[2].name)
15618 self.assertEqual(None, actionSet.actionSet[2].preHooks)
15619 self.assertEqual(None, actionSet.actionSet[2].postHooks)
15620 self.assertEqual(isdir, actionSet.actionSet[2].function)
15621
15622 self.assertEqual(150, actionSet.actionSet[3].index)
15623 self.assertEqual("one", actionSet.actionSet[3].name)
15624 self.assertFalse(actionSet.actionSet[3].remotePeers is None)
15625 self.assertTrue(len(actionSet.actionSet[3].remotePeers) == 2)
15626 self.assertEqual("remote", actionSet.actionSet[3].remotePeers[0].name)
15627 self.assertEqual("ruser", actionSet.actionSet[3].remotePeers[0].remoteUser)
15628 self.assertEqual(None, actionSet.actionSet[3].remotePeers[0].localUser)
15629 self.assertEqual("rsh", actionSet.actionSet[3].remotePeers[0].rshCommand)
15630 self.assertEqual("cback", actionSet.actionSet[3].remotePeers[0].cbackCommand)
15631 self.assertEqual("remote2", actionSet.actionSet[3].remotePeers[1].name)
15632 self.assertEqual("ruser2", actionSet.actionSet[3].remotePeers[1].remoteUser)
15633 self.assertEqual(None, actionSet.actionSet[3].remotePeers[1].localUser)
15634 self.assertEqual("rsh2", actionSet.actionSet[3].remotePeers[1].rshCommand)
15635 self.assertEqual("cback2", actionSet.actionSet[3].remotePeers[1].cbackCommand)
15636
15637 def testManagedPeer_165(self):
15638 """
15639 Test with actions=[ store, one ], extensions=[ (one, index 150) ],
15640 two peers (both managed), managed=True, local=True
15641 """
15642 actions = [
15643 "store",
15644 "one",
15645 ]
15646 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 150)], None)
15647 options = OptionsConfig()
15648 options.managedActions = [
15649 "collect",
15650 "purge",
15651 "one",
15652 ]
15653 peers = PeersConfig()
15654 peers.localPeers = [
15655 LocalPeer("local", "/collect"),
15656 ]
15657 peers.remotePeers = [
15658 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
15659 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
15660 ]
15661 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
15662 self.assertTrue(len(actionSet.actionSet) == 3)
15663
15664 self.assertEqual(150, actionSet.actionSet[0].index)
15665 self.assertEqual("one", actionSet.actionSet[0].name)
15666 self.assertEqual(None, actionSet.actionSet[0].preHooks)
15667 self.assertEqual(None, actionSet.actionSet[0].postHooks)
15668 self.assertEqual(isdir, actionSet.actionSet[0].function)
15669
15670 self.assertEqual(150, actionSet.actionSet[1].index)
15671 self.assertEqual("one", actionSet.actionSet[1].name)
15672 self.assertFalse(actionSet.actionSet[1].remotePeers is None)
15673 self.assertTrue(len(actionSet.actionSet[1].remotePeers) == 2)
15674 self.assertEqual("remote", actionSet.actionSet[1].remotePeers[0].name)
15675 self.assertEqual("ruser", actionSet.actionSet[1].remotePeers[0].remoteUser)
15676 self.assertEqual(None, actionSet.actionSet[1].remotePeers[0].localUser)
15677 self.assertEqual("rsh", actionSet.actionSet[1].remotePeers[0].rshCommand)
15678 self.assertEqual("cback", actionSet.actionSet[1].remotePeers[0].cbackCommand)
15679 self.assertEqual("remote2", actionSet.actionSet[1].remotePeers[1].name)
15680 self.assertEqual("ruser2", actionSet.actionSet[1].remotePeers[1].remoteUser)
15681 self.assertEqual(None, actionSet.actionSet[1].remotePeers[1].localUser)
15682 self.assertEqual("rsh2", actionSet.actionSet[1].remotePeers[1].rshCommand)
15683 self.assertEqual("cback2", actionSet.actionSet[1].remotePeers[1].cbackCommand)
15684
15685 self.assertEqual(300, actionSet.actionSet[2].index)
15686 self.assertEqual("store", actionSet.actionSet[2].name)
15687 self.assertEqual(None, actionSet.actionSet[2].preHooks)
15688 self.assertEqual(None, actionSet.actionSet[2].postHooks)
15689 self.assertEqual(executeStore, actionSet.actionSet[2].function)
15690
15691 def testManagedPeer_166(self):
15692 """
15693 Test with actions=[ collect, stage, store, purge ], extensions=[],
15694 two peers (both managed), managed=True, local=True
15695 """
15696 actions = [
15697 "collect",
15698 "stage",
15699 "store",
15700 "purge",
15701 ]
15702 extensions = ExtensionsConfig([], None)
15703 options = OptionsConfig()
15704 options.managedActions = [
15705 "collect",
15706 "purge",
15707 "one",
15708 ]
15709 peers = PeersConfig()
15710 peers.localPeers = [
15711 LocalPeer("local", "/collect"),
15712 ]
15713 peers.remotePeers = [
15714 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
15715 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
15716 ]
15717 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
15718 self.assertTrue(len(actionSet.actionSet) == 6)
15719
15720 self.assertEqual(100, actionSet.actionSet[0].index)
15721 self.assertEqual("collect", actionSet.actionSet[0].name)
15722 self.assertEqual(None, actionSet.actionSet[0].preHooks)
15723 self.assertEqual(None, actionSet.actionSet[0].postHooks)
15724 self.assertEqual(executeCollect, actionSet.actionSet[0].function)
15725
15726 self.assertEqual(100, actionSet.actionSet[1].index)
15727 self.assertEqual("collect", actionSet.actionSet[1].name)
15728 self.assertFalse(actionSet.actionSet[1].remotePeers is None)
15729 self.assertTrue(len(actionSet.actionSet[1].remotePeers) == 2)
15730 self.assertEqual("remote", actionSet.actionSet[1].remotePeers[0].name)
15731 self.assertEqual("ruser", actionSet.actionSet[1].remotePeers[0].remoteUser)
15732 self.assertEqual(None, actionSet.actionSet[1].remotePeers[0].localUser)
15733 self.assertEqual("rsh", actionSet.actionSet[1].remotePeers[0].rshCommand)
15734 self.assertEqual("cback", actionSet.actionSet[1].remotePeers[0].cbackCommand)
15735 self.assertEqual("remote2", actionSet.actionSet[1].remotePeers[1].name)
15736 self.assertEqual("ruser2", actionSet.actionSet[1].remotePeers[1].remoteUser)
15737 self.assertEqual(None, actionSet.actionSet[1].remotePeers[1].localUser)
15738 self.assertEqual("rsh2", actionSet.actionSet[1].remotePeers[1].rshCommand)
15739 self.assertEqual("cback2", actionSet.actionSet[1].remotePeers[1].cbackCommand)
15740
15741 self.assertEqual(200, actionSet.actionSet[2].index)
15742 self.assertEqual("stage", actionSet.actionSet[2].name)
15743 self.assertEqual(None, actionSet.actionSet[2].preHooks)
15744 self.assertEqual(None, actionSet.actionSet[2].postHooks)
15745 self.assertEqual(executeStage, actionSet.actionSet[2].function)
15746
15747 self.assertEqual(300, actionSet.actionSet[3].index)
15748 self.assertEqual("store", actionSet.actionSet[3].name)
15749 self.assertEqual(None, actionSet.actionSet[3].preHooks)
15750 self.assertEqual(None, actionSet.actionSet[3].postHooks)
15751 self.assertEqual(executeStore, actionSet.actionSet[3].function)
15752
15753 self.assertEqual(400, actionSet.actionSet[4].index)
15754 self.assertEqual("purge", actionSet.actionSet[4].name)
15755 self.assertEqual(None, actionSet.actionSet[4].preHooks)
15756 self.assertEqual(None, actionSet.actionSet[4].postHooks)
15757 self.assertEqual(executePurge, actionSet.actionSet[4].function)
15758
15759 self.assertEqual(400, actionSet.actionSet[5].index)
15760 self.assertEqual("purge", actionSet.actionSet[5].name)
15761 self.assertFalse(actionSet.actionSet[5].remotePeers is None)
15762 self.assertTrue(len(actionSet.actionSet[5].remotePeers) == 2)
15763 self.assertEqual("remote", actionSet.actionSet[5].remotePeers[0].name)
15764 self.assertEqual("ruser", actionSet.actionSet[5].remotePeers[0].remoteUser)
15765 self.assertEqual(None, actionSet.actionSet[5].remotePeers[0].localUser)
15766 self.assertEqual("rsh", actionSet.actionSet[5].remotePeers[0].rshCommand)
15767 self.assertEqual("cback", actionSet.actionSet[5].remotePeers[0].cbackCommand)
15768 self.assertEqual("remote2", actionSet.actionSet[5].remotePeers[1].name)
15769 self.assertEqual("ruser2", actionSet.actionSet[5].remotePeers[1].remoteUser)
15770 self.assertEqual(None, actionSet.actionSet[5].remotePeers[1].localUser)
15771 self.assertEqual("rsh2", actionSet.actionSet[5].remotePeers[1].rshCommand)
15772 self.assertEqual("cback2", actionSet.actionSet[5].remotePeers[1].cbackCommand)
15773
15774 def testManagedPeer_167(self):
15775 """
15776 Test with actions=[ collect, stage, store, purge, one, two, three, four,
15777 five ], extensions=[ (index 50, 150, 250, 350, 450)], two peers (both managed),
15778 managed=True, local=True
15779 """
15780 actions = [
15781 "collect",
15782 "stage",
15783 "store",
15784 "purge",
15785 "one",
15786 "two",
15787 ]
15788 extensions = ExtensionsConfig(
15789 [
15790 ExtendedAction("one", "os.path", "isdir", 50),
15791 ExtendedAction("two", "os.path", "isfile", 150),
15792 ExtendedAction("three", "os.path", "islink", 250),
15793 ExtendedAction("four", "os.path", "isabs", 350),
15794 ExtendedAction("five", "os.path", "exists", 450),
15795 ],
15796 None,
15797 )
15798 options = OptionsConfig()
15799 options.managedActions = [
15800 "collect",
15801 "purge",
15802 "one",
15803 ]
15804 peers = PeersConfig()
15805 peers.localPeers = [
15806 LocalPeer("local", "/collect"),
15807 ]
15808 peers.remotePeers = [
15809 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
15810 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
15811 ]
15812 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
15813 self.assertTrue(len(actionSet.actionSet) == 9)
15814
15815 self.assertEqual(50, actionSet.actionSet[0].index)
15816 self.assertEqual("one", actionSet.actionSet[0].name)
15817 self.assertEqual(None, actionSet.actionSet[0].preHooks)
15818 self.assertEqual(None, actionSet.actionSet[0].postHooks)
15819 self.assertEqual(isdir, actionSet.actionSet[0].function)
15820
15821 self.assertEqual(50, actionSet.actionSet[0].index)
15822 self.assertEqual("one", actionSet.actionSet[1].name)
15823 self.assertFalse(actionSet.actionSet[1].remotePeers is None)
15824 self.assertTrue(len(actionSet.actionSet[1].remotePeers) == 2)
15825 self.assertEqual("remote", actionSet.actionSet[1].remotePeers[0].name)
15826 self.assertEqual("ruser", actionSet.actionSet[1].remotePeers[0].remoteUser)
15827 self.assertEqual(None, actionSet.actionSet[1].remotePeers[0].localUser)
15828 self.assertEqual("rsh", actionSet.actionSet[1].remotePeers[0].rshCommand)
15829 self.assertEqual("cback", actionSet.actionSet[1].remotePeers[0].cbackCommand)
15830 self.assertEqual("remote2", actionSet.actionSet[1].remotePeers[1].name)
15831 self.assertEqual("ruser2", actionSet.actionSet[1].remotePeers[1].remoteUser)
15832 self.assertEqual(None, actionSet.actionSet[1].remotePeers[1].localUser)
15833 self.assertEqual("rsh2", actionSet.actionSet[1].remotePeers[1].rshCommand)
15834 self.assertEqual("cback2", actionSet.actionSet[1].remotePeers[1].cbackCommand)
15835
15836 self.assertEqual(100, actionSet.actionSet[2].index)
15837 self.assertEqual("collect", actionSet.actionSet[2].name)
15838 self.assertEqual(None, actionSet.actionSet[2].preHooks)
15839 self.assertEqual(None, actionSet.actionSet[2].postHooks)
15840 self.assertEqual(executeCollect, actionSet.actionSet[2].function)
15841
15842 self.assertEqual(100, actionSet.actionSet[3].index)
15843 self.assertEqual("collect", actionSet.actionSet[3].name)
15844 self.assertFalse(actionSet.actionSet[3].remotePeers is None)
15845 self.assertTrue(len(actionSet.actionSet[3].remotePeers) == 2)
15846 self.assertEqual("remote", actionSet.actionSet[3].remotePeers[0].name)
15847 self.assertEqual("ruser", actionSet.actionSet[3].remotePeers[0].remoteUser)
15848 self.assertEqual(None, actionSet.actionSet[3].remotePeers[0].localUser)
15849 self.assertEqual("rsh", actionSet.actionSet[3].remotePeers[0].rshCommand)
15850 self.assertEqual("cback", actionSet.actionSet[3].remotePeers[0].cbackCommand)
15851 self.assertEqual("remote2", actionSet.actionSet[3].remotePeers[1].name)
15852 self.assertEqual("ruser2", actionSet.actionSet[3].remotePeers[1].remoteUser)
15853 self.assertEqual(None, actionSet.actionSet[3].remotePeers[1].localUser)
15854 self.assertEqual("rsh2", actionSet.actionSet[3].remotePeers[1].rshCommand)
15855 self.assertEqual("cback2", actionSet.actionSet[3].remotePeers[1].cbackCommand)
15856
15857 self.assertEqual(150, actionSet.actionSet[4].index)
15858 self.assertEqual("two", actionSet.actionSet[4].name)
15859 self.assertEqual(None, actionSet.actionSet[4].preHooks)
15860 self.assertEqual(None, actionSet.actionSet[4].postHooks)
15861 self.assertEqual(isfile, actionSet.actionSet[4].function)
15862
15863 self.assertEqual(200, actionSet.actionSet[5].index)
15864 self.assertEqual("stage", actionSet.actionSet[5].name)
15865 self.assertEqual(None, actionSet.actionSet[5].preHooks)
15866 self.assertEqual(None, actionSet.actionSet[5].postHooks)
15867 self.assertEqual(executeStage, actionSet.actionSet[5].function)
15868
15869 self.assertEqual(300, actionSet.actionSet[6].index)
15870 self.assertEqual("store", actionSet.actionSet[6].name)
15871 self.assertEqual(None, actionSet.actionSet[6].preHooks)
15872 self.assertEqual(None, actionSet.actionSet[6].postHooks)
15873 self.assertEqual(executeStore, actionSet.actionSet[6].function)
15874
15875 self.assertEqual(400, actionSet.actionSet[7].index)
15876 self.assertEqual("purge", actionSet.actionSet[7].name)
15877 self.assertEqual(None, actionSet.actionSet[7].preHooks)
15878 self.assertEqual(None, actionSet.actionSet[7].postHooks)
15879 self.assertEqual(executePurge, actionSet.actionSet[7].function)
15880
15881 self.assertEqual(400, actionSet.actionSet[8].index)
15882 self.assertEqual("purge", actionSet.actionSet[8].name)
15883 self.assertFalse(actionSet.actionSet[8].remotePeers is None)
15884 self.assertTrue(len(actionSet.actionSet[8].remotePeers) == 2)
15885 self.assertEqual("remote", actionSet.actionSet[8].remotePeers[0].name)
15886 self.assertEqual("ruser", actionSet.actionSet[8].remotePeers[0].remoteUser)
15887 self.assertEqual(None, actionSet.actionSet[8].remotePeers[0].localUser)
15888 self.assertEqual("rsh", actionSet.actionSet[8].remotePeers[0].rshCommand)
15889 self.assertEqual("cback", actionSet.actionSet[8].remotePeers[0].cbackCommand)
15890 self.assertEqual("remote2", actionSet.actionSet[8].remotePeers[1].name)
15891 self.assertEqual("ruser2", actionSet.actionSet[8].remotePeers[1].remoteUser)
15892 self.assertEqual(None, actionSet.actionSet[8].remotePeers[1].localUser)
15893 self.assertEqual("rsh2", actionSet.actionSet[8].remotePeers[1].rshCommand)
15894 self.assertEqual("cback2", actionSet.actionSet[8].remotePeers[1].cbackCommand)
15895
15896 def testManagedPeer_168(self):
15897 """
15898 Test with actions=[ one ], extensions=[ (one, index 50) ], two peers (both managed),
15899 managed=True, local=True
15900 """
15901 actions = [
15902 "one",
15903 ]
15904 extensions = ExtensionsConfig([ExtendedAction("one", "os.path", "isdir", 50)], None)
15905 options = OptionsConfig()
15906 options.managedActions = [
15907 "collect",
15908 "purge",
15909 "one",
15910 ]
15911 peers = PeersConfig()
15912 peers.localPeers = [
15913 LocalPeer("local", "/collect"),
15914 ]
15915 peers.remotePeers = [
15916 RemotePeer("remote", None, "ruser", "rcp", "rsh", "cback", managed=True),
15917 RemotePeer("remote2", None, "ruser2", "rcp2", "rsh2", "cback2", managed=True),
15918 ]
15919 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
15920 self.assertTrue(len(actionSet.actionSet) == 2)
15921
15922 self.assertEqual(50, actionSet.actionSet[0].index)
15923 self.assertEqual("one", actionSet.actionSet[0].name)
15924 self.assertEqual(None, actionSet.actionSet[0].preHooks)
15925 self.assertEqual(None, actionSet.actionSet[0].postHooks)
15926 self.assertEqual(isdir, actionSet.actionSet[0].function)
15927
15928 self.assertEqual(50, actionSet.actionSet[1].index)
15929 self.assertEqual("one", actionSet.actionSet[1].name)
15930 self.assertFalse(actionSet.actionSet[1].remotePeers is None)
15931 self.assertTrue(len(actionSet.actionSet[1].remotePeers) == 2)
15932 self.assertEqual("remote", actionSet.actionSet[1].remotePeers[0].name)
15933 self.assertEqual("ruser", actionSet.actionSet[1].remotePeers[0].remoteUser)
15934 self.assertEqual(None, actionSet.actionSet[1].remotePeers[0].localUser)
15935 self.assertEqual("rsh", actionSet.actionSet[1].remotePeers[0].rshCommand)
15936 self.assertEqual("cback", actionSet.actionSet[1].remotePeers[0].cbackCommand)
15937 self.assertEqual("remote2", actionSet.actionSet[1].remotePeers[1].name)
15938 self.assertEqual("ruser2", actionSet.actionSet[1].remotePeers[1].remoteUser)
15939 self.assertEqual(None, actionSet.actionSet[1].remotePeers[1].localUser)
15940 self.assertEqual("rsh2", actionSet.actionSet[1].remotePeers[1].rshCommand)
15941 self.assertEqual("cback2", actionSet.actionSet[1].remotePeers[1].cbackCommand)
15942
15943 def testManagedPeer_169(self):
15944 """
15945 Test to make sure that various options all seem to be pulled from the right places with mixed data.
15946 """
15947 actions = [
15948 "collect",
15949 "stage",
15950 "store",
15951 "purge",
15952 "one",
15953 "two",
15954 ]
15955 extensions = ExtensionsConfig(
15956 [
15957 ExtendedAction("one", "os.path", "isdir", 50),
15958 ExtendedAction("two", "os.path", "isfile", 150),
15959 ExtendedAction("three", "os.path", "islink", 250),
15960 ExtendedAction("four", "os.path", "isabs", 350),
15961 ExtendedAction("five", "os.path", "exists", 450),
15962 ],
15963 None,
15964 )
15965 options = OptionsConfig()
15966 options.managedActions = [
15967 "collect",
15968 "purge",
15969 "one",
15970 ]
15971 options.backupUser = "userZ"
15972 options.rshCommand = "rshZ"
15973 options.cbackCommand = "cbackZ"
15974 peers = PeersConfig()
15975 peers.localPeers = [
15976 LocalPeer("local", "/collect"),
15977 ]
15978 peers.remotePeers = [
15979 RemotePeer("remote", None, None, None, None, "cback", managed=True),
15980 RemotePeer("remote2", None, "ruser2", None, "rsh2", None, managed=True, managedActions=["stage"]),
15981 ]
15982 actionSet = _ActionSet(actions, extensions, options, peers, True, True)
15983 self.assertTrue(len(actionSet.actionSet) == 10)
15984
15985 self.assertEqual(50, actionSet.actionSet[0].index)
15986 self.assertEqual("one", actionSet.actionSet[0].name)
15987 self.assertEqual(None, actionSet.actionSet[0].preHooks)
15988 self.assertEqual(None, actionSet.actionSet[0].postHooks)
15989 self.assertEqual(isdir, actionSet.actionSet[0].function)
15990
15991 self.assertEqual(50, actionSet.actionSet[0].index)
15992 self.assertEqual("one", actionSet.actionSet[1].name)
15993 self.assertFalse(actionSet.actionSet[1].remotePeers is None)
15994 self.assertTrue(len(actionSet.actionSet[1].remotePeers) == 1)
15995 self.assertEqual("remote", actionSet.actionSet[1].remotePeers[0].name)
15996 self.assertEqual("userZ", actionSet.actionSet[1].remotePeers[0].remoteUser)
15997 self.assertEqual("userZ", actionSet.actionSet[1].remotePeers[0].localUser)
15998 self.assertEqual("rshZ", actionSet.actionSet[1].remotePeers[0].rshCommand)
15999 self.assertEqual("cback", actionSet.actionSet[1].remotePeers[0].cbackCommand)
16000
16001 self.assertEqual(100, actionSet.actionSet[2].index)
16002 self.assertEqual("collect", actionSet.actionSet[2].name)
16003 self.assertEqual(None, actionSet.actionSet[2].preHooks)
16004 self.assertEqual(None, actionSet.actionSet[2].postHooks)
16005 self.assertEqual(executeCollect, actionSet.actionSet[2].function)
16006
16007 self.assertEqual(100, actionSet.actionSet[3].index)
16008 self.assertEqual("collect", actionSet.actionSet[3].name)
16009 self.assertFalse(actionSet.actionSet[3].remotePeers is None)
16010 self.assertTrue(len(actionSet.actionSet[3].remotePeers) == 1)
16011 self.assertEqual("remote", actionSet.actionSet[3].remotePeers[0].name)
16012 self.assertEqual("userZ", actionSet.actionSet[3].remotePeers[0].remoteUser)
16013 self.assertEqual("userZ", actionSet.actionSet[3].remotePeers[0].localUser)
16014 self.assertEqual("rshZ", actionSet.actionSet[3].remotePeers[0].rshCommand)
16015 self.assertEqual("cback", actionSet.actionSet[3].remotePeers[0].cbackCommand)
16016
16017 self.assertEqual(150, actionSet.actionSet[4].index)
16018 self.assertEqual("two", actionSet.actionSet[4].name)
16019 self.assertEqual(None, actionSet.actionSet[4].preHooks)
16020 self.assertEqual(None, actionSet.actionSet[4].postHooks)
16021 self.assertEqual(isfile, actionSet.actionSet[4].function)
16022
16023 self.assertEqual(200, actionSet.actionSet[5].index)
16024 self.assertEqual("stage", actionSet.actionSet[5].name)
16025 self.assertEqual(None, actionSet.actionSet[5].preHooks)
16026 self.assertEqual(None, actionSet.actionSet[5].postHooks)
16027 self.assertEqual(executeStage, actionSet.actionSet[5].function)
16028
16029 self.assertEqual(200, actionSet.actionSet[6].index)
16030 self.assertEqual("stage", actionSet.actionSet[6].name)
16031 self.assertFalse(actionSet.actionSet[6].remotePeers is None)
16032 self.assertTrue(len(actionSet.actionSet[6].remotePeers) == 1)
16033 self.assertEqual("remote2", actionSet.actionSet[6].remotePeers[0].name)
16034 self.assertEqual("ruser2", actionSet.actionSet[6].remotePeers[0].remoteUser)
16035 self.assertEqual("userZ", actionSet.actionSet[6].remotePeers[0].localUser)
16036 self.assertEqual("rsh2", actionSet.actionSet[6].remotePeers[0].rshCommand)
16037 self.assertEqual("cbackZ", actionSet.actionSet[6].remotePeers[0].cbackCommand)
16038
16039 self.assertEqual(300, actionSet.actionSet[7].index)
16040 self.assertEqual("store", actionSet.actionSet[7].name)
16041 self.assertEqual(None, actionSet.actionSet[7].preHooks)
16042 self.assertEqual(None, actionSet.actionSet[7].postHooks)
16043 self.assertEqual(executeStore, actionSet.actionSet[7].function)
16044
16045 self.assertEqual(400, actionSet.actionSet[8].index)
16046 self.assertEqual("purge", actionSet.actionSet[8].name)
16047 self.assertEqual(None, actionSet.actionSet[8].preHooks)
16048 self.assertEqual(None, actionSet.actionSet[8].postHooks)
16049 self.assertEqual(executePurge, actionSet.actionSet[8].function)
16050
16051 self.assertEqual(400, actionSet.actionSet[9].index)
16052 self.assertEqual("purge", actionSet.actionSet[9].name)
16053 self.assertFalse(actionSet.actionSet[9].remotePeers is None)
16054 self.assertTrue(len(actionSet.actionSet[9].remotePeers) == 1)
16055 self.assertEqual("remote", actionSet.actionSet[9].remotePeers[0].name)
16056 self.assertEqual("userZ", actionSet.actionSet[9].remotePeers[0].remoteUser)
16057 self.assertEqual("userZ", actionSet.actionSet[9].remotePeers[0].localUser)
16058 self.assertEqual("rshZ", actionSet.actionSet[9].remotePeers[0].rshCommand)
16059 self.assertEqual("cback", actionSet.actionSet[9].remotePeers[0].cbackCommand)