Esempio n. 1
0
    def compare(self, *expected):
        """
        Call to check whether this view contains the expected data.
        If it does not, a descriptive :class:`AssertionError` will
        be raised. Requires
        `testfixtures <http://www.simplistix.co.uk/software/python/testfixtures>`__.

        :param expected: tuples containing the data that should be
                         present in this view.
        """
        actual = []
        for row in self:
            actual.append(tuple(row))

        # late import in case testfixtures isn't around!
        from testfixtures import compare as _compare
        _compare(expected, tuple(actual))
Esempio n. 2
0
    def compare(self, *expected):
        """
        Call to check whether this view contains the expected data.
        If it does not, a descriptive :class:`AssertionError` will
        be raised. Requires
        `testfixtures <http://www.simplistix.co.uk/software/python/testfixtures>`__.

        :param expected: tuples containing the data that should be
                         present in this view.
        """
        actual = []
        for row in self:
            actual.append(tuple(row))

        # late import in case testfixtures isn't around!
        from testfixtures import compare as _compare
        _compare(expected, actual=tuple(actual))