tabbed DNC card, machine-numbered downloads, themed backup history

This commit is contained in:
2026-08-07 15:22:59 -04:00
parent 2487981d91
commit 3ebc1f353a
9 changed files with 233 additions and 50 deletions

View File

@@ -526,7 +526,13 @@ DNCINFOREG = (
def _headings(card):
return [f['label'] for f in card['fields'] if f.get('heading')]
"""Section labels of the DNC Info card (tabs renderer shape)."""
return [s['label'] for s in card['sections']]
def _labels(card):
"""Every field label across all sections."""
return [f['label'] for s in card['sections'] for f in s['fields']]
def test_dncinfo_shows_efocas_and_serial():
@@ -563,15 +569,14 @@ def test_dncinfo_shows_mark_when_the_asset_is_a_part_marker(monkeypatch):
def test_dncinfo_drops_empty_values_within_a_shown_section():
populated = DNCINFOREG.replace('"ShrHost"=""', '"ShrHost"="WJFMS3"')
card = dncinfo.build(ntlars.parse(_asbytes(populated)), assetid=0)
labels = [f['label'] for f in card['fields'] if not f.get('heading')]
assert 'ShrHost' in labels
assert 'ShrFolder' not in labels
assert 'ShrHost' in _labels(card)
assert 'ShrFolder' not in _labels(card)
def test_dncinfo_is_empty_for_a_projection_with_nothing_interesting():
card = dncinfo.build(ntlars.parse(_asbytes(CONFIGUREDREG)), assetid=0)
assert card['sectioncount'] == 0
assert card['fields'] == []
assert card['sections'] == []
def test_ispartmarker_is_false_when_the_machines_plugin_is_absent(monkeypatch):
@@ -606,8 +611,7 @@ def test_base_kind_buildinfo_is_an_empty_card():
def test_dncinfo_general_section_leads_with_controller_identity():
card = dncinfo.build(ntlars.parse(_asbytes(DNCINFOREG)), assetid=0)
assert _headings(card)[0] == 'General'
labels = [f['label'] for f in card['fields'] if not f.get('heading')]
assert 'Cnc' in labels and 'HostType' in labels
assert 'Cnc' in _labels(card) and 'HostType' in _labels(card)
def test_dncinfo_general_omits_the_rest_of_the_key():
@@ -615,8 +619,7 @@ def test_dncinfo_general_omits_the_rest_of_the_key():
reg = DNCINFOREG.replace('"MachineNo"="3204"',
'"MachineNo"="3204"\r\n"Debug"="NO"\r\n"Site"="WJ"')
card = dncinfo.build(ntlars.parse(_asbytes(reg)), assetid=0)
labels = [f['label'] for f in card['fields'] if not f.get('heading')]
assert 'Debug' not in labels and 'Site' not in labels
assert 'Debug' not in _labels(card) and 'Site' not in _labels(card)
def test_cnc_marker_reveals_the_mark_section_without_shopdb():