<commit_before>from tests.resources import dictionaries
from pagarme import transaction
from tests.resources.pagarme_test import UNIT_TEST

def test_create_transaction():
    trx = transaction.create(dictionaries.VALID_CREDIT_CARD_TRANSACTION_DICTIONARY)
    assert trx is not None

def test_find_all_transactions():
    all_transactions = transaction.find_all(dictionaries.API_KEY)
    assert all_transactions is not None<commit_msg>add new tests in transaction_test.py<commit_after>from tests.resources import dictionaries
from pagarme import transaction
from tests.resources.pagarme_test import UNIT_TEST

def test_create_transaction():
    trx = transaction.create(dictionaries.VALID_CREDIT_CARD_TRANSACTION_DICTIONARY)
    assert trx['id'] is not None

def test_find_all_transactions():
    all_transactions = transaction.find_all(dictionaries.API_KEY)
    assert all_transactions is not None

def test_find_by():
    trx = transaction.create(dictionaries.VALID_CREDIT_CARD_TRANSACTION_DICTIONARY)
    find_trx = transaction.find_by(trx['id'],dictionaries.API_KEY)
    assert trx['id'] == find_trx['id']

def test_get_all_transction_payables():
    trx = transaction.create(dictionaries.VALID_CREDIT_CARD_TRANSACTION_DICTIONARY)
    all_payables = transaction.payables(trx['id'],dictionaries.API_KEY)
    assert all_payables is not None

def test_get_all_transaction_operations():
    trx = transaction.create(dictionaries.VALID_CREDIT_CARD_TRANSACTION_DICTIONARY)
    all_operations = transaction.operations(trx['id'],dictionaries.API_KEY)
    assert all_operations is not None

def test_get_all_transaction_events():
    trx = transaction.create(dictionaries.VALID_CREDIT_CARD_TRANSACTION_DICTIONARY)
    all_events = transaction.events(trx['id'],dictionaries.API_KEY)
    assert all_events is not None

def test_refund_transaction ():
    trx = transaction.create(dictionaries.VALID_CREDIT_CARD_TRANSACTION_DICTIONARY)
    refunded_transaction = transaction.refund(trx['id'],dictionaries.REFUNDED_OR_CAPTURE_TRANSACTION)
    assert 'refunded' == refunded_transaction['status']

def test_capture_transaction():
    trx = transaction.create(dictionaries.VALID_CREDIT_CARD_TRANSACTION_CAPTURE_FALSE_DICTIONARY)
    capture_transaction = transaction.capture(trx['id'],dictionaries.REFUNDED_OR_CAPTURE_TRANSACTION)
    assert 'paid' == capture_transaction['status']
{'fraction_non_alphanumeric': 0.0772804054054054, 'fraction_numerical': 0.0, 'mean_word_length': 7.003378378378378, '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': '2196442', 'n_tokens_mistral': 748, 'n_tokens_neox': 740, 'n_words': 123}