コード例 #1
0
ファイル: test_models.py プロジェクト: transforlab/pontoon
 def test_repository_for_path(self):
     """
     Return the first repo found with a checkout path that contains
     the given path.
     """
     repo1, repo2, repo3 = RepositoryFactory.create_batch(3)
     project = ProjectFactory.create(repositories=[repo1, repo2, repo3])
     path = os.path.join(repo2.checkout_path, 'foo', 'bar')
     assert_equal(project.repository_for_path(path), repo2)
コード例 #2
0
ファイル: test_models.py プロジェクト: transforlab/pontoon
 def test_repository_for_path(self):
     """
     Return the first repo found with a checkout path that contains
     the given path.
     """
     repo1, repo2, repo3 = RepositoryFactory.create_batch(3)
     project = ProjectFactory.create(repositories=[repo1, repo2, repo3])
     path = os.path.join(repo2.checkout_path, 'foo', 'bar')
     assert_equal(project.repository_for_path(path), repo2)
コード例 #3
0
    def test_end_time(self):
        """
        Return the latest end time among repo sync logs for this log.
        """
        project = ProjectFactory.create(repositories=[])
        source_repo, repo1, repo2 = RepositoryFactory.create_batch(3, project=project)
        project_sync_log = ProjectSyncLogFactory.create(project=project)

        RepositorySyncLogFactory.create(project_sync_log=project_sync_log,
                                        repository=repo1,
                                        end_time=aware_datetime(2015, 1, 1))

        assert_equal(project_sync_log.end_time, aware_datetime(2015, 1, 1))
コード例 #4
0
ファイル: test_models.py プロジェクト: MekliCZ/pontoon
    def test_end_time(self):
        """
        Return the latest end time among repo sync logs for this log.
        """
        project = ProjectFactory.create(repositories=[])
        source_repo, repo1, repo2 = RepositoryFactory.create_batch(3, project=project)
        project_sync_log = ProjectSyncLogFactory.create(project=project)

        RepositorySyncLogFactory.create(project_sync_log=project_sync_log,
                                        repository=repo1,
                                        end_time=aware_datetime(2015, 1, 1))

        assert_equal(project_sync_log.end_time, aware_datetime(2015, 1, 1))