Commit 55924bea authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_erp5: Add admin script to check test coverage in a dummy way

This is just a help script to check if Skins are supposed to in the test files
parent 548b3a17
import hashlib
portal = context.getPortalObject()
content_dict = {}
for test_component in portal.portal_components.searchFolder(portal_type='Test Component'):
if "Slap" not in test_component.getId():
continue
content_dict[test_component.getId()] = test_component.getTextContent()
print len(content_dict)
for skin_folder in portal.portal_skins.objectValues('Folder'):
if not skin_folder.getId().startswith("slapos"):
continue
for skin in skin_folder.objectValues():
if skin.getId().startswith("Alarm_"):
continue
if skin.meta_type in ('Script (Python)', 'Z SQL Method', ):
found = 0
for _, content in content_dict.iteritems():
if skin.getId() in content:
found = 1
break
if not found:
print "%s/%s" % (skin_folder.getId(), skin.getId())
container.REQUEST.RESPONSE.setHeader('content-type', 'text/plain')
return '\n'.join(sorted(printed.splitlines()))
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_testPythonScriptTestCoverage</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment