Exemplo n.º 1
0
    def test_updateWithProcessCaches(self, mock_writer_obj, mock_validator):
        mock_writer = mock_writer_obj.return_value

        patient = QtcFile('path/to/file', mock_validator)
        patient.update()

        mock_writer.process_caches.assert_called_once_with()
Exemplo n.º 2
0
    def test_removeWillNotRemovePathIfPathIsInvalid(self, mock_writer_obj, mock_validator):
        mock_writer = mock_writer_obj.return_value
        mock_validator.is_valid.return_value = False

        patient = QtcFile('path/to/file', mock_validator)
        patient.remove('hello/World')

        mock_writer.remove.assert_not_called()
Exemplo n.º 3
0
    def test_removeWillRemovePathIsPathIsValid(self, mock_writer_obj, mock_validator):
        mock_writer = mock_writer_obj.return_value
        mock_validator.is_valid.return_value = True

        patient = QtcFile('path/to/file', mock_validator)
        patient.remove('hello/World')

        mock_writer.remove.assert_called_with('hello/World')