MCPcopy
hub / github.com/jumpserver/jumpserver / test_it

Method test_it

apps/assets/utils/node.py:127–142  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

125
126 @classmethod
127 def test_it(cls):
128 from assets.models import Node, Asset
129
130 nodes = list(Node.objects.all())
131 nodes_assets = Asset.nodes.through.objects.all() \
132 .annotate(aid=F('asset_id')) \
133 .values_list('node__key', 'aid')
134
135 mapping = defaultdict(set)
136 for key, asset_id in nodes_assets:
137 asset_id = str(asset_id)
138 mapping[key].add(asset_id)
139
140 util = cls(nodes, mapping)
141 util.generate()
142 return util

Callers

nothing calls this directly

Calls 4

addMethod · 0.80
FFunction · 0.50
allMethod · 0.45
generateMethod · 0.45

Tested by

no test coverage detected