<commit_before># -*- coding: utf-8 -*-
"""Test Binary Search Tree Module."""
import pytest


@pytest.fixture(scope='function')
def big_left():
    """Fixture for testing."""
    from bst import BST
    b = BST([20])
    b.insert(16)
    b.insert(14)
    b.insert(17)
    b.insert(14)
    b.insert(23)
    return b


def test_insert_top(big_left):
    """Test that insert works."""
    assert big_left.top.value == 20


def test_insert_left(big_left):
    """Test that insert smaller value goes left."""
    assert big_left.top.left.value == 16


def test_insert_right(big_left):
    """Test that insert right works correctly."""
    assert big_left.top.left.right.value == 17


def test_contains(big_left):
    """Test contains function."""
    assert big_left.contains(20) is True


def test_not_contained(big_left):
    """Test contains returns False when item not in list."""
    assert big_left.contains(89) is False


def test_size_empty():
    """Test size function works on an empty tree."""
    from bst import BST
    c = BST()
    assert c.size() == 0


def test_size_one():
    """Test size function works on a single Node Tree."""
    from bst import BST
    d = BST()
    d.insert(20)
    assert d.size() == 1


def test_size_many(big_left):
    """Test many and similar insert size."""
    assert big_left.size() == 5


def test_depth_none():
    """Test that a node of nothing returns a value of nothing."""
    from bst import Node
    a = Node()
    assert a.depth() == 0


def test_depth_one():
    """Test that a node of one returns a depth of one."""
    from bst import Node
    a = Node(1)
    assert a.depth() == 1


def test_balance_none():
    """Test that a node of nothing returns a value of nothing."""
    from bst import Node
    a = Node()
    assert a.balance() == 0


def test_balance_one():
    """Test that a node of one returns a depth of one."""
    from bst import Node
    a = Node(1)
    assert a.balance() == 0


def test_balance_left(big_left):
    """Test that a left side is larger and returns a positive int."""
    assert big_left.balance() > 0


def test_balance_right():
    """Test that a right side is larger and returns a negative int."""
    from bst import BST
    b = BST([20])
    b.insert(23)
    b.insert(22)
    assert b.balance() < 0


def test_depth_many():
    """Test that a node with one extra on the left has a depth of 2."""
    from bst import Node
    a = Node(20)
    a.left = Node(16)
    assert a.depth() == 2


def test_depth_tree(big_left):
    """Assert that a tree dpeth is three."""
    assert big_left.depth() == 3


def test_in_order_empty():
    """Test an empty Node returns empty list."""
    from bst import Node
    a = Node()
    assert a.in_order() == []


def test_pre_order_empty():
    """Test an empty Node returns empty list."""
    from bst import Node
    a = Node()
    assert a.pre_order() == []


def test_post_order_empty():
    """Test an empty Node returns empty list."""
    from bst import Node
    a = Node()
    assert a.post_order() == []


def test_breath_first_empty():
    """Test an empty Node returns empty list."""
    from bst import Node
    a = Node()
    assert a.breath_first() == []

def test_in_order_one():
    """Test an empty Node returns a list."""
    from bst import Node
    a = Node(20)
    assert a.in_order() == [20]


def test_pre_order_one():
    """Test an empty Node returns a list."""
    from bst import Node
    a = Node(20)
    assert a.pre_order() == [20]


def test_post_order_one():
    """Test an empty Node returns a list."""
    from bst import Node
    a = Node(20)
    assert a.post_order() == [20]


def test_breath_first_one():
    """Test an empty Node returns a list."""
    from bst import Node
    a = Node(20)
    assert a.breath_first() == [20]
<commit_msg>4 more test have been created.<commit_after># -*- coding: utf-8 -*-
"""Test Binary Search Tree Module."""
import pytest


@pytest.fixture(scope='function')
def big_left():
    """Fixture for testing."""
    from bst import BST
    b = BST([20])
    b.insert(16)
    b.insert(14)
    b.insert(17)
    b.insert(14)
    b.insert(23)
    return b


def test_insert_top(big_left):
    """Test that insert works."""
    assert big_left.top.value == 20


