예제 #1
0
    def test_mediaquery_prefix(self):
        t="""
        :scope {color:green}
        @media (max-width: 700px) {
            button {color:red}
            body {color:green}
        }
        button2 {color:yellow}
        """
        r="""XXX {color:green}
XXX button2 {color:yellow}
@media (max-width: 700px) {XXX button {color:red}\nXXX body {color:green}}"""
        x=vbuild.mkPrefixCss(t,"XXX")
        self.assertEqual(x,r)
예제 #2
0
def test_mediaquery_noprefix():
    t = """
    :scope {color:green}
    @media (max-width: 700px) {
        button {color:red}
        body {color:green}
    }
    button2 {color:yellow}
    """
    r = """:scope {color:green}
button2 {color:yellow}
@media (max-width: 700px) {button {color:red}
body {color:green}}"""
    x = vbuild.mkPrefixCss(t)
    assert x == r
예제 #3
0
    def test_cssTop(self):
        t = """
:scope
    {padding:4px;background: yellow}

      button[ name  ] {\t\tbackground:red /*que neni*/
}
   hr *,        body:hover {
    color:red;}

p > a, p>i { /*nib*/ }

"""
        ok = """
XXX {padding:4px;background: yellow}
XXX button[ name ] { background:red }
XXX hr *, XXX body:hover { color:red;}
XXX p > a, XXX p>i { }
"""
        tt = vbuild.mkPrefixCss(t, "XXX")
        self.assertEqual(tt, ok.strip())
예제 #4
0
 def test_css2(self):
     self.assertEqual(vbuild.mkPrefixCss("   a    {color}  "), "a {color}")
     self.assertEqual(vbuild.mkPrefixCss("   a    {color}  ", "XXX"),
                      "XXX a {color}")
예제 #5
0
 def test_css1(self):
     self.assertEqual(vbuild.mkPrefixCss("", "XXX"), "")
예제 #6
0
def test_css2():
    assert vbuild.mkPrefixCss("   a    {color}  ") == "a {color}"
    assert vbuild.mkPrefixCss("   a    {color}  ", "XXX") == "XXX a {color}"
예제 #7
0
def test_css1():
    assert vbuild.mkPrefixCss("", "XXX") == ""