本文整理汇总了Python中blowdrycss.breakpointparser.BreakpointParser.set_breakpoint_key方法的典型用法代码示例。如果您正苦于以下问题:Python BreakpointParser.set_breakpoint_key方法的具体用法?Python BreakpointParser.set_breakpoint_key怎么用?Python BreakpointParser.set_breakpoint_key使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类blowdrycss.breakpointparser.BreakpointParser
的用法示例。
在下文中一共展示了BreakpointParser.set_breakpoint_key方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_set_breakpoint_key
# 需要导入模块: from blowdrycss.breakpointparser import BreakpointParser [as 别名]
# 或者: from blowdrycss.breakpointparser.BreakpointParser import set_breakpoint_key [as 别名]
def test_set_breakpoint_key(self):
valid_css_classes = [
'inline-small-up', 'inline-giant-down-i', 'green-xxsmall-only', 'padding-10-large-up', 'xsmall-down',
'medium-only', 'giant-up', 'giant-only-i', 'display-large-down',
]
names = ['display', 'display', 'color', 'padding', 'display', 'display', 'display', 'display', 'display', ]
values = ['inherit', 'inherit', 'green', '10', 'inherit', 'inherit', 'inherit', 'inherit', 'inherit', ]
priorities = ['', 'important', '', '', '', '', '', 'important', '']
expected = ['-small', '-giant', '-xxsmall', '-large', '-xsmall', '-medium', '-giant', '-giant', '-large', ]
for i, css_class in enumerate(valid_css_classes):
css_property = Property(name=names[i], value=values[i], priority=priorities[i])
breakpoint_parser = BreakpointParser(css_class=css_class, css_property=css_property)
breakpoint_parser.set_breakpoint_key()
self.assertEqual(breakpoint_parser.breakpoint_key, expected[i])