Coverage for src/lektor_ng/types/fake.py: 68%
22 statements
« prev ^ index » next coverage.py v7.15.2, created at 2026-09-05 14:56 +0000
« prev ^ index » next coverage.py v7.15.2, created at 2026-09-05 14:56 +0000
1from lektor_ng.constants import PRIMARY_ALT
2from lektor_ng.i18n import get_i18n_block
3from lektor_ng.types.base import Type
6class FakeType(Type):
7 def value_from_raw(self, raw):
8 return None
10 def to_json(self, pad, record=None, alt=PRIMARY_ALT):
11 rv = Type.to_json(self, pad, record, alt)
12 rv["is_fake_type"] = True
13 return rv
16class LineType(FakeType):
17 widget = "f-line"
20class SpacingType(FakeType):
21 widget = "f-spacing"
24class InfoType(FakeType):
25 widget = "f-info"
28class HeadingType(FakeType):
29 widget = "f-heading"
31 def to_json(self, pad, record=None, alt=PRIMARY_ALT):
32 rv = FakeType.to_json(self, pad, record, alt)
33 rv["heading_i18n"] = get_i18n_block(self.options, "heading")
34 return rv