コード例 #1
0
ファイル: tests.py プロジェクト: mytardis/hpctardis
    def _metadata_extract(self,expname,files,ns,schname,results):
        """ Check that we can create an VASP experiment and extract metadata from it"""
        
        login = self.client.login(username=self.username,
                                  password=self.pwd)
        self.assertTrue(login)
        exp = models.Experiment(title=expname,
                                institution_name='rmit',
                                created_by=self.user,
                                public=True
                                )
        exp.save()
        acl = ExperimentACL(
            pluginId=django_user,
            entityId=str(self.user.id),
            experiment=exp,
            canRead=True,
            isOwner=True,
            aclOwnershipType=ExperimentACL.OWNER_OWNED,
            )
        acl.save()
        self.assertEqual(exp.title, expname)
        self.assertEqual(exp.url, None)
        self.assertEqual(exp.institution_name, 'rmit')
        self.assertEqual(exp.approved, False)
        self.assertEqual(exp.handle, None)
        self.assertEqual(exp.created_by, self.user)
        self.assertEqual(exp.public, True)
        self.assertEqual(exp.get_or_create_directory(),
                         path.join(settings.FILE_STORE_PATH, str(exp.id)))

        self.experiment_path = path.join(settings.FILE_STORE_PATH, str(exp.id))
      
        dataset = models.Dataset(description="dataset description...",
                                 experiment=exp)
        dataset.save()
        for f in files:
            self._make_datafile(dataset,
                       path.join(path.abspath(path.dirname(__file__)),f))       
        go()
        self._test_metadata(ns,schname,dataset,results)
コード例 #2
0
ファイル: extractmetadata.py プロジェクト: mytardis/hpctardis
 def handle(self, *args, **options):
     go()