<commit_before>from noopy.endpoint import methods
from noopy.endpoint.decorators import endpoint


@endpoint('/foo', methods.GET)
def sample_view(event, context):
    pass


def test_resources_added():
    from noopy.endpoint.resource import Resource

    resources = Resource.resources
    assert set(resources.keys()) == {'/', '/foo'}
    assert resources['/'].children == [resources['/foo']]
    assert resources['/foo'].parent == resources['/']


def test_endpoints_added():
    from noopy.endpoint import Endpoint

    endpoints = Endpoint.endpoints
    assert set(endpoints.keys()) == {('/foo', methods.GET)}<commit_msg>Test Endpoint.endpoints has all endpoints<commit_after>from noopy.endpoint import methods
from noopy.endpoint.decorators import endpoint


@endpoint('/foo', methods.GET)
def sample_view(event, context):
    pass


def test_resources_added():
    from noopy.endpoint.resource import Resource

    resources = Resource.resources
    assert set(resources.keys()) == {'/', '/foo'}
    assert resources['/'].children == [resources['/foo']]
    assert resources['/foo'].parent == resources['/']


def test_endpoints_added():
    from noopy.endpoint import Endpoint

    endpoints = Endpoint.endpoints
    foo_endpoint = Endpoint('/foo', methods.GET)
    assert set(endpoints.keys()) == {foo_endpoint}
    assert endpoints[foo_endpoint] == sample_view
{'fraction_non_alphanumeric': 0.13722627737226278, 'fraction_numerical': 0.0, 'mean_word_length': 4.46215139442231, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '884670', 'n_tokens_mistral': 390, 'n_tokens_neox': 377, 'n_words': 94}