Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
bkocis committed Oct 22, 2023
1 parent f267b1a commit 0a09ef1
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions tests/chatgptApp/test_main.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,8 @@
import unittest
import sqlite3
from chatgptApp.main import on_clear_click
from chatgptApp.main import insert_into_db


class TestOnClearClick(unittest.TestCase):
def test_on_clear_click(self):
expected_output = ("", [], [])
self.assertEqual(on_clear_click(), expected_output)


def setup_module(module):
global conn
conn = sqlite3.connect(':memory:')
c = conn.cursor()
c.execute("CREATE TABLE chat_session_01 (question text, answer text)")


def teardown_module(module):
conn.close()


def test_insert_into_db():
insert_into_db('Hello', 'World')
c = conn.cursor()
c.execute("SELECT * FROM chat_session_01")
assert c.fetchone() == ('Hello', 'World')

0 comments on commit 0a09ef1

Please sign in to comment.