naive_timestamp = datetime.datetime(*time.gmtime(self._data['timestamp']/1000.0)[:6])
return pytz.utc.localize(naive_timestamp)
+ def get_console(self):
+ """
+ Return the current state of the text console.
+ """
+ url = "%s/consoleText" % self.baseurl
+ return self.job.jenkins.requester.get_url(url).content
+
def stop(self):
"""
Stops the build execution if it's running
</hudson.tasks.Fingerprinter>
</publishers>
<buildWrappers/>
-</project>""".strip()
\ No newline at end of file
+</project>""".strip()
self.assertIsInstance(b, Build)
ii.stop()
self.assertFalse(ii.is_running())
+ self.assertIsInstance(ii.get_build().get_console(), str)
+ self.assertIn('Building on master', ii.get_build().get_console())
def test_get_block_until_build_complete(self):
job_name = 'create_%s' % random_string()
artB = artifacts['b.txt']
self.assertTrue(artB.get_data().strip(), param_B)
+ self.assertIn(param_B, b.get_console())
+
if __name__ == '__main__':
unittest.main()