Skip to content

Commit

Permalink
Fixes mock socket in unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gfrn committed Sep 12, 2022
1 parent 9434c52 commit adb3847
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion tests/unit/test_read_vars_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@


class TestCommon(unittest.TestCase):
@patch("socket.socket")
@patch("pydrs.EthDRS._transfer")
def setUp(self, transfer):
def setUp(self, transfer, socket):
socket = socket.return_value
self.drs = GenericDRS("127.0.0.1", 5000)
self.drs._transfer = transfer

Expand Down
4 changes: 3 additions & 1 deletion tests/unit/test_read_vars_fac.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@


class TestFAC(unittest.TestCase):
@patch("socket.socket")
@patch("pydrs.EthDRS._transfer")
def setUp(self, transfer):
def setUp(self, transfer, socket):
socket = socket.return_value
self.drs = GenericDRS("127.0.0.1", 5000)
self.drs._transfer = transfer

Expand Down
4 changes: 3 additions & 1 deletion tests/unit/test_read_vars_fap.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@


class TestFAP(unittest.TestCase):
@patch("socket.socket")
@patch("pydrs.EthDRS._transfer")
def setUp(self, transfer):
def setUp(self, transfer, socket):
socket = socket.return_value
self.drs = GenericDRS("127.0.0.1", 5000)
self.drs._transfer = transfer

Expand Down
4 changes: 3 additions & 1 deletion tests/unit/test_read_vars_fbp.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@


class TestFBP(unittest.TestCase):
@patch("socket.socket")
@patch("pydrs.EthDRS._transfer")
def setUp(self, transfer):
def setUp(self, transfer, socket):
socket = socket.return_value
self.drs = GenericDRS("127.0.0.1", 5000)
self.drs._transfer = transfer

Expand Down

0 comments on commit adb3847

Please sign in to comment.