Exemplo n.º 1
0
 def test_unpack(self):
     """Test if unpack fails"""
     controller = Controller(address='unix:abstract=abcde')
     controller.establish_connection = Mock(return_value=None)
     controller.connection = MockConnection(True)
     with pytest.raises(ConnectionReturnError):
         controller.new_record()
Exemplo n.º 2
0
 def test_unpack(self):
     """Test if unpack fails"""
     controller = Controller(address='unix:abstract=abcde')
     controller.establish_connection = Mock(return_value=None)
     controller.connection = MockConnection(True)
     with pytest.raises(ConnectionReturnError):
         controller.new_record()
Exemplo n.º 3
0
 def new_record(self):
     """Create a Controller object and call new_record method"""
     res = []
     controller = Controller()
     for _ in range(self.NUM * self.FACTOR):
         res.append(controller.new_record())
     return res
Exemplo n.º 4
0
 def new_record(self):
     """Create a Controller object and call new_record method"""
     res = []
     controller = Controller()
     for _ in range(self.NUM * self.FACTOR):
         res.append(controller.new_record())
     return res
Exemplo n.º 5
0
 def test_action_fails(self):
     """Test what happens if the requested action fails"""
     controller = Controller(address='unix:abstract=abcde')
     controller.establish_connection = Mock(return_value=None)
     controller.connection = MockConnection(return_variant=True,
                                            should_fail=True)
     assert controller.new_record() is False
Exemplo n.º 6
0
 def test_action_fails(self):
     """Test what happens if the requested action fails"""
     controller = Controller(address='unix:abstract=abcde')
     controller.establish_connection = Mock(return_value=None)
     controller.connection = MockConnection(
         return_variant=True, should_fail=True)
     assert controller.new_record() is False
Exemplo n.º 7
0
 def test_normal_unpack(self):
     """Test if valid"""
     controller = Controller(address='unix:abstract=abcdef')
     controller.establish_connection = Mock(return_value=None)
     controller.connection = MockConnection(False)
     assert controller.new_record() is True
Exemplo n.º 8
0
 def test_normal_unpack(self):
     """Test if valid"""
     controller = Controller(address='unix:abstract=abcdef')
     controller.establish_connection = Mock(return_value=None)
     controller.connection = MockConnection(False)
     assert controller.new_record() is True