mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-06-18 23:56:37 +02:00
Add OS detection for mac specific tests
Merge branch 'macos_test' of https://github.com/linuxunil/pywal into macos_test Revert "pylint and flake8 need to be in before_install" This reverts commit b2320013e737ed9048b3946cdfee4f2ee113d62d.
This commit is contained in:
parent
b2320013e7
commit
a560197612
@ -15,12 +15,11 @@ matrix:
|
||||
|
||||
|
||||
before_install:
|
||||
- pip install flake8 pylint
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get -qq update; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -y imagemagick; fi
|
||||
|
||||
#install:
|
||||
#- pip install flake8 pylint
|
||||
install:
|
||||
- pip install flake8 pylint
|
||||
|
||||
script:
|
||||
- flake8 pywal tests setup.py
|
||||
|
@ -1,5 +1,6 @@
|
||||
"""Test sequence functions."""
|
||||
import unittest
|
||||
import platform
|
||||
|
||||
from pywal import sequences
|
||||
from pywal import util
|
||||
@ -16,17 +17,26 @@ class Testsequences(unittest.TestCase):
|
||||
"""> Create special escape sequence."""
|
||||
util.Color.alpha_num = 100
|
||||
result = sequences.set_special(11, COLORS["special"]["background"])
|
||||
if platform.uname()[0] == "Darwin":
|
||||
self.assertEqual(result, "\033]Ph1F211E\033\\")
|
||||
else:
|
||||
self.assertEqual(result, "\033]11;#1F211E\007")
|
||||
|
||||
def test_set_special_alpha(self):
|
||||
"""> Create special escape sequence with alpha."""
|
||||
util.Color.alpha_num = 99
|
||||
result = sequences.set_special(11, COLORS["special"]["background"])
|
||||
if platform.uname()[0] == "Darwin":
|
||||
self.assertEqual(result, "\033]Ph1F211E\033\\")
|
||||
else:
|
||||
self.assertEqual(result, "\033]11;[99]#1F211E\007")
|
||||
|
||||
def test_set_color(self):
|
||||
"""> Create color escape sequence."""
|
||||
result = sequences.set_color(11, COLORS["colors"]["color0"])
|
||||
if platform.uname()[0] == "Darwin":
|
||||
self.assertEqual(result, "\033]Pb1F211E\033\\")
|
||||
else:
|
||||
self.assertEqual(result, "\033]4;11;#1F211E\007")
|
||||
|
||||
def test_set_iterm_tab_color(self):
|
||||
@ -34,5 +44,6 @@ class Testsequences(unittest.TestCase):
|
||||
result = sequences.set_iterm_tab_color(COLORS["special"]["background"])
|
||||
self.assertEqual(len(result), 104)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
Loading…
x
Reference in New Issue
Block a user