Пример #1
0
    def test_remove_missing(self):
        """
        Test that when there are units to remove, the conduit is called correctly.
        """
        mock_unit = Mock()
        mock_conduit = Mock()
        method = SynchronizeWithDirectory(mock_conduit, {})

        method._remove_missing([mock_unit], [])
        mock_conduit.remove_unit.assert_called_once_with(mock_unit)
Пример #2
0
    def test_remove_missing(self):
        """
        Test that when there are units to remove, the conduit is called correctly.
        """
        mock_unit = Mock()
        mock_conduit = Mock()
        method = SynchronizeWithDirectory(mock_conduit, {})

        method._remove_missing([mock_unit], [])
        mock_conduit.remove_unit.assert_called_once_with(mock_unit)
Пример #3
0
    def test_remove_missing_canceled(self):
        """
        Test that when the sync is canceled, no units are removed.
        """
        mock_unit = Mock()
        mock_conduit = Mock()
        method = SynchronizeWithDirectory(mock_conduit, {})
        method.canceled = True

        method._remove_missing([mock_unit], [])
        self.assertEqual(0, mock_conduit.remove_unit.call_count)
Пример #4
0
    def test_remove_missing_canceled(self):
        """
        Test that when the sync is canceled, no units are removed.
        """
        mock_unit = Mock()
        mock_conduit = Mock()
        method = SynchronizeWithDirectory(mock_conduit, {})
        method.canceled = True

        method._remove_missing([mock_unit], [])
        self.assertEqual(0, mock_conduit.remove_unit.call_count)