From cc9b7c28cfe18d90d392a3651d548b17fbdbe8d9 Mon Sep 17 00:00:00 2001 From: William Ting Date: Tue, 31 Dec 2013 17:15:25 -0600 Subject: [PATCH] add travis config --- .travis.yml | 10 ++++++++++ tests/autojump_utils_test.py | 11 ++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..498f9fc --- /dev/null +++ b/.travis.yml @@ -0,0 +1,10 @@ +language: python + +python: + - 2.7 + +install: + - pip install --use-mirrors testify + +script: + - testify -v tests diff --git a/tests/autojump_utils_test.py b/tests/autojump_utils_test.py index 9ffd4c8..77beabe 100644 --- a/tests/autojump_utils_test.py +++ b/tests/autojump_utils_test.py @@ -1,13 +1,18 @@ #!/usr/bin/env python2 # -*- coding: utf-8 -*- +import os + import mock from testify import TestCase from testify import assert_equal +from testify import assert_false +from testify import assert_true from testify import run import autojump_utils from autojump_utils import decode from autojump_utils import first +from autojump_utils import in_bash from autojump_utils import last from autojump_utils import sanitize from autojump_utils import second @@ -55,7 +60,11 @@ class IterationTestCase(TestCase): class EnvironmentalVariableTestCase(TestCase): - pass + def test_in_bash(self): + os.environ['SHELL'] = '/bin/bash' + assert_true(in_bash()) + os.environ['SHELL'] = '/usr/bin/zsh' + assert_false(in_bash()) if __name__ == "__main__":