Checks if the last method (a possible group) is an instance of our group_class. Adds the current method to this group or creates a new one. Args: group_name: the name of the group. group_class: the class used to create instance of this new group
(self, group_name, group_class)
| 662 | return group |
| 663 | |
| 664 | def _CheckAndCreateNewGroup(self, group_name, group_class): |
| 665 | """Checks if the last method (a possible group) is an instance of our |
| 666 | group_class. Adds the current method to this group or creates a new one. |
| 667 | |
| 668 | Args: |
| 669 | |
| 670 | group_name: the name of the group. |
| 671 | group_class: the class used to create instance of this new group |
| 672 | """ |
| 673 | group = self.GetPossibleGroup() |
| 674 | |
| 675 | # If this is a group, and it is the correct group, add the method. |
| 676 | if isinstance(group, group_class) and group.group_name() == group_name: |
| 677 | group.AddMethod(self) |
| 678 | return self |
| 679 | |
| 680 | # Create a new group and add the method. |
| 681 | new_group = group_class(group_name) |
| 682 | new_group.AddMethod(self) |
| 683 | self._call_queue.append(new_group) |
| 684 | return self |
| 685 | |
| 686 | def InAnyOrder(self, group_name="default"): |
| 687 | """Move this method into a group of unordered calls. |
no test coverage detected