def test_collect_project_apps__no_apps(self, mock_app_configs): """Test no project apps returns empty set.""" mock_app_configs.return_value = [] apps = collect_project_apps() self.assertSetEqual(apps, set()) self.assertEqual(mock_app_configs.call_count, 1)
def test_collect_project_apps__apps_not_project_apps( self, mock_app_configs): """Test apps not in project directory are not returned.""" app = self.app_klass(name='unknown', path='blah/test.py') mock_app_configs.return_value = [app] apps = collect_project_apps() self.assertSetEqual(apps, set()) self.assertEqual(mock_app_configs.call_count, 1)
def test_collect_project_apps__apps_are_project_apps( self, mock_app_configs): """Test apps not in project directory are returned.""" app = self.app_klass(name='app', path=settings.PROJECT_DIR + '/blah/test.py') mock_app_configs.return_value = [app] apps = collect_project_apps() self.assertSetEqual(apps, {app.name}) self.assertEqual(mock_app_configs.call_count, 1)
def __init__(self, *args, **kwargs): """Initialise the lint runner.""" super(Command, self).__init__(*args, **kwargs) self.result = None self.apps = collect_project_apps()
def __init__(self, *args, **kwargs): """Initialise the coverage runner.""" super(Command, self).__init__(*args, **kwargs) self.apps = collect_project_apps()