def assert_sort(self, tuples, allitems=None):
     if allitems is None:
         allitems = self._nodes_from_tuples(tuples)
     else:
         allitems = self._nodes_from_tuples(tuples).union(allitems)
     result = list(topological.sort(tuples, allitems))
     assert conforms_partial_ordering(tuples, result)
Beispiel #2
0
    def _assert_iteration(
        self,
        upper,
        lower,
        assertion,
        inclusive=True,
        map_=None,
        implicit_base=False,
        select_for_downgrade=False,
    ):
        if map_ is None:
            map_ = self.map

        result = [
            rev.revision for rev in map_.iterate_revisions(
                upper,
                lower,
                inclusive=inclusive,
                implicit_base=implicit_base,
                select_for_downgrade=select_for_downgrade,
            )
        ]

        edges = [(rev, child.revision)
                 for child in map_._revision_map.values() if child is not None
                 for rev in child._normalized_down_revisions]

        assert sqla_testing_util.conforms_partial_ordering(
            edges, list(reversed(result)))

        eq_(
            result,
            assertion,
        )
Beispiel #3
0
 def assert_sort(self, tuples, allitems=None):
     if allitems is None:
         allitems = self._nodes_from_tuples(tuples)
     else:
         allitems = self._nodes_from_tuples(tuples).union(allitems)
     result = list(topological.sort(tuples, allitems))
     assert conforms_partial_ordering(tuples, result)
 def assert_sort_deterministic(self, tuples, allitems, expected):
     result = list(topological.sort(tuples,
                                    allitems,
                                    deterministic_order=True))
     assert conforms_partial_ordering(tuples, result)
     assert result == expected
Beispiel #5
0
 def assert_sort_deterministic(self, tuples, allitems, expected):
     result = list(
         topological.sort(tuples, allitems, deterministic_order=True))
     assert conforms_partial_ordering(tuples, result)
     assert result == expected