def test_000010(_): # No change to entr pentr, entr = _.getpair(3000010) res = realign_xrers(entr, pentr) _.assertEqual(res, []) _.assertEqual(entr._sens[0]._xrer, [Xref(3000020, 1, 1, 3, 3000010, 1, 1, None, None)])
def test_000030(_): # Delete rdng 1. pentr, entr = _.getpair(3000010) del entr._rdng[0] jdb.setkeys(entr) res = realign_xrers(entr, pentr) _.assertEqual(res, [Xref(3000020, 1, 1, 3, 3000010, 1, 1, None, None)]) _.assertEqual(entr._sens[0]._xrer, [])
def test_000120(_): # Delete kanj 1. pentr, entr = _.getpair(3000050) del entr._kanj[0] jdb.setkeys(entr) res = realign_xrers(entr, pentr) _.assertEqual(res, [Xref(3000060, 1, 1, 3, 3000050, 1, 1, 1, None)]) _.assertEqual(entr._sens[0]._xrer, [])
def test_000020(_): # Swap rdng 1 and rdng 2 pentr, entr = _.getpair(3000010) entr._rdng = entr._rdng[::-1] jdb.setkeys(entr) res = realign_xrers(entr, pentr) _.assertEqual(res, []) _.assertEqual(entr._sens[0]._xrer, [Xref(3000020, 1, 1, 3, 3000010, 1, 2, None, None)])
def test_000090(_): # Swap kanj's. pentr, entr = _.getpair(3000050) entr._kanj = entr._kanj[::-1] jdb.setkeys(entr) res = realign_xrers(entr, pentr) _.assertEqual(res, []) _.assertEqual(entr._sens[0]._xrer, [Xref(3000060, 1, 1, 3, 3000050, 1, 1, 2, None)])
def test_000140(_): # Swap kanj, delete rdng 1. pentr, entr = _.getpair(3000050) entr._kanj = entr._kanj[::-1] del entr._rdng[0] jdb.setkeys(entr) res = realign_xrers(entr, pentr) # Note that the kanj number was not changed from # 1 to 2 because realign() processes rdng before # kanj. (c.f. test_000130.) _.assertEqual(res, [Xref(3000060, 1, 1, 3, 3000050, 1, 1, 1, None)]) _.assertEqual(entr._sens[0]._xrer, [])
def test_000130(_): # Swap rdng, delete kanj 1. pentr, entr = _.getpair(3000050) entr._rdng = entr._rdng[::-1] del entr._kanj[0] jdb.setkeys(entr) res = realign_xrers(entr, pentr) # Note that the rdng number was changed from 1 to 2 # because realign() processes rdng before kanj. (c.f. # test_000140.) _.assertEqual(res, [Xref(3000060, 1, 1, 3, 3000050, 1, 2, 1, None)]) _.assertEqual(entr._sens[0]._xrer, [])
def test_IS216(_): pentr, entr = _.getpair(2177620) res = realign_xrers(entr, pentr) _.assertEqual(res, []) _.assertEqual(entr._sens[0]._xrer, [Xref(2177650, 1, 1, 3, 2177620, 1, None, 2, None)])