<commit_before># -*- coding: utf-8 -*-
import sys

sys.path.append('../')

import pytest
import os
import datetime

import pyqiwi
from pyqiwi import Wallet

should_skip = 'TOKEN' and 'NUMBER' not in os.environ

if not should_skip:
    TOKEN = os.environ['TOKEN']
    NUMBER = os.environ['NUMBER']


@pytest.mark.skipif(should_skip, reason="No environment variables configured")
class TestWallet:
    def test_create_wallet(self):
        qiwi_wallet = Wallet(TOKEN, number=NUMBER)
        assert isinstance(qiwi_wallet, Wallet)

    def test_check_balance(self):
        qiwi_wallet = Wallet(TOKEN, number=NUMBER)
        assert isinstance(qiwi_wallet, Wallet)
        assert type(qiwi_wallet.balance()) == float

    def test_check_history(self):
        qiwi_wallet = Wallet(TOKEN, number=NUMBER)
        assert isinstance(qiwi_wallet, Wallet)
        history = qiwi_wallet.history()
        assert type(history) == dict
        for tnx in history['transactions']:
            assert type(tnx) == pyqiwi.types.Transaction
        assert type(history['next_txn_date']) == datetime.datetime<commit_msg>Fix: Провал теста баланса<commit_after># -*- coding: utf-8 -*-
import sys

sys.path.append('../')

import pytest
import os
import datetime

import pyqiwi
from pyqiwi import Wallet

should_skip = 'TOKEN' and 'NUMBER' not in os.environ

if not should_skip:
    TOKEN = os.environ['TOKEN']
    NUMBER = os.environ['NUMBER']


@pytest.mark.skipif(should_skip, reason="No environment variables configured")
class TestWallet:
    def test_create_wallet(self):
        qiwi_wallet = Wallet(TOKEN, number=NUMBER)
        assert isinstance(qiwi_wallet, Wallet)

    def test_check_history(self):
        qiwi_wallet = Wallet(TOKEN, number=NUMBER)
        assert isinstance(qiwi_wallet, Wallet)
        history = qiwi_wallet.history()
        assert type(history) == dict
        for tnx in history['transactions']:
            assert type(tnx) == pyqiwi.types.Transaction
        assert type(history['next_txn_date']) == datetime.datetime
{'fraction_non_alphanumeric': 0.10782865583456426, 'fraction_numerical': 0.0009847365829640572, 'mean_word_length': 3.5662921348314605, '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': '5769048', 'n_tokens_mistral': 642, 'n_tokens_neox': 653, 'n_words': 153}