Пример #1
0
    def test_project_does_not_exist_when_loading_the_project_fails(self):
        project_loader = mock.MagicMock()
        project_loader.load.side_effect = NotACpmProject
        creation_service = CreationService(project_loader)
        directory = 'project_location'

        assert not creation_service.exists(directory)
        project_loader.load.assert_called_once_with(directory)
Пример #2
0
    def test_project_exists_when_loading_the_project_succeeds(self):
        project_loader = mock.MagicMock()
        project_loader.load.return_value = Project('dummy')
        creation_service = CreationService(project_loader)
        directory = '.'

        assert creation_service.exists(directory)
        project_loader.load.assert_called_once_with(directory)