Skip to content

Commit 7bb7a98

Browse files
author
Suszyński Krzysztof
committed
Merge branch 'release/v0.8.1'
2 parents 2c1c299 + c4b2360 commit 7bb7a98

File tree

8 files changed

+64
-9
lines changed

8 files changed

+64
-9
lines changed

Diff for: .github/CODEOWNERS

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# See: https://blog.github.com/2017-07-06-introducing-code-owners/
2+
# These owners will be the default owners for everything in the repo.
3+
* @coi-gov-pl/puppet-team

Diff for: MANIFEST.in

+1
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ recursive-include integration_tests */Dockerfile
1818

1919
# Exclude environment files
2020
prune .circleci
21+
prune .github

Diff for: integration_tests/scripts/install-develop.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ root=$(dirname $(dirname $(dirname ${here})))
55

66
set -x
77

8-
pip install -e ${root}
8+
LC_ALL=C pip install -e ${root}

Diff for: integration_tests/test_ubuntu_1604.py

+33
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import re
12
import pytest
23
from os.path import join
34

@@ -10,6 +11,38 @@ def sut():
1011
return join('debian', 'ubuntu-1604')
1112

1213

14+
@pytest.mark.ubuntu1604
15+
def test_puppeter_develop_install_on_ubuntu_1604_with_invalid_locale(phial, capsys, regex):
16+
with capsys.disabled():
17+
acceptance = PuppeterAcceptance(phial)
18+
pattern = re.compile('^puppeter \d+\.\d+\.\d+(?:\.[a-z0-9]+)?$')
19+
20+
phial.exec('echo "export LC_ALL=mn-Mong-CN.UTF-8" >> /etc/profile.d/mandarin.sh')
21+
acceptance.install_puppeter()
22+
phial.exec('rm -vf /etc/profile.d/mandarin.sh')
23+
24+
exitcode, output, error = phial.exec('puppeter --version', capture=True)
25+
assert error == ''
26+
regex.pattern(pattern).matches(output)
27+
assert exitcode == 0
28+
29+
30+
@pytest.mark.ubuntu1604
31+
def test_puppeter_production_install_on_ubuntu_1604_with_invalid_locale(phial, capsys, regex):
32+
with capsys.disabled():
33+
pattern = re.compile('^puppeter \d+\.\d+\.\d+(?:\.[a-z0-9]+)?$')
34+
35+
phial.exec('echo "export LC_ALL=mn-Mong-CN.UTF-8" >> /etc/profile.d/mandarin.sh')
36+
exitcode, output, error = phial.exec('/puppeter-setup.sh')
37+
assert exitcode == 0
38+
phial.exec('rm -vf /etc/profile.d/mandarin.sh')
39+
40+
exitcode, output, error = phial.exec('puppeter --version', capture=True)
41+
assert error == ''
42+
regex.pattern(pattern).matches(output)
43+
assert exitcode == 0
44+
45+
1346
@pytest.mark.ubuntu1604
1447
def test_agent_system_on_ubuntu_1604(phial, capsys, regex):
1548
with capsys.disabled():

Diff for: puppeter/__init__.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from typing import Type
55

66
# The version of the app
7-
__version__ = '0.8.0'
7+
__version__ = '0.8.1'
88
__program__ = 'puppeter'
99

1010

@@ -16,8 +16,3 @@ def get_logger(cls):
1616

1717
def __fullname(cls):
1818
return cls.__module__ + "." + cls.__name__
19-
20-
21-
if __name__ == '__main__':
22-
from puppeter.main import main
23-
main()

Diff for: puppeter/__main__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
from puppeter.main import main
2-
main()
2+
3+
if __name__ == '__main__':
4+
main()

Diff for: setup.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,5 +102,5 @@ elif [ $osfamily == debian ]; then
102102
fi
103103
fi
104104
if [ $MODE == puppeter ]; then
105-
run pip install puppeter
105+
run LC_ALL=C pip install puppeter
106106
fi

Diff for: tests/test__main__.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import re
2+
3+
import pytest
4+
5+
from tests.helpers.commandline import captured_output
6+
7+
8+
def test_usage_printout():
9+
from puppeter import __main__
10+
11+
with pytest.raises(SystemExit) as sysexit:
12+
with captured_output() as (out, err):
13+
__main__.main(['puppeter', '--help'])
14+
15+
stdout = out.getvalue().strip()
16+
stderr = err.getvalue().strip()
17+
assert sysexit.value.code == 0
18+
assert stdout == ''
19+
assert re.compile('Puppeter', re.MULTILINE).search(stderr)
20+
assert re.compile('--answers FILE, -a FILE', re.MULTILINE).search(stderr)
21+
assert re.compile('--execute, -e', re.MULTILINE).search(stderr)

0 commit comments

Comments
 (0)