This repository was archived by the owner on Feb 26, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -90,12 +90,14 @@ def djangofy(project):
90
90
91
91
@cli .command ()
92
92
@click .argument ('project' )
93
- def djstartvueapp (project ):
93
+ @click .pass_context
94
+ def djstartvueapp (ctx , project ):
94
95
"""
95
96
Run click commands on bash.
96
97
"""
97
98
click .echo (click .style ('Creating {project}' .format (project = project ), fg = 'green' ))
98
99
if os .path .isfile ('manage.py' ) and VueJsBuilder .startproject (project ).status :
99
- djangofy ()
100
+ ctx .forward (djangofy )
101
+ ctx .invoke (djangofy , project = project )
100
102
else :
101
103
click .echo (click .style ('Invalid django project directory' , fg = 'red' ))
Original file line number Diff line number Diff line change @@ -119,8 +119,7 @@ def test_djangofy_already_executed(self):
119
119
# Then
120
120
self .assertEqual ('Making Vue.js myapp into django app\n Command already executed\n ' , result .output )
121
121
122
- @patch ('python_vuejs.django.djangofy' )
123
- def test_djstartvueapp_django_ok (self , mock_djangofy ):
122
+ def test_djstartvueapp_django_ok (self ):
124
123
with self .runner .isolated_filesystem ():
125
124
# Given
126
125
open ('manage.py' , 'a' ).close ()
@@ -132,8 +131,7 @@ def test_djstartvueapp_django_ok(self, mock_djangofy):
132
131
result = self .runner .invoke (cli .cli , ['djstartvueapp' , 'myapp' ])
133
132
# Then
134
133
mock_vuejsbuilder .assert_called_once ()
135
- mock_djangofy .assert_called_once ()
136
- self .assertEqual ('Creating myapp\n ' , result .output )
134
+ self .assertEqual ('Creating myapp\n Making Vue.js myapp into django app\n ' , result .output )
137
135
138
136
def test_djstartvueapp_django_ko (self ):
139
137
result = self .runner .invoke (cli .cli , ['djstartvueapp' , 'myapp' ])
You can’t perform that action at this time.
0 commit comments