MCPcopy Create free account
hub / github.com/bazelbuild/bazel / testGetTargetConfig

Method testGetTargetConfig

tools/ctexplain/bazel_api_test.py:69–80  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

67 self.assertIn('CppConfiguration', cts2[0].transitive_fragments)
68
69 def testGetTargetConfig(self):
70 self.ScratchFile('testapp/BUILD', [
71 'filegroup(name = "fg", srcs = ["a.file"])',
72 ])
73 cts = self._bazel_api.cquery(['//testapp:fg'])[2]
74 config = self._bazel_api.get_config(cts[0].config_hash)
75 expected_fragments = ['PlatformConfiguration', 'JavaConfiguration']
76 for exp in expected_fragments:
77 self.assertIn(exp, config.fragments.keys())
78 core_options = config.options['CoreOptions']
79 self.assertIsNotNone(core_options)
80 self.assertIn(('stamp', 'false'), core_options.items())
81
82 def testGetHostConfig(self):
83 self.ScratchFile('testapp/BUILD', [

Callers

nothing calls this directly

Calls 5

ScratchFileMethod · 0.80
cqueryMethod · 0.80
get_configMethod · 0.80
keysMethod · 0.80
itemsMethod · 0.80

Tested by

no test coverage detected