diff --git a/tests/examples/example_tables.py b/tests/examples/example_orm.py similarity index 100% rename from tests/examples/example_tables.py rename to tests/examples/example_orm.py diff --git a/tests/examples/expected_output.py b/tests/examples/expected_ssg.py similarity index 100% rename from tests/examples/expected_output.py rename to tests/examples/expected_ssg.py diff --git a/tests/test_main.py b/tests/test_main.py index eadc391d..855ff0ec 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -7,7 +7,7 @@ from typer.testing import CliRunner from sqlsynthgen.main import app -from tests.examples import example_tables, expected_output +from tests.examples import example_orm, expected_ssg from tests.utils import get_test_settings runner = CliRunner() @@ -121,12 +121,12 @@ def test_make_generators(self) -> None: with patch("sqlsynthgen.main.make_generators_from_tables") as mock_make: result = runner.invoke( app, - ["make-generators", "tests/examples/example_tables.py"], + ["make-generators", "tests/examples/example_orm.py"], catch_exceptions=False, ) self.assertSuccess(result) - mock_make.assert_called_once_with(example_tables) + mock_make.assert_called_once_with(example_orm) def test_create_tables(self) -> None: """Test the create-tables sub-command.""" @@ -134,12 +134,12 @@ def test_create_tables(self) -> None: with patch("sqlsynthgen.main.create_db_tables") as mock_create: result = runner.invoke( app, - ["create-tables", "tests/examples/example_tables.py"], + ["create-tables", "tests/examples/example_orm.py"], catch_exceptions=False, ) self.assertSuccess(result) - mock_create.assert_called_once_with(example_tables.metadata) + mock_create.assert_called_once_with(example_orm.metadata) def test_create_data(self) -> None: """Test the create-data sub-command.""" @@ -149,13 +149,13 @@ def test_create_data(self) -> None: app, [ "create-data", - "tests/examples/example_tables.py", - "tests/examples/expected_output.py", + "tests/examples/example_orm.py", + "tests/examples/expected_ssg.py", ], catch_exceptions=False, ) self.assertSuccess(result) mock_create_db_data.assert_called_once_with( - example_tables.metadata.sorted_tables, expected_output.sorted_generators + example_orm.metadata.sorted_tables, expected_ssg.sorted_generators ) diff --git a/tests/test_make.py b/tests/test_make.py index 08f5cca7..7677e105 100644 --- a/tests/test_make.py +++ b/tests/test_make.py @@ -2,7 +2,7 @@ from unittest import TestCase from sqlsynthgen import make -from tests.examples import example_tables +from tests.examples import example_orm class MyTestCase(TestCase): @@ -12,9 +12,9 @@ def test_make_generators_from_tables(self) -> None: """Check that we can make a generators file from a tables module.""" with open( - "tests/examples/expected_output.py", encoding="utf-8" + "tests/examples/expected_ssg.py", encoding="utf-8" ) as expected_output: expected = expected_output.read() - actual = make.make_generators_from_tables(example_tables) + actual = make.make_generators_from_tables(example_orm) self.assertEqual(expected, actual)