File tree Expand file tree Collapse file tree 1 file changed +69
-0
lines changed Expand file tree Collapse file tree 1 file changed +69
-0
lines changed Original file line number Diff line number Diff line change
1
+ import textwrap
2
+
3
+ from test_utils import get_rendered_file
4
+
5
+
6
+ def test_pipfile ():
7
+ context = {
8
+ 'dependencies' : [
9
+ 'dependency' ,
10
+ 'dependency=1.0' ,
11
+ 'dependency==1.0' ,
12
+ 'dependency>1.0' ,
13
+ 'dependency>=1.0' ,
14
+ 'dependency<1.0' ,
15
+ 'dependency<=1.0' ,
16
+ 'dependency~1.0' ,
17
+ 'dependency~=1.0'
18
+ ],
19
+ 'dev_dependencies' : [
20
+ 'dev_dependency' ,
21
+ 'dev_dependency=1.0' ,
22
+ 'dev_dependency==1.0' ,
23
+ 'dev_dependency>1.0' ,
24
+ 'dev_dependency>=1.0' ,
25
+ 'dev_dependency<1.0' ,
26
+ 'dev_dependency<=1.0' ,
27
+ 'dev_dependency~1.0' ,
28
+ 'dev_dependency~=1.0'
29
+ ]
30
+ }
31
+ filename = 'Pipfile.jj2'
32
+ rendered = get_rendered_file (filename , context )
33
+ expected_pipfile = textwrap .dedent ("""\
34
+ [[source]]
35
+ url = 'https://pypi.python.org/simple'
36
+ verify_ssl = true
37
+ name = 'pypi'
38
+
39
+ [requires]
40
+ python_version= '3.6'
41
+
42
+ [packages]
43
+ dependency = "*"
44
+ dependency = '=1.0'
45
+ dependency = '==1.0'
46
+ dependency = '>1.0'
47
+ dependency = '>=1.0'
48
+ dependency = '<1.0'
49
+ dependency = '<=1.0'
50
+ dependency = '~1.0'
51
+ dependency = '~=1.0'
52
+
53
+ [dev-packages]
54
+ nose = "*"
55
+ mock = "*"
56
+ codecov = "*"
57
+ coverage = "*"
58
+ flake8 = "*"
59
+ dev_dependency = "*"
60
+ dev_dependency = '=1.0'
61
+ dev_dependency = '==1.0'
62
+ dev_dependency = '>1.0'
63
+ dev_dependency = '>=1.0'
64
+ dev_dependency = '<1.0'
65
+ dev_dependency = '<=1.0'
66
+ dev_dependency = '~1.0'
67
+ dev_dependency = '~=1.0'
68
+ """ )
69
+ assert expected_pipfile == rendered
You can’t perform that action at this time.
0 commit comments