api: artifacts: Cleanup legacy code paths
More cleanup of code paths handling legacy inputs that has been
irrelevant since at least April 2020.
BUG=b:223433932
TEST=CQ
Change-Id: I9fba1e95645f00c64614274a53d0fcbc5bd16cf6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/3684160
Tested-by: Alex Klein <saklein@chromium.org>
Auto-Submit: Alex Klein <saklein@chromium.org>
Reviewed-by: Lizzy Presland <zland@google.com>
Commit-Queue: Lizzy Presland <zland@google.com>
diff --git a/api/controller/artifacts_unittest.py b/api/controller/artifacts_unittest.py
index 5c5255c..356af07 100644
--- a/api/controller/artifacts_unittest.py
+++ b/api/controller/artifacts_unittest.py
@@ -439,22 +439,22 @@
def testValidateOnly(self):
"""Quick check that a validate only call does not execute any logic."""
patch = self.PatchObject(artifacts_svc, 'BundleChromeOSConfig')
- artifacts.BundleChromeOSConfig(self.target_request, self.response,
+ artifacts.BundleChromeOSConfig(self.sysroot_request, self.response,
self.validate_only_config)
patch.assert_not_called()
def testMockCall(self):
"""Test that a mock call does not execute logic, returns mocked value."""
patch = self.PatchObject(artifacts_svc, 'BundleChromeOSConfig')
- artifacts.BundleChromeOSConfig(self.target_request, self.response,
+ artifacts.BundleChromeOSConfig(self.sysroot_request, self.response,
self.mock_call_config)
patch.assert_not_called()
self.assertEqual(len(self.response.artifacts), 1)
self.assertEqual(self.response.artifacts[0].path,
os.path.join(self.output_dir, 'config.yaml'))
- def testBundleChromeOSConfigCallWithSysroot(self):
- """Call with a request that sets sysroot."""
+ def testBundleChromeOSConfigSuccess(self):
+ """Test standard success case."""
bundle_chromeos_config = self.PatchObject(
artifacts_svc, 'BundleChromeOSConfig', return_value='config.yaml')
artifacts.BundleChromeOSConfig(self.sysroot_request, self.response,
@@ -466,20 +466,6 @@
self.assertEqual(bundle_chromeos_config.call_args_list,
[mock.call(mock.ANY, self.sysroot, self.output_dir)])
- def testBundleChromeOSConfigCallWithBuildTarget(self):
- """Call with a request that sets build_target."""
- bundle_chromeos_config = self.PatchObject(
- artifacts_svc, 'BundleChromeOSConfig', return_value='config.yaml')
- artifacts.BundleChromeOSConfig(self.target_request, self.response,
- self.api_config)
-
- self.assertEqual(
- [artifact.path for artifact in self.response.artifacts],
- [os.path.join(self.output_dir, 'config.yaml')])
-
- self.assertEqual(bundle_chromeos_config.call_args_list,
- [mock.call(mock.ANY, self.sysroot, self.output_dir)])
-
def testBundleChromeOSConfigNoConfigFound(self):
"""Empty results when the config payload isn't found."""
self.PatchObject(artifacts_svc, 'BundleChromeOSConfig', return_value=None)