예제 #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()
예제 #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()
예제 #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')