summaryrefslogtreecommitdiff
path: root/test/git/test_utils.py
blob: 2147e4cb4d6ae7bc9bd427c0df70e23f1cd6210e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import os
from gitalicious.test.asserts import *
from gitalicious.lib import *
from gitalicious.test.helper import *

class TestUtils(object):
    def setup(self):
        base = os.path.join(os.path.dirname(__file__), "../.."),
        self.git = Git(base)
        self.git_bin_base = "%s --git-dir='%s'" % (Git.git_binary, base)

    def test_it_escapes_single_quotes_with_shell_escape(self):
        assert_equal("\\\\'foo", shell_escape("'foo"))

    def test_it_should_dashify(self):
        assert_equal('this-is-my-argument', dashify('this_is_my_argument'))
        assert_equal('foo', dashify('foo'))