Commit 45ed437f authored by Sebastien Duthil's avatar Sebastien Duthil

remove boilerplate for @patch

parent bb545a88
......@@ -21,7 +21,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <>.
from mock import Mock, patch
from mock import patch
from xivo_dao.alchemy.linefeatures import LineFeatures
from xivo_dao.alchemy.sccpline import SCCPLine
from xivo_dao.alchemy.usersip import UserSIP
......@@ -30,9 +30,6 @@ from xivo_dao.alchemy.userfeatures import UserFeatures
from xivo_dao.tests.test_dao import DAOTestCase
from xivo_dao.linefeaturesdao import LineFeaturesDAO
get_sip_cid = Mock()
get_sccp_cid = Mock()
class TestLineFeaturesDAO(DAOTestCase):
......@@ -140,9 +137,9 @@ class TestLineFeaturesDAO(DAOTestCase):
self.assertRaises(ValueError, linefeaturesdao._get_cid_for_sip_channel, 'sccp/1300@SEP29287324-1')
@patch('xivo_dao.linefeaturesdao._get_cid_for_sccp_channel', get_sccp_cid)
@patch('xivo_dao.linefeaturesdao._get_cid_for_sip_channel', get_sip_cid)
def test_get_cid_for_channel(self):
def test_get_cid_for_channel(self, get_sip_cid, get_sccp_cid):
channel = 'DAHDI/i1/12543656-1235'
self.assertRaises(ValueError, linefeaturesdao.get_cid_for_channel, channel)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment