예제 #1
0
    def setUp(self):
        """
            Create repository, and commit test_é.txt file.
        """

        self.st = GitStorage.create_storage('test-commit-file-git')
        self.user = TestUser()
예제 #2
0
    def setUp(self):
        """
            Create repository, and commit test_é.txt file.
        """

        self.st = GitStorage.create_storage('test-log-git')
        self.user = TestUser()

        f = ContentFile(u'héhé'.encode('utf-8'))
        self.st.save(u'test_é.txt', f)
        self.commit = self.st.commit(self.user, u'test commit é')
예제 #3
0
    def test_create_repository(self):
        """
            Try to create a repository, and check the new folder exists.
            Try it via create_storage() and GitStorage(), then make sure both
            repository points to the same folder.
        """

        r = GitStorage.create_storage('test-create-storage-git')

        self.assertIsNotNone(r.repo.workdir)
        self.assertTrue(os.path.exists(r.repo.workdir))

        r2 = GitStorage('test-create-storage-git')

        self.assertIsNotNone(r2.repo.workdir)
        self.assertTrue(os.path.exists(r2.repo.workdir))
        self.assertEqual(r.repo.workdir, r2.repo.workdir)
예제 #4
0
    def setUp(self):
        """
            Create repository, and commit test_é.txt file.
        """

        self.st = GitStorage.create_storage('test-diff-git')
        self.user = TestUser()

        # First commit
        f = ContentFile(u'héhé'.encode('utf-8'))
        self.st.save(u'test_é.txt', f)
        self.commit1 = self.st.commit(self.user, u'test commit é')

        # Second commit
        f = ContentFile(u'hèhè'.encode('utf-8'))
        self.st.save(u'test_é.txt', f)
        self.commit2 = self.st.commit(self.user, u'test commit è')
예제 #5
0
    def setUp(self):
        """
            Create repository, and commit test_é.txt file.
        """

        self.st = GitStorage.create_storage("test-stats-git")
        self.user = TestUser()

        self.f = ContentFile(u"héhé".encode("utf-8"))
        self.st.save(u"test/test_é.txt", self.f)
        self.st.commit(self.user, u"test commit é")

        # save current time (without microseconds)
        # the current time is the last accessed time,
        # the last modified time, and the creation time
        # of test_é.txt file.
        d = datetime.now()
        self.now = datetime(d.year, d.month, d.day, d.hour, d.minute)