Beispiel #1
0
 def test_whbranchOneArgument(self):
     """
     L{whbranchMain} prints the current branch for each known project if
     called with one argument.
     """
     self.manager.repositories["Quux"] = {"trunk": {}}
     self.manager.repositories["Quarj"] = {"trunk": {},
                                           "branches":
                                               {"foo": {}}}
     self.manager.changeProjectBranch("Quux", "trunk", ("Quux", "trunk"))
     self.manager.changeProjectBranch("Quarj", "trunk", ("Quarj", "trunk"))
     self.manager.changeProjectBranch("Quarj", "foo")
     whbranchMain(["/bin/whbranch"])
     self.assertEqual(
         set(sys.stdout.getvalue().splitlines()),
         set(["Quux: trunk", "Quarj: foo"]))
Beispiel #2
0
 def test_whbranchTwoArguments(self):
     """
     L{whbranchMain} prints the current branch for the named project if
     called with two arguments.
     """
     self.manager.repositories["Quux"] = {"trunk": {}}
     self.manager.repositories["Quarj"] = {"trunk": {},
                                           "branches":
                                               {"foo": {}}}
     self.manager.changeProjectBranch("Quux", "trunk", ("Quux", "trunk"))
     self.manager.changeProjectBranch("Quarj", "trunk", ("Quarj", "trunk"))
     self.manager.changeProjectBranch("Quarj", "foo")
     whbranchMain(["/bin/mkbranch", "Quux"])
     self.assertEqual(sys.stdout.getvalue(), "trunk\n")
     sys.stdout.truncate(0)
     whbranchMain(["/bin/mkbranch", "Quarj"])
     self.assertEqual(sys.stdout.getvalue(), "foo\n")
Beispiel #3
0
 def test_whbranchOneArgument(self):
     """
     L{whbranchMain} prints the current branch for each known project if
     called with one argument.
     """
     self.manager.repositories["Quux"] = {"trunk": {}}
     self.manager.repositories["Quarj"] = {
         "trunk": {},
         "branches": {
             "foo": {}
         }
     }
     self.manager.changeProjectBranch("Quux", "trunk", ("Quux", "trunk"))
     self.manager.changeProjectBranch("Quarj", "trunk", ("Quarj", "trunk"))
     self.manager.changeProjectBranch("Quarj", "foo")
     whbranchMain(["/bin/whbranch"])
     self.assertEqual(set(sys.stdout.getvalue().splitlines()),
                      set(["Quux: trunk", "Quarj: foo"]))
Beispiel #4
0
 def test_whbranchTwoArguments(self):
     """
     L{whbranchMain} prints the current branch for the named project if
     called with two arguments.
     """
     self.manager.repositories["Quux"] = {"trunk": {}}
     self.manager.repositories["Quarj"] = {
         "trunk": {},
         "branches": {
             "foo": {}
         }
     }
     self.manager.changeProjectBranch("Quux", "trunk", ("Quux", "trunk"))
     self.manager.changeProjectBranch("Quarj", "trunk", ("Quarj", "trunk"))
     self.manager.changeProjectBranch("Quarj", "foo")
     whbranchMain(["/bin/mkbranch", "Quux"])
     self.assertEqual(sys.stdout.getvalue(), "trunk\n")
     sys.stdout.truncate(0)
     whbranchMain(["/bin/mkbranch", "Quarj"])
     self.assertEqual(sys.stdout.getvalue(), "foo\n")