コード例 #1
0
    def check(self,
              actual_classes=(list, ),
              expected_classes=(list, ),
              expected_obj=None,
              expected_kwargs={},
              working_obj=None,
              working_kwargs={},
              failing_obj=None,
              failing_kwargs={},
              failure_msg=None,
              namepaths=None,
              expected_namepaths=None):

        for actual_cls, expected_cls in permuteflat(actual_classes,
                                                    expected_classes):
            expected_obj = expected_obj or expected_cls(**expected_kwargs)

            working_obj = working_obj or actual_cls(**working_kwargs)

            self.run_assert(
                (working_obj, expected_obj, namepaths, expected_namepaths))

            failing_obj = failing_obj or actual_cls(**failing_kwargs)

            self.run_assert(
                (failing_obj, expected_obj, namepaths, expected_namepaths),
                failure_msg)
コード例 #2
0
    def check(self,
              actual_classes=(list, ),
              expected_classes=(list, ),
              expected_objs=None,
              expected_kwargs_list=[],
              working_objs=None,
              working_kwargs_list=[],
              failing_objs=None,
              failing_kwargs_list=[],
              failure_msg=None,
              namepaths=None,
              expected_namepaths=None):

        for actual_cls1, actual_cls2, expected_cls1, expected_cls2 in \
                permuteflat(*([actual_classes] * 2 + [expected_classes] * 2)):
            if not expected_objs:
                expected_objs = (expected_cls1(**expected_kwargs_list[0]),
                                 expected_cls2(**expected_kwargs_list[1]))

            if not working_objs:
                working_objs = (actual_cls1(**working_kwargs_list[0]),
                                actual_cls2(**working_kwargs_list[1]))

            self.run_assert(
                (working_objs, expected_objs, namepaths, expected_namepaths))

            if not failing_objs:
                failing_objs = (actual_cls1(**failing_kwargs_list[0]),
                                actual_cls2(**failing_kwargs_list[1]))

            self.run_assert(
                (failing_objs, expected_objs, namepaths, expected_namepaths),
                failure_msg)
コード例 #3
0
    def check(self, actual_classes=(list,),
                    expected_classes=(list,),
                    expected_objs=None, expected_kwargs_list=[],
                    working_objs=None, working_kwargs_list=[],
                    failing_objs=None, failing_kwargs_list=[],
                    failure_msg=None,
                    namepaths=None,
                    expected_namepaths=None):

        for actual_cls1, actual_cls2, expected_cls1, expected_cls2 in \
                permuteflat(*([actual_classes] * 2 + [expected_classes] * 2)):
            if not expected_objs:
                expected_objs = (expected_cls1(**expected_kwargs_list[0]),
                                  expected_cls2(**expected_kwargs_list[1]))

            if not working_objs:
                working_objs = (actual_cls1(**working_kwargs_list[0]),
                                 actual_cls2(**working_kwargs_list[1]))

            self.run_assert((working_objs, expected_objs, namepaths, expected_namepaths))

            if not failing_objs:
                failing_objs = (actual_cls1(**failing_kwargs_list[0]),
                                actual_cls2(**failing_kwargs_list[1]))

            self.run_assert((failing_objs, expected_objs, namepaths, expected_namepaths),
                            failure_msg)
コード例 #4
0
    def check(self, actual_classes=(list,),
                    expected_classes=(list,),
                    expected_obj=None, expected_kwargs={},
                    working_obj=None, working_kwargs={},
                    failing_obj=None, failing_kwargs={},
                    failure_msg=None,
                    namepaths=None,
                    expected_namepaths=None):

        for actual_cls, expected_cls in permuteflat(actual_classes, expected_classes):
            expected_obj = expected_obj or expected_cls(**expected_kwargs)

            working_obj = working_obj or actual_cls(**working_kwargs)

            self.run_assert((working_obj, expected_obj, namepaths, expected_namepaths))

            failing_obj = failing_obj or actual_cls(**failing_kwargs)

            self.run_assert((failing_obj, expected_obj, namepaths, expected_namepaths),
                            failure_msg)