File tree 4 files changed +42
-5
lines changed
4 files changed +42
-5
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,8 @@ RUN apk add --no-cache --update \
9
9
git \
10
10
mercurial \
11
11
php5 \
12
- subversion && \
12
+ subversion \
13
+ && \
13
14
rm -rf /var/cache/apk/*
14
15
15
16
RUN mkdir /code
22
23
git config --global user.email
"[email protected] " && \
23
24
git config --global user.name "root"
24
25
25
- COPY . ./
26
- RUN ./setup.py install
26
+ # COPY . ./
27
+ # RUN ./setup.py install
27
28
28
29
ENV USER root
30
+
31
+ CMD ["nosetests" ]
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ def build_stats():
39
39
env = get_subprocess_env ())
40
40
except OSError :
41
41
# Popen will throw an OSError if svn is not found
42
- return None
42
+ return None , None
43
43
pdata = p .communicate ()
44
44
if p .returncode != 0 or pdata [1 ][:22 ] == b'svn: warning: W155007:' :
45
45
return None , None
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
set -eu
3
3
docker build -t powerline-shell .
4
- docker run --rm -it powerline-shell nosetests " $@ "
4
+ docker run --rm --interactive --tty \
5
+ --volume $PWD :/code \
6
+ powerline-shell " $@ "
Original file line number Diff line number Diff line change
1
+ import tempfile
2
+ import unittest
3
+ import shutil
4
+ import mock
5
+ import sh
6
+ import powerline_shell .segments .svn as svn
7
+ from ..testing_utils import dict_side_effect_fn
8
+
9
+
10
+ class SvnTest (unittest .TestCase ):
11
+
12
+ def setUp (self ):
13
+ self .powerline = mock .MagicMock ()
14
+ self .powerline .segment_conf .side_effect = dict_side_effect_fn ({
15
+ ("vcs" , "show_symbol" ): False ,
16
+ })
17
+
18
+ self .dirname = tempfile .mkdtemp ()
19
+ sh .cd (self .dirname )
20
+ # sh.svn("init", ".")
21
+
22
+ self .segment = svn .Segment (self .powerline , {})
23
+
24
+ def tearDown (self ):
25
+ shutil .rmtree (self .dirname )
26
+
27
+ @mock .patch ("powerline_shell.utils.get_PATH" )
28
+ def test_svn_not_installed (self , get_PATH ):
29
+ get_PATH .return_value = "" # so svn can't be found
30
+ self .segment .start ()
31
+ self .segment .add_to_powerline ()
32
+ self .assertEqual (self .powerline .append .call_count , 0 )
You can’t perform that action at this time.
0 commit comments