OLD | NEW |
| (Empty) |
1 import unittest | |
2 | |
3 from scss.parser import Stylesheet | |
4 | |
5 | |
6 class TestSCSS( unittest.TestCase ): | |
7 | |
8 def setUp(self): | |
9 self.parser = Stylesheet(options=dict(compress=True)) | |
10 | |
11 def test_extend(self): | |
12 src = """ | |
13 .error { | |
14 border: 1px #f00; | |
15 background-color: #fdd; | |
16 } | |
17 .error .intrusion { | |
18 background-image: url("/image/hacked.png"); | |
19 } | |
20 .seriousError { | |
21 @extend .error; | |
22 border-width: 3px; | |
23 } | |
24 """ | |
25 test = ".error, .seriousError{border:1px #f00;background-color:#fdd}.err
or .intrusion, .seriousError .intrusion{background-image:url('/image/hacked.png'
)}.seriousError{border-width:3px}" | |
26 out = self.parser.loads(src) | |
27 self.assertEqual(test, out) | |
OLD | NEW |