Exemplo n.º 1
0
    def test_directoryContainingFile(self):
        """
        For a key associated with a value of a C{dict} with a key associated
        with a value of a C{str}, L{createSubversionRepository} should create a
        directory containing a file with the specified string as its content.
        """
        directory = 'dirname'
        file = 'filename'
        content = 'bytes'
        createSubversionRepository(self.repository,
                                   {directory: {
                                       file: content
                                   }}, False, self.runCommand)

        repo = self.repository.path
        wc = self.workingCopy.path
        self.assertEqual(self.commands, [
            ("svnadmin create " + repo, None),
            ("svn co file://" + repo + " " + wc, None),
            ("svn add " + self.workingCopy.child(directory).path,
             [self.workingCopy.child(directory)]),
            ("svn add " + self.workingCopy.child(directory).child(file).path, [
                self.workingCopy.child(directory),
                self.workingCopy.child(directory).child(file)
            ]),
            ("svn commit -m 'Create specified files' " + self.workingCopy.path,
             [
                 self.workingCopy.child(directory),
                 self.workingCopy.child(directory).child(file)
             ])
        ])
Exemplo n.º 2
0
    def test_directoryContainingFile(self):
        """
        For a key associated with a value of a C{dict} with a key associated
        with a value of a C{str}, L{createSubversionRepository} should create a
        directory containing a file with the specified string as its content.
        """
        directory = 'dirname'
        file = 'filename'
        content = 'bytes'
        createSubversionRepository(
            self.repository,
            {directory: {file: content}},
            False,
            self.runCommand)

        repo = self.repository.path
        wc = self.workingCopy.path
        self.assertEqual(
            self.commands,
            [("svnadmin create " + repo, None),
             ("svn co file://" + repo + " " + wc, None),
             ("svn add " + self.workingCopy.child(directory).path,
              [self.workingCopy.child(directory)]),
             ("svn add " + self.workingCopy.child(directory).child(file).path,
              [self.workingCopy.child(directory),
               self.workingCopy.child(directory).child(file)]),
             ("svn commit -m 'Create specified files' " + self.workingCopy.path,
              [self.workingCopy.child(directory),
               self.workingCopy.child(directory).child(file)])])
Exemplo n.º 3
0
 def createRepository(self, projectName, contents):
     """
     Create a new SVN repository with the given contents and associate it
     with given project.
     """
     path = self.repositories.child(projectName)
     path.makedirs()
     createSubversionRepository(path, contents)
Exemplo n.º 4
0
 def createRepository(self, projectName, contents):
     """
     Create a new SVN repository with the given contents and associate it
     with given project.
     """
     path = self.repositories.child(projectName)
     path.makedirs()
     createSubversionRepository(path, contents)
Exemplo n.º 5
0
 def test_emptyRepository(self):
     """
     L{createSubversionRepository} should create a repository with no
     entries or revisions if it is passed an empty dictionary.
     """
     createSubversionRepository(self.repository, {}, False, self.commands.append)
     self.assertEqual(
         self.commands,
         ["svnadmin create " + self.repository.path])
Exemplo n.º 6
0
 def test_emptyRepository(self):
     """
     L{createSubversionRepository} should create a repository with no
     entries or revisions if it is passed an empty dictionary.
     """
     createSubversionRepository(self.repository, {}, False,
                                self.commands.append)
     self.assertEqual(self.commands,
                      ["svnadmin create " + self.repository.path])
Exemplo n.º 7
0
 def setUp(self):
     """
     Compute the path and URL to a subversion repository which can be
     tested against and set up standard out to be recorded and hidden.
     """
     self.repository = FilePath(self.mktemp())
     createSubversionRepository(self.repository, {'foo': {}})
     self.url = 'file://' + self.repository.path
     self.stdout = sys.stdout
     sys.stdout = StringIO.StringIO()
Exemplo n.º 8
0
 def test_workingCopyRemoved(self):
     """
     The temporary working copy should be deleted after
     L{createSubversionRepository} is finished using it to populate the
     repository if C{True} is passed for the I{cleanup} parameter.
     """
     createSubversionRepository(
         self.repository, {'file': 'bytes'}, True, self.runCommand)
     self.workingCopy.restat(False)
     self.assertFalse(self.workingCopy.exists())
Exemplo n.º 9
0
 def setUp(self):
     """
     Compute the path and URL to a subversion repository which can be
     tested against and set up standard out to be recorded and hidden.
     """
     self.repository = FilePath(self.mktemp())
     createSubversionRepository(self.repository, {'foo': {}})
     self.url = 'file://' + self.repository.path
     self.stdout = sys.stdout
     sys.stdout = StringIO.StringIO()
Exemplo n.º 10
0
 def test_workingCopyRemoved(self):
     """
     The temporary working copy should be deleted after
     L{createSubversionRepository} is finished using it to populate the
     repository if C{True} is passed for the I{cleanup} parameter.
     """
     createSubversionRepository(self.repository, {'file': 'bytes'}, True,
                                self.runCommand)
     self.workingCopy.restat(False)
     self.assertFalse(self.workingCopy.exists())
Exemplo n.º 11
0
    def _fileTest(self, entry, contents):
        """
        """
        createSubversionRepository(
            self.repository, {entry: contents}, False, self.runCommand)

        repo = self.repository.path
        wc = self.workingCopy.path
        self.assertEqual(
            self.commands,
            [("svnadmin create " + repo, None),
             ("svn co file://" + repo + " " + wc, None),
             ("svn add " + self.workingCopy.child(entry).path,
              [self.workingCopy.child(entry)]),
             ("svn commit -m 'Create specified files' " + self.workingCopy.path,
              [self.workingCopy.child(entry)])])
Exemplo n.º 12
0
    def _fileTest(self, entry, contents):
        """
        """
        createSubversionRepository(self.repository, {entry: contents}, False,
                                   self.runCommand)

        repo = self.repository.path
        wc = self.workingCopy.path
        self.assertEqual(self.commands, [
            ("svnadmin create " + repo, None),
            ("svn co file://" + repo + " " + wc, None),
            ("svn add " + self.workingCopy.child(entry).path,
             [self.workingCopy.child(entry)]),
            ("svn commit -m 'Create specified files' " + self.workingCopy.path,
             [self.workingCopy.child(entry)])
        ])