<commit_before>from unittest import TestCase
from python.main import get_payee_details_for_transaction
from python.main import get_subcategory_id_for_transaction
from python.main import get_p2p_transaction_payee_name


class Stub(object):
    pass


class TestMain(TestCase):
    def test_get_payee_details_for_transaction(self):
        transaction_stub = Stub()
        payee_stub = Stub()
        subcategory_stub = Stub()

        payee_stub.id = '123'
        subcategory_stub.id = '234'
        subcategory_stub.name = 'Test'
        transaction_stub.entities_payee = payee_stub
        transaction_stub.entities_subcategory = subcategory_stub

        self.assertTupleEqual(get_payee_details_for_transaction(transaction_stub, 'Test Payee Name'),
                              ('123', '234'))

    def test_get_subcategory_id_for_transaction(self):
        transaction_stub = Stub()
        subcategory_stub = Stub()

        subcategory_stub.id = '234'
        subcategory_stub.name = 'Test'
        transaction_stub.entities_subcategory = subcategory_stub

        self.assertEqual(get_subcategory_id_for_transaction(transaction_stub, 'Test Payee Name'), '234')

    def test_get_p2p_transaction_payee_name_counterparty_name(self):
        data = {
            'counterparty': {
                'name': 'test'
            }
        }

        self.assertEqual(get_p2p_transaction_payee_name(data), 'test')

    def test_get_p2p_transaction_payee_name_counterparty_number(self):
        data = {
            'counterparty': {
                'number': '123'
            }
        }

        self.assertEqual(get_p2p_transaction_payee_name(data), '123')<commit_msg>Remove test as we don't have this method now<commit_after>from unittest import TestCase
from python.main import get_subcategory_id_for_transaction
from python.main import get_p2p_transaction_payee_name


class Stub(object):
    pass


class TestMain(TestCase):
    def test_get_subcategory_id_for_transaction(self):
        transaction_stub = Stub()
        subcategory_stub = Stub()

        subcategory_stub.id = '234'
        subcategory_stub.name = 'Test'
        transaction_stub.entities_subcategory = subcategory_stub

        self.assertEqual(get_subcategory_id_for_transaction(transaction_stub, 'Test Payee Name'), '234')

    def test_get_p2p_transaction_payee_name_counterparty_name(self):
        data = {
            'counterparty': {
                'name': 'test'
            }
        }

        self.assertEqual(get_p2p_transaction_payee_name(data), 'test')

    def test_get_p2p_transaction_payee_name_counterparty_number(self):
        data = {
            'counterparty': {
                'number': '123'
            }
        }

        self.assertEqual(get_p2p_transaction_payee_name(data), '123')
{'fraction_non_alphanumeric': 0.0802579720530276, 'fraction_numerical': 0.016481547832318165, 'mean_word_length': 2.9379407616361073, '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': '7426121', 'n_tokens_mistral': 871, 'n_tokens_neox': 851, 'n_words': 135}