GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 311a8a...77b25a )
by Gonzalo
10s
created

tests.test_functions   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 25
dl 0
loc 46
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A TestQLinearGradientFunc.test_rgba() 0 4 1
A TestRgbaFunc.test_rgba() 0 4 1
A TestQLinearGradientFunc.test_color() 0 4 1
A BaseCompileTest.compile_scss() 0 5 1
1
# -*- coding: utf-8 -*-
2
# -----------------------------------------------------------------------------
3
# Copyright (c) 2015 Yann Lanthony
4
# Copyright (c) 2017-2018 Spyder Project Contributors
5
#
6
# Licensed under the terms of the MIT License
7
# (See LICENSE.txt for details)
8
# -----------------------------------------------------------------------------
9
"""Test qtsass conformers."""
10
11
# Standard library imports
12
from __future__ import absolute_import
13
import unittest
14
from textwrap import dedent
15
import sass
16
17
# Local imports
18
from qtsass.api import compile
19
20
class BaseCompileTest(unittest.TestCase):
21
    def compile_scss(self, str):
22
        # NOTE: revise for better future compatibility
23
        wstr = '*{{t: {0};}}'.format(str)
24
        res = compile(wstr)
25
        return res.replace('* {\n  t: ', '').replace('; }\n', '')
26
27
class TestRgbaFunc(BaseCompileTest):
28
    def test_rgba(self):
29
        self.assertEqual(
30
            self.compile_scss('rgba(0, 1, 2, 0.3)'),
31
            'rgba(0, 1, 2, 30%)'
32
        )
33
34
class TestQLinearGradientFunc(BaseCompileTest):
35
    def test_color(self):
36
        self.assertEqual(
37
            self.compile_scss('qlineargradient(1, 2, 3, 4, (0 red, 1 blue))'),
38
            'qlineargradient(x1: 1.0, y1: 2.0, x2: 3.0, y2: 4.0, '
39
            'stop: 0.0 rgba(255, 0, 0, 100%), stop: 1.0 rgba(0, 0, 255, 100%))'
40
        )
41
42
    def test_rgba(self):
43
        self.assertEqual(
44
            self.compile_scss('qlineargradient(1, 2, 3, 4, (0 red, 0.2 rgba(5, 6, 7, 0.8)))'),
45
            'qlineargradient(x1: 1.0, y1: 2.0, x2: 3.0, y2: 4.0, '
46
            'stop: 0.0 rgba(255, 0, 0, 100%), stop: 0.2 rgba(5, 6, 7, 80%))'
47
        )
48