Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RELEASE #14

Merged
merged 21 commits into from
Mar 13, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
RAW INLINES v 1.62 #13
Nps-rf committed Mar 12, 2022
commit c8c3be5ea767713cd30d40b85e1719b2f9599a3f
4 changes: 2 additions & 2 deletions Course_1/Telegram_Bot/Tests/tests.py
Original file line number Diff line number Diff line change
@@ -4,15 +4,15 @@


class DatabaseTests(unittest.TestCase):
Test_DB = Database()
Test_DB = Database.UsersDB()

def test_init(self):
"""
Тестирование процесса создания базы данных
"""
Database_NAME = 'TEST_DATABASE'
Connections.database = f'{Database_NAME}.db'
self.Test_DB.init(name=Database_NAME)
self.Test_DB.init()
self.assertTrue(os.path.exists(Connections.database), 'База данных не создалась или создалась некорректно')


1 change: 0 additions & 1 deletion Course_1/Telegram_Bot/bot.py
Original file line number Diff line number Diff line change
@@ -27,7 +27,6 @@ class SelfState(StatesGroup):
dp = Dispatcher(bot, storage=storage)
HDB = Database()
UDB = Database.UsersDB()

days_of_week = {
1: 'Понедельник',
2: 'Вторник',
14 changes: 7 additions & 7 deletions Course_1/Telegram_Bot/db.py
Original file line number Diff line number Diff line change
@@ -23,8 +23,8 @@ def init(self, connection: tuple):
connection, cursor = connection
cursor.execute('''create table if not exists Users (
id INTEGER primary key,
chat_id TEXT not null,
user_group TEXT not null
chat_id TEXT,
user_group TEXT
)''')
connection.commit()

@@ -52,11 +52,11 @@ def init(self, connection: tuple, name: str = 'Homework') -> None:
cursor.execute(
f'create table if not exists {name}('
f'id INTEGER primary key,'
f'subject_id int not null,'
f'date text not null,'
f'text text not null'
f'"Group" text not null,'
f'Author text not null)'
f'subject_id int,'
f'date text,'
f'text text,'
f'"Group" text,'
f'Author text)'
)

connection.commit()