Spaces:
Sleeping
Sleeping
chores
Browse files- tests/test_federation.py +0 -16
tests/test_federation.py
CHANGED
|
@@ -1,23 +1,7 @@
|
|
| 1 |
-
import sqlite3
|
| 2 |
import pytest
|
| 3 |
from unittest.mock import MagicMock
|
| 4 |
|
| 5 |
from blossomtune_gradio import federation as fed
|
| 6 |
-
from blossomtune_gradio import database
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
@pytest.fixture
|
| 10 |
-
def in_memory_db(mocker):
|
| 11 |
-
"""
|
| 12 |
-
Fixture to set up and tear down an in-memory SQLite database for tests.
|
| 13 |
-
It ensures that the same connection object is used for both schema
|
| 14 |
-
initialization and the test execution.
|
| 15 |
-
"""
|
| 16 |
-
con = sqlite3.connect(":memory:")
|
| 17 |
-
mocker.patch("sqlite3.connect", return_value=con)
|
| 18 |
-
database.init()
|
| 19 |
-
yield con
|
| 20 |
-
con.close()
|
| 21 |
|
| 22 |
|
| 23 |
@pytest.fixture
|
|
|
|
|
|
|
| 1 |
import pytest
|
| 2 |
from unittest.mock import MagicMock
|
| 3 |
|
| 4 |
from blossomtune_gradio import federation as fed
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
|
| 7 |
@pytest.fixture
|