예제 #1
0
 def test_cl_description_with_empty_environ(self):
     host = MockHost()
     host.executive = MockExecutive2(output="Last commit message\n")
     updater = DepsUpdater(host)
     description = updater._cl_description()
     self.assertEqual(description, ("Last commit message\n" "[email protected]\n" "NOEXPORT=true"))
     self.assertEqual(host.executive.calls, [["git", "log", "-1", "--format=%B"]])
예제 #2
0
 def test_cl_description_with_empty_environ(self):
     host = MockHost()
     host.executive = MockExecutive2(output='Last commit message\n')
     updater = DepsUpdater(host)
     description = updater._cl_description()
     self.assertEqual(description, ('Last commit message\n'
                                    '[email protected]'))
     self.assertEqual(host.executive.calls,
                      [['git', 'log', '-1', '--format=%B']])
예제 #3
0
 def test_cl_description_with_environ_variables(self):
     host = MockHost()
     host.executive = MockExecutive2(output='Last commit message\n')
     updater = DepsUpdater(host)
     updater.host.environ['BUILDBOT_MASTERNAME'] = 'my.master'
     updater.host.environ['BUILDBOT_BUILDERNAME'] = 'b'
     updater.host.environ['BUILDBOT_BUILDNUMBER'] = '123'
     description = updater._cl_description()
     self.assertEqual(description, (
         'Last commit message\n'
         'Build: https://build.chromium.org/p/my.master/builders/b/builds/123\n\n'
         '[email protected]'))
     self.assertEqual(host.executive.calls,
                      [['git', 'log', '-1', '--format=%B']])
예제 #4
0
 def test_cl_description_with_environ_variables(self):
     host = MockHost()
     host.executive = MockExecutive2(output="Last commit message\n")
     updater = DepsUpdater(host)
     updater.host.environ["BUILDBOT_MASTERNAME"] = "my.master"
     updater.host.environ["BUILDBOT_BUILDERNAME"] = "b"
     updater.host.environ["BUILDBOT_BUILDNUMBER"] = "123"
     description = updater._cl_description()
     self.assertEqual(
         description,
         (
             "Last commit message\n"
             "Build: https://build.chromium.org/p/my.master/builders/b/builds/123\n\n"
             "[email protected]\n"
             "NOEXPORT=true"
         ),
     )
     self.assertEqual(host.executive.calls, [["git", "log", "-1", "--format=%B"]])