-
-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathtest_preserve_shebang.py
More file actions
51 lines (31 loc) · 1.02 KB
/
test_preserve_shebang.py
File metadata and controls
51 lines (31 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
from python_minifier import minify
def test_no_preserve_shebang():
source = '''#! hello this is my shebang
a=0'''
minified = '''a=0'''
actual = minify(source, preserve_shebang=False)
assert actual == minified
def test_no_preserve_shebang_bytes():
source = b'''#! hello this is my shebang
a=0'''
minified = '''a=0'''
actual = minify(source, preserve_shebang=False)
assert actual == minified
def test_preserve_shebang():
source = '''#! hello this is my shebang
a=0'''
actual = minify(source, preserve_shebang=True)
assert actual == source
def test_preserve_shebang_bytes():
source = b'''#! hello this is my shebang
a=0'''
actual = minify(source, preserve_shebang=True)
assert actual == source.decode()
def test_no_shebang():
source = '''a=0'''
actual = minify(source, preserve_shebang=True)
assert actual == source
def test_no_shebang_bytes():
source = b'''a=0'''
actual = minify(source, preserve_shebang=True)
assert actual == source.decode()