コード例 #1
0
ファイル: app.py プロジェクト: jayParent/hash-table
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
コード例 #2
0
ファイル: test_hash.py プロジェクト: Gaster618/Hash
def test_repr():
    table = HashTable()
    assert (table)
    table.add('qwe')
コード例 #3
0
ファイル: test_hash.py プロジェクト: Gaster618/Hash
def test_add():
    table = HashTable()
    assert ('qwe' not in table)
    table.add('qwe')
    assert ('qwe' in table)
コード例 #4
0
ファイル: test_hash.py プロジェクト: Gaster618/Hash
def test_remove():
    table = HashTable()
    table.add('qwe')
    assert ('qwe' in table)
    table.remove('qwe')
    assert ('qwe' not in table)