def setUp(self): logging.basicConfig(level=logging.WARNING) settings.PROJECT_FS_ROOT = settings.PROJECT_FS_ROOT_TEST create_project_local('project1') create_project_db('Project 1', 'http://www.example1.com', 'project1') create_release_db('project1', '3.0', True) create_release_db('project1', '3.1')
def setUp(self): logging.basicConfig(level=logging.WARNING) create_code_element_kinds() self.project = create_project_db('Project 1', 'http://www.example1.com', 'project1') create_release_db('project1', '3.0', True) create_release_db('project1', '3.1')
def setUp(self): DEBUG_LOG.clear() cu.clear_cache() self.pname = 'project1' self.release = '3.0' logging.basicConfig(level=logging.WARNING) create_code_element_kinds() self.project = create_project_db('Project 1', 'http://www.example1.com', self.pname) self.releasedb = create_release_db(self.pname, self.release, True) create_release_db(self.pname, '3.1') self.ann_kind = CodeElementKind.objects.get(kind='annotation') self.class_kind = CodeElementKind.objects.get(kind='class') self.enum_kind = CodeElementKind.objects.get(kind='enumeration') self.method_kind = CodeElementKind.objects.get(kind='method') self.ann_field_kind = CodeElementKind.objects.get( kind='annotation field') self.enum_value_kind = CodeElementKind.objects.get( kind='enumeration value') self.field_kind = CodeElementKind.objects.get(kind='field') self.code_refs = [] self.code_snippets = []
def testCreateProjectDBNonUnique(self): create_project_db("Project 1", "http://www.example1.com", "project1") try: sid = transaction.savepoint() create_project_db("Project 1", "http://www.example1.com", "project2") self.fail("Should have failed!") except: transaction.savepoint_rollback(sid) self.assertTrue(True) try: sid = transaction.savepoint() create_project_db("Project 2", "http://www.example1.com", "project1") self.fail("Should have failed!") except: transaction.savepoint_rollback(sid) self.assertTrue(True) self.assertEqual(1, Project.objects.count())
def testCreateProjectDBNonUnique(self): create_project_db('Project 1', 'http://www.example1.com', 'project1') try: sid = transaction.savepoint() create_project_db('Project 1', 'http://www.example1.com', 'project2') self.fail('Should have failed!') except: transaction.savepoint_rollback(sid) self.assertTrue(True) try: sid = transaction.savepoint() create_project_db('Project 2', 'http://www.example1.com', 'project1') self.fail('Should have failed!') except: transaction.savepoint_rollback(sid) self.assertTrue(True) self.assertEqual(1, Project.objects.count())
def testListProjectsDB(self): create_project_db("Project 1", "http://www.example1.com", "project1") create_project_db("Project 2", "http://www.example1.com", "project2") self.assertEqual(2, len(list_projects_db()))
def testCreateProjectRelease(self): create_project_db("Project 1", "http://www.example1.com", "project1") create_release_db("project1", "3.0", True) create_release_db("project1", "3.1") self.assertTrue(2, ProjectRelease.objects.count())
def testCreateProjectDB(self): create_project_db("Project 1", "http://www.example1.com", "project1") create_project_db("Project 2", "http://www.example1.com", "project2") self.assertEqual(2, Project.objects.count())
def testListProjectsDB(self): create_project_db('Project 1', 'http://www.example1.com', 'project1') create_project_db('Project 2', 'http://www.example1.com', 'project2') self.assertEqual(2, len(list_projects_db()))
def testCreateProjectRelease(self): create_project_db('Project 1', 'http://www.example1.com', 'project1') create_release_db('project1', '3.0', True) create_release_db('project1', '3.1') self.assertTrue(2, ProjectRelease.objects.count())
def testCreateProjectDB(self): create_project_db('Project 1', 'http://www.example1.com', 'project1') create_project_db('Project 2', 'http://www.example1.com', 'project2') self.assertEqual(2, Project.objects.count())
def handle_noargs(self, **options): create_project_db(smart_decode(options.get('pfullname')), smart_decode(options.get('url')), smart_decode(options.get('pname'))) if (options.get('local', False)): create_project_local(smart_decode(options.get('pname')))