def test_join_left_with_empty_right():
    left = Hashtable()
    right = Hashtable()

    left.set('fond', 'enamored')

    actual = left.join(right)
    expect = [['fond', 'enamored', None]]

    assert actual == expect
def test_right_join_with_empty_right():
    left = Hashtable()
    right = Hashtable()

    left.set('fond', 'enamored')

    actual = left.join(right, right_join=True)
    expect = []

    assert actual == expect
def test_left_join_with_antonym_right():
    left = Hashtable()
    right = Hashtable()

    left.set('fond', 'enamored')
    right.set('fond', 'averse')

    actual = left.join(right)
    expect = [['fond', 'enamored', 'averse']]

    assert actual == expect
def test_right_join_collisions():
    left = Hashtable()
    right = Hashtable()

    left.set('fond', 'enamored')
    left.set('donf', 'enamored')
    right.set('fond', 'averse')

    actual = left.join(right, right_join=True)
    expect = [['fond', 'averse', 'enamored']]

    assert actual == expect