1757
1757
self.assertIsInstance(kg, _mod_graph.KnownGraph)
1758
1758
self.assertEqual([key_a, key_b, key_c], list(kg.topo_sort()))
1760
def test_known_graph_with_fallbacks(self):
1761
f = self.get_versionedfiles('files')
1763
raise TestNotApplicable('ancestry info only relevant with graph.')
1764
if getattr(f, 'add_fallback_versioned_files', None) is None:
1765
raise TestNotApplicable("%s doesn't support fallbacks"
1766
% (f.__class__.__name__,))
1767
key_a = self.get_simple_key('a')
1768
key_b = self.get_simple_key('b')
1769
key_c = self.get_simple_key('c')
1770
# A only in fallback
1775
g = self.get_versionedfiles('fallback')
1776
g.add_lines(key_a, [], ['\n'])
1777
f.add_fallback_versioned_files(g)
1778
f.add_lines(key_b, [key_a], ['\n'])
1779
f.add_lines(key_c, [key_a, key_b], ['\n'])
1780
kg = f.get_known_graph_ancestry([key_c])
1781
self.assertEqual([key_a, key_b, key_c], list(kg.topo_sort()))
1760
1783
def test_get_record_stream_empty(self):
1761
1784
"""An empty stream can be requested without error."""
1762
1785
f = self.get_versionedfiles()