예제 #1
0
    def test_willUpdateBothFilesAndIncludes(self, mock_files, mock_includes):
        patient = QtcUpdater(mock_files, mock_includes)
        patient.update_files()

        mock_files.update.assert_called_once_with()
        mock_includes.update.assert_called_once_with()
예제 #2
0
    def test_removeDirRemovesTheFileFromTheIncludesFile(self, mock_files, mock_includes):
        patient = QtcUpdater(mock_files, mock_includes)
        patient.remove('hello/World', is_dir=True)

        mock_includes.remove.assert_called_with('hello/World')
예제 #3
0
    def test_moveWillRemoveSrcAndAddDestToIncludesFile(self, mock_files, mock_includes):
        patient = QtcUpdater(mock_files, mock_includes)
        patient.move('hello/World', 'world/Hello', is_dir=True)

        mock_includes.remove.assert_called_with('hello/World')
        mock_includes.write.assert_called_with('world/Hello')
예제 #4
0
    def test_addDirAddsTheDirToTheIncludesFile(self, mock_files, mock_includes):
        patient = QtcUpdater(mock_files, mock_includes)
        patient.add('hello/World', is_dir=True)

        mock_includes.write.assert_called_with('hello/World')