[AIRFLOW-1210] Enable DbApiHook unit tests

Closes #2302 from skudriashev/airflow-1210
This commit is contained in:
Stanislav Kudriashev 2017-05-17 21:03:44 +02:00 коммит произвёл Bolke de Bruin
Родитель f9ffbbd918
Коммит a379cc1bcb
2 изменённых файлов: 15 добавлений и 3 удалений

13
tests/hooks/__init__.py Normal file
Просмотреть файл

@ -0,0 +1,13 @@
# -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

Просмотреть файл

@ -56,8 +56,7 @@ class TestDbApiHook(unittest.TestCase):
("world",)]
self.cur.fetchall.return_value = rows
self.assertEqual(rows, self.db_hook.get_records(statement, parameters))
self.conn.close.assert_called_once()
@ -73,4 +72,4 @@ class TestDbApiHook(unittest.TestCase):
self.conn.close.assert_called_once()
self.cur.close.assert_called_once()
self.cur.execute.assert_called_once_with(statement)
self.cur.execute.assert_called_once_with(statement)