def test_insert_left(big_left):
    """Test that insert smaller value goes left."""
    assert big_left.top.left.value == 16


def test_insert_right(big_left):
    """Test that insert right works correctly."""
    assert big_left.top.left.right.value == 17


def test_contains(big_left):
    """Test contains function."""
    assert big_left.contains(20) is True


def test_not_contained(big_left):
    """Test contains returns False when item not in list."""
    assert big_left.contains(89) is False


def test_size_empty():
    """Test size function works on an empty tree."""
    from bst import BST
    c = BST()
    assert c.size() == 0


def test_size_one():
    """Test size function works on a single Node Tree."""
    from bst import BST
    d = BST()
    d.insert(20)
    assert d.size() == 1


def test_size_many(big_left):
    """Test many and similar insert size."""
    assert big_left.size() == 5


def test_depth_none():
    """Test that a node of nothing returns a value of nothing."""
    from bst import Node
    a = Node()
    assert a.depth() == 0


def test_depth_one():
    """Test that a node of one returns a depth of one."""
    from bst import Node
    a = Node(1)
    assert a.depth() == 1


def test_balance_none():
    """Test that a node of nothing returns a value of nothing."""
    from bst import Node
    a = Node()
    assert a.balance() == 0


def test_balance_one():
    """Test that a node of one returns a depth of one."""
    from bst import Node
    a = Node(1)
    assert a.balance() == 0


def test_balance_left(big_left):
    """Test that a left side is larger and returns a positive int."""
    assert big_left.balance() > 0


def test_balance_right():
    """Test that a right side is larger and returns a negative int."""
    from bst import BST
    b = BST([20])
    b.insert(23)
    b.insert(22)
    assert b.balance() < 0


def test_depth_many():
    """Test that a node with one extra on the left has a depth of 2."""
    from bst import Node
    a = Node(20)
    a.left = Node(16)
    assert a.depth() == 2


def test_depth_tree(big_left):
    """Assert that a tree dpeth is three."""
    assert big_left.depth() == 3


def test_in_order_empty():
    """Test an empty Node returns empty list."""
    from bst import Node
    a = Node()
    assert a.in_order() == []


def test_pre_order_empty():
    """Test an empty Node returns empty list."""
    from bst import Node
    a = Node()
    assert a.pre_order() == []


def test_post_order_empty():
    """Test an empty Node returns empty list."""
    from bst import Node
    a = Node()
    assert a.post_order() == []


def test_breath_first_empty():
    """Test an empty Node returns empty list."""
    from bst import Node
    a = Node()
    assert a.breath_first() == []


def test_in_order_one():
    """Test an empty Node returns a list."""
    from bst import Node
    a = Node(20)
    assert a.in_order() == [20]


def test_pre_order_one():
    """Test an empty Node returns a list."""
    from bst import Node
    a = Node(20)
    assert a.pre_order() == [20]


def test_post_order_one():
    """Test an empty Node returns a list."""
    from bst import Node
    a = Node(20)
    assert a.post_order() == [20]


def test_breath_first_one():
    """Test an empty Node returns a list."""
    from bst import Node
    a = Node(20)
    assert a.breath_first() == [20]


def test_in_order_tree_empty():
    """Test an empty Node returns empty list."""
    from bst import BST
    a = BST()
    assert a.in_order() == []


def test_pre_order_tree_empty():
    """Test an empty Node returns empty list."""
    from bst import BST
    a = BST()
    assert a.pre_order() == []


def test_post_order_tree_empty():
    """Test an empty Node returns empty list."""
    from bst import BST
    a = BST()
    assert a.post_order() == []


def test_breath_first_tree_empty():
    """Test an empty Node returns empty list."""
    from bst import BST
    a = BST()
    assert a.breath_first() == []
{'fraction_non_alphanumeric': 0.12841033102946525, 'fraction_numerical': 0.0158845640839093, 'mean_word_length': 2.863231850117096, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6368361', 'n_tokens_mistral': 2766, 'n_tokens_neox': 2632, 'n_words': 965}