diff options
author | fboudra@gmail.com <> | 2012-08-03 13:38:06 +0300 |
---|---|---|
committer | fboudra@gmail.com <> | 2012-08-03 13:38:06 +0300 |
commit | 01d9d32f4f4d49e2433ad81d9807ac6a3f172911 (patch) | |
tree | f350e921b59698166ea02230a0287f5b7510af16 /tests | |
parent | 6ce3972bf7c5ebbe5dc27713ffa4fec5d1a50717 (diff) |
Add openembedded job type tp publish sources and sstate-cache (LP: #1032134)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_publish_to_snapshots.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/test_publish_to_snapshots.py b/tests/test_publish_to_snapshots.py index d7953c2..e5011fd 100644 --- a/tests/test_publish_to_snapshots.py +++ b/tests/test_publish_to_snapshots.py @@ -66,6 +66,9 @@ class TestSnapshotsPublisher(TestCase): ['-t', 'ubuntu-sysroots', '-j', 'dummy_job_name', '-n', '1']) self.publisher.validate_args(param) param = self.parser.parse_args( + ['-t', 'openembedded', '-j', 'dummy_job_name', '-n', '1']) + self.publisher.validate_args(param) + param = self.parser.parse_args( ['-t', 'binaries', '-j', 'dummy_job_name', '-n', '1']) self.publisher.validate_args(param) @@ -353,6 +356,33 @@ class TestSnapshotsPublisher(TestCase): stdout.seek(0) self.assertIn("Moved the files from", stdout.read()) + def test_move_artifacts_openembedded_successful_move(self): + orig_stdout = sys.stdout + stdout = sys.stdout = StringIO() + self.publisher = SnapshotsPublisher() + param = self.parser.parse_args(['-t', 'openembedded', + '-j', 'sources', + '-n', '1']) + self.publisher.validate_args(param) + build_path = os.path.join(self.uploads_path, + param.job_type, + param.job_name) + os.makedirs(build_path) + tempfile.mkstemp(dir=build_path) + try: + uploads_dir_path, target_dir_path = self.publisher.validate_paths( + param, self.uploads_path, self.target_path) + uploads_dir_path = os.path.join(self.orig_dir, uploads_dir_path) + target_dir_path = os.path.join(self.orig_dir, target_dir_path) + self.publisher.move_artifacts(param, uploads_dir_path, + target_dir_path) + finally: + sys.stdout = orig_stdout + pass + + stdout.seek(0) + self.assertIn("Moved the files from", stdout.read()) + def test_move_artifacts_binaries_successful_move(self): orig_stdout = sys.stdout stdout = sys.stdout = StringIO() |