def test_strip_loan(loaned_edition_two_hashes, spider):
    from spool import BlockchainSpider
    history = spider.history(loaned_edition_two_hashes[0])
    chain = BlockchainSpider.chain(history, 2)
    assert (len(chain) == 3)
    assert ('LOAN' in (tx['action'] for tx in chain))
    chain = BlockchainSpider.strip_loan(chain)
    assert (len(chain) == 2)
    assert ('LOAN' not in (tx['action'] for tx in chain))
def test_strip_loan(loaned_edition_two_hashes, spider):
    from spool import BlockchainSpider
    history = spider.history(loaned_edition_two_hashes[0])
    chain = BlockchainSpider.chain(history, 2)
    assert (len(chain) == 3)
    assert ('LOAN' in (tx['action'] for tx in chain))
    chain = BlockchainSpider.strip_loan(chain)
    assert (len(chain) == 2)
    assert ('LOAN' not in (tx['action'] for tx in chain))