Example #1
0
    def setUp(self):

        # Make some mock subjects.
        subjects_utils.subject_enroll(testing.mock_subjects)

        # Make a mock git project.
        self.mock_repository_setup_dir\
            = testing_utils.make_mock_repository_files()

        self.mock_repository\
             = testing_utils.MockExperimentRepository(
                 setup_dir = self.mock_repository_setup_dir)

        self.mock_repository.initialize()
        self.number_of_revisions = 10
        self.mock_repository.update(revisions=self.number_of_revisions)

        # Make a repository, archives, etc for the experiments.
        setup_fields = dict(name = 'mock',
                      description = 'A mock repository',
                      date_created = datetime.datetime.now(),
                      is_active = True,
                      path = self.mock_repository.path)

        self.experiment_repository = archives_models.ExperimentRepository\
            .objects.create(**setup_fields)
        self.experiment_repository.make_archives()

        # Set current version to default.
        archives_models.Experiment.objects.set_default_current_version()
Example #2
0
    def setUp(self):

        # Make a mock git project.
        self.mock_repository_setup_dir = testing_utils.make_mock_repository_files()

        self.mock_repository = testing_utils.MockExperimentRepository(setup_dir=self.mock_repository_setup_dir)

        self.mock_repository.initialize()
        self.number_of_revisions = 10
        self.mock_repository.update(revisions=self.number_of_revisions)

        # Make a repository, archives, etc for the experiments.
        setup_fields = dict(
            name="mock",
            description="A mock repository",
            date_created=datetime.datetime.now(),
            is_active=True,
            path=self.mock_repository.path,
        )

        self.experiment_repository = archives_models.ExperimentRepository.objects.create(**setup_fields)

        for commit_hash, commit_date in self.experiment_repository.get_all_commits():
            archives_models.ExperimentArchive.new(self.experiment_repository, commit_hash)

        # Set current version to default.
        archives_models.Experiment.objects.set_default_current_version()
Example #3
0
    def setUp(self):

        number_of_revisions = 10

        self.mock_repository_setup_dir = testing_utils.make_mock_repository_files()

        self.mock_repository = testing_utils.MockExperimentRepository(
            setup_dir=self.mock_repository_setup_dir, initial_date=datetime.datetime.now()
        )

        self.mock_repository.initialize()
        self.mock_repository.update(revisions=number_of_revisions)

        self.test_name = "mock"
        self.test_description = "A mock repository"

        self.setup_fields = dict(
            name=self.test_name,
            description=self.test_description,
            date_created=datetime.datetime.now(),
            is_active=True,
            path=self.mock_repository.path,
        )