def test_mixins_dynamic(self): """https://gist.github.com/chriseppstein/674726#mixins-with-arguments--dynamic-mixins""" # NOQA less = """.bordered(@width: 2px) { border: @width solid black; } #menu a { .bordered(4px); }""" sass = """@mixin bordered($width: 2px) { border: $width solid black; } #menu a { @include bordered(4px); }""" less_conv_ = less2sass.replace_identifiers(less) # as there are id's less_conv = less2sass.replace_mixins(less_conv_) self.assertEqual(sass, less_conv)
def test_mixins(self): """https://gist.github.com/chriseppstein/674726#mixins""" less = """.bordered { border-top: dotted 1px black; border-bottom: solid 2px black; } #menu a { .bordered; }""" sass = """@mixin bordered { border-top: dotted 1px black; border-bottom: solid 2px black; } #menu a { @include bordered; }""" less_conv_ = less2sass.replace_identifiers(less) less_conv = less2sass.replace_mixins(less_conv_) self.assertEqual(sass, less_conv)