Example #1
0
 def test_no_xovr_peer(self, get_xovr_peer):
     up = self._mk_seg(True)
     down = self._mk_seg(True)
     get_xovr_peer.return_value = None, None
     peer_revs = create_mock()
     # Call
     ntools.eq_(path_combinator._build_shortcuts(up, down, peer_revs), [])
     # Tests
     get_xovr_peer.assert_called_once_with(up, down, peer_revs)
Example #2
0
 def _check_xovrs_peers(self, xovr, peer, is_peer, get_xovr_peer,
                        join_peer, join_xovr):
     up = self._mk_seg(True)
     down = self._mk_seg(True)
     get_xovr_peer.return_value = xovr, peer
     peer_revs = create_mock()
     # Call
     if is_peer:
         ntools.eq_(path_combinator._build_shortcuts(up, down, peer_revs),
                    join_peer.return_value)
     else:
         ntools.eq_(path_combinator._build_shortcuts(up, down, peer_revs),
                    join_xovr.return_value)
     # Tests
     if is_peer:
         join_peer.assert_called_once_with(up, down, peer, peer_revs)
     else:
         join_xovr.assert_called_once_with(up, down, xovr)
Example #3
0
 def _check_none(self, up_seg, down_seg):
     peer_revs = create_mock()
     ntools.eq_(
         path_combinator._build_shortcuts(up_seg, down_seg, peer_revs), [])