add should_upload_results test
@@ -2,6 +2,7 @@ import os
import unittest
from unittest import mock
+from checkov.common.bridgecrew.bc_source import should_upload_results
from checkov.common.bridgecrew.integration_features.features.suppressions_integration import SuppressionsIntegration
from checkov.common.bridgecrew.platform_integration import BcPlatformIntegration
from checkov.common.output.record import Record
@@ -37,6 +38,12 @@ class TestBCApiUrl(unittest.TestCase):
instance.get_id_mapping()
self.assertIsNotNone(instance.ckv_to_bc_id_mapping)
+ def test_should_upload(self):
+ self.assertFalse(should_upload_results('vscode'))
+ self.assertTrue(should_upload_results('cli'))
+ self.assertFalse(should_upload_results('xyz'))
+ self.assertFalse(should_upload_results(None))
+
if __name__ == '__main__':
unittest.main()
