Esempio n. 1
0
def console():

    hash_table = HashTable()

    while True:
        op = input(prompts['operations'])

        if op == '1':
            word = input(prompts['word'])
            hash_table.add(word)
            print(hash_table)
        elif op == '4':
            return
Esempio n. 2
0
def test_repr():
    table = HashTable()
    assert (table)
    table.add('qwe')
Esempio n. 3
0
def test_add():
    table = HashTable()
    assert ('qwe' not in table)
    table.add('qwe')
    assert ('qwe' in table)
Esempio n. 4
0
def test_remove():
    table = HashTable()
    table.add('qwe')
    assert ('qwe' in table)
    table.remove('qwe')
    assert ('qwe' not in table)