def test_hook_once(self):
     # Calling the hook once records the passed branch identifier in the
     # process title.
     initial_title = self.factory.getUniqueString()
     setproctitle_mod = FakeSetProcTitleModule(initial_title)
     branch_url = self.factory.getUniqueString()
     hook = SetProcTitleHook(setproctitle_mod)
     hook.seen(branch_url)
     self.assertEqual(initial_title + " BRANCH:" + branch_url,
                      setproctitle_mod.getproctitle())
 def test_hook_once(self):
     # Calling the hook once records the passed branch identifier in the
     # process title.
     initial_title = self.factory.getUniqueString()
     setproctitle_mod = FakeSetProcTitleModule(initial_title)
     branch_url = self.factory.getUniqueString()
     hook = SetProcTitleHook(setproctitle_mod)
     hook.seen(branch_url)
     self.assertEqual(
         initial_title + " BRANCH:" + branch_url,
         setproctitle_mod.getproctitle())
 def test_hook_twice(self):
     # Calling the hook twice replaces the first branch identifier in the
     # process title.
     initial_title = self.factory.getUniqueString()
     setproctitle_mod = FakeSetProcTitleModule(initial_title)
     branch_url1 = self.factory.getUniqueString()
     branch_url2 = self.factory.getUniqueString()
     hook = SetProcTitleHook(setproctitle_mod)
     hook.seen(branch_url1)
     hook.seen(branch_url2)
     self.assertEqual(initial_title + " BRANCH:" + branch_url2,
                      setproctitle_mod.getproctitle())
 def test_hook_twice(self):
     # Calling the hook twice replaces the first branch identifier in the
     # process title.
     initial_title = self.factory.getUniqueString()
     setproctitle_mod = FakeSetProcTitleModule(initial_title)
     branch_url1 = self.factory.getUniqueString()
     branch_url2 = self.factory.getUniqueString()
     hook = SetProcTitleHook(setproctitle_mod)
     hook.seen(branch_url1)
     hook.seen(branch_url2)
     self.assertEqual(
         initial_title + " BRANCH:" + branch_url2,
         setproctitle_mod.getproctitle())