From dbc655a30c7da9dd45a47b7ded3cc88d6345cb32 Mon Sep 17 00:00:00 2001 From: dylan araps Date: Mon, 11 Sep 2017 08:43:02 +1000 Subject: travis: Add macOS testing --- .travis.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1c9b3d8..efa3271 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,9 +3,15 @@ python: - "3.5" - "3.6" +os: + - "linux" + - "osx" + before_install: - - sudo apt-get -qq update - - sudo apt-get install -y imagemagick + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install imagemagick; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; sudo apt-get -qq update; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; sudo apt-get install -y imagemagick; fi install: - pip install flake8 pylint -- cgit v1.2.3 From 7e8f7c2620be08664685550936da8eace1a7cbad Mon Sep 17 00:00:00 2001 From: dylan araps Date: Mon, 11 Sep 2017 08:46:00 +1000 Subject: travis: Add macOS testing --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index efa3271..d136a5f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,10 +8,10 @@ os: - "osx" before_install: - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install imagemagick; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; sudo apt-get -qq update; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; sudo apt-get install -y imagemagick; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo brew update; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo brew install imagemagick; fi + - 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 -- cgit v1.2.3 From 50c6ba020572f438aa608035224cc3de73f0e2ee Mon Sep 17 00:00:00 2001 From: dylan araps Date: Tue, 12 Sep 2017 08:40:22 +1000 Subject: travis: Fix macOS --- .travis.yml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index d136a5f..2ec3221 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,22 @@ language: python -python: - - "3.5" - - "3.6" -os: - - "linux" - - "osx" +matrix: + include: + - os: osx + language: generic + before_install: + - brew update + - brew install imagemagick + - brew install python3 + - virtualenv env -p python3 + - source env/bin/activate + - os: linux + python: 3.5 + - os: linux + python: 3.6 + before_install: - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo brew update; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo brew install imagemagick; fi - 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 -- cgit v1.2.3 From 93ea9b519e0c741e937f3374adce7e1939614099 Mon Sep 17 00:00:00 2001 From: dylan araps Date: Tue, 12 Sep 2017 08:46:03 +1000 Subject: travis: Fix macOS --- .travis.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2ec3221..07b67cc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,11 +5,9 @@ matrix: - os: osx language: generic before_install: - - brew update - brew install imagemagick - brew install python3 - - virtualenv env -p python3 - - source env/bin/activate + - brew link --overwite python3 - os: linux python: 3.5 - os: linux -- cgit v1.2.3 From c913a023add0a42f1ae004943571e7e34ddac30f Mon Sep 17 00:00:00 2001 From: Matthew Leonberger Date: Sun, 24 Sep 2017 16:28:52 +0900 Subject: Remove sequence order tests per Issue #102 --- tests/test_sequences.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tests/test_sequences.py b/tests/test_sequences.py index 8034da7..72f16b7 100755 --- a/tests/test_sequences.py +++ b/tests/test_sequences.py @@ -34,13 +34,5 @@ class Testsequences(unittest.TestCase): result = sequences.set_iterm_tab_color(COLORS["special"]["background"]) self.assertEqual(len(result), 104) - def test_sequence_order(self): - """> Test that the sequences are in order.""" - result = sequences.create_sequences(COLORS, vte=False).split("\007") - self.assertEqual(result[2], "\x1b]4;2;#CC6A93") - self.assertEqual(result[15], "\x1b]4;15;#F5F1F4") - self.assertEqual(result[8], "\x1b]4;8;#666666") - - if __name__ == "__main__": unittest.main() -- cgit v1.2.3 From b2320013e737ed9048b3946cdfee4f2ee113d62d Mon Sep 17 00:00:00 2001 From: Matthew Leonberger Date: Sun, 24 Sep 2017 16:33:15 +0900 Subject: pylint and flake8 need to be in before_install --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 07b67cc..1c54379 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,11 +15,12 @@ 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 -- cgit v1.2.3 From a56019761246857ede1a0e702324ad0274ff001f Mon Sep 17 00:00:00 2001 From: Matthew Leonberger Date: Sun, 24 Sep 2017 16:48:02 +0900 Subject: 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. --- .travis.yml | 5 ++--- tests/test_sequences.py | 17 ++++++++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1c54379..07b67cc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/tests/test_sequences.py b/tests/test_sequences.py index 72f16b7..6488298 100755 --- a/tests/test_sequences.py +++ b/tests/test_sequences.py @@ -1,5 +1,6 @@ """Test sequence functions.""" import unittest +import platform from pywal import sequences from pywal import util @@ -16,23 +17,33 @@ class Testsequences(unittest.TestCase): """> Create special escape sequence.""" util.Color.alpha_num = 100 result = sequences.set_special(11, COLORS["special"]["background"]) - self.assertEqual(result, "\033]11;#1F211E\007") + 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"]) - self.assertEqual(result, "\033]11;[99]#1F211E\007") + 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"]) - self.assertEqual(result, "\033]4;11;#1F211E\007") + 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): """> Create iterm tab color sequences""" result = sequences.set_iterm_tab_color(COLORS["special"]["background"]) self.assertEqual(len(result), 104) + if __name__ == "__main__": unittest.main() -- cgit v1.2.3 From 8020f9f214aa1c568eaaa8a6545ccebacb5cd836 Mon Sep 17 00:00:00 2001 From: Matthew Leonberger Date: Sun, 24 Sep 2017 17:18:06 +0900 Subject: All OS tests currenly passing on travis --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 07b67cc..c4bf594 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ matrix: - brew install imagemagick - brew install python3 - brew link --overwite python3 + - pip3 install flake8 pylint - os: linux python: 3.5 - os: linux -- cgit v1.2.3 From d56bcf2002cb7316ad18ec8ac8a3209f2b51416a Mon Sep 17 00:00:00 2001 From: dylan araps Date: Mon, 25 Sep 2017 08:51:24 +1000 Subject: travis: Fix macos builds --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 07b67cc..97204bc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,8 @@ matrix: before_install: - brew install imagemagick - brew install python3 - - brew link --overwite python3 + - virtualenv env -p python3 + - source env/bin/activate - os: linux python: 3.5 - os: linux -- cgit v1.2.3 From 91e48e19bca3cf46f6e403a320638246b3d1b215 Mon Sep 17 00:00:00 2001 From: Matthew Leonberger Date: Tue, 26 Sep 2017 08:58:44 +0900 Subject: Fix MacOS Unittests Tests now check which OS we are on and use the appropriate escapes Merge remote-tracking branch 'origin/hotfix/unittests' into hotfix/unittests --- .travis.yml | 4 ++-- tests/test_sequences.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index c4bf594..97204bc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,8 @@ matrix: before_install: - brew install imagemagick - brew install python3 - - brew link --overwite python3 - - pip3 install flake8 pylint + - virtualenv env -p python3 + - source env/bin/activate - os: linux python: 3.5 - os: linux diff --git a/tests/test_sequences.py b/tests/test_sequences.py index 6488298..2a993f5 100755 --- a/tests/test_sequences.py +++ b/tests/test_sequences.py @@ -5,7 +5,6 @@ import platform from pywal import sequences from pywal import util - # Import colors. COLORS = util.read_file_json("tests/test_files/test_file.json") @@ -17,6 +16,7 @@ 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: @@ -26,6 +26,7 @@ class Testsequences(unittest.TestCase): """> 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: @@ -34,6 +35,7 @@ class Testsequences(unittest.TestCase): 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: -- cgit v1.2.3