-
Notifications
You must be signed in to change notification settings - Fork 55
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
Add unit tests for coriolis.db.sqlalchemy.*
modules
#324
Add unit tests for coriolis.db.sqlalchemy.*
modules
#324
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First review pass done, mostly LGTM
class DatabaseSqlalchemyApiTestCase(test_base.CoriolisBaseTestCase): | ||
|
||
@mock.patch.object(db_session, 'EngineFacade') | ||
def test_get_facede_none(self, mock_EngineFacade): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: please rename in order to fix typo: test_get_facade_none
mock_EngineFacade.assert_called_once_with(mock.sentinel.connection) | ||
|
||
@mock.patch.object(db_session, 'EngineFacade') | ||
def test_get_facede(self, mock_EngineFacade): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above, rename into test_get_facade
) | ||
mock_db_sync.assert_called_once_with( | ||
mock.sentinel.engine, | ||
mock.ANY, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of passing mock.ANY
, let's please mock os.path.abspath
, make it return something like "/abspath"
. Then you can replace this with "/abspath/migrate_repo"
. Please apply this to all of these test methods
9b4abc6
to
0d2467a
Compare
This PR add unit tests for
coriolis.db.sqlalchemy.*
modules