System tests for `jenkinsapi.jenkins` module.
'''
import os
+import re
import time
import gzip
import shutil
text_artifact.save_to_dir(tempDir)
readBackText = open(os.path.join(
tempDir, text_artifact.filename), 'rb').read().strip()
- self.assertTrue(readBackText.startswith('PING localhost'))
+ self.assertTrue(re.match(r'^PING \S+ \(127.0.0.1\)', readBackText))
self.assertTrue(readBackText.endswith('ms'))
# Verify that we can hande binary artifacts
tempDir,
binary_artifact.filename,
), 'rb' ).read().strip()
- self.assertTrue(readBackText.startswith('PING localhost'))
+ self.assertTrue(re.match(r'^PING \S+ \(127.0.0.1\)', readBackText))
self.assertTrue(readBackText.endswith('ms'))
finally:
shutil.rmtree(tempDir)