@@ -36,39 +36,40 @@ def login_and_get_token(self):
36
36
response = self .client .post ('/login' , auth = ('test_user' , 'test_password' ))
37
37
return json .loads (response .data )['access_token' ]
38
38
39
- def test_create_spark_app (self ):
40
- with self .app .app_context ():
41
- # Create Notebook
42
- notebook = NotebookModel (name = 'Test Notebook' , path = '/path/to/notebook' , user_id = 1 )
43
- db .session .add (notebook )
44
- db .session .commit ()
39
+ # def test_create_spark_app(self):
40
+ # with self.app.app_context():
41
+ # # Create Notebook
42
+ # notebook = NotebookModel(name='Test Notebook', path='/path/to/notebook', user_id=1)
43
+ # db.session.add(notebook)
44
+ # db.session.commit()
45
45
46
- # Create Spark App
47
- spark_app_id = 'app_0001'
48
- path = f'/spark-app/app_0001'
46
+ # # Create Spark App
47
+ # spark_app_id = 'app_0001'
48
+ # path = f'/spark-app/app_0001'
49
49
50
- # data = {
51
- # 'notebookPath': notebook.path
52
- # }
50
+ # # data = {
51
+ # # 'notebookPath': notebook.path
52
+ # # }
53
53
54
- # token = self.login_and_get_token()
55
- # headers = {
56
- # 'Authorization': f'Bearer {token}',
57
- # }
54
+ # # token = self.login_and_get_token()
55
+ # # headers = {
56
+ # # 'Authorization': f'Bearer {token}',
57
+ # # }
58
58
59
- response = self .client .post (
60
- path ,
61
- # headers=headers,
62
- # json=json.dumps(data),
63
- )
59
+ # response = self.client.post(
60
+ # path,
61
+ # # headers=headers,
62
+ # # json=json.dumps(data),
63
+ # )
64
64
65
- print (response .data )
66
- # self.assertEqual(response.status_code, 200)
67
- # self.assertEqual(json.loads(response.data)['spark_app_id'], spark_app_id)
68
- # self.assertEqual(json.loads(response.data)['notebook_id'], notebook.id)
69
- # self.assertEqual(json.loads(response.data)['user_id'], notebook.user_id)
65
+ # print(response.data)
66
+ # # self.assertEqual(response.status_code, 200)
67
+ # # self.assertEqual(json.loads(response.data)['spark_app_id'], spark_app_id)
68
+ # # self.assertEqual(json.loads(response.data)['notebook_id'], notebook.id)
69
+ # # self.assertEqual(json.loads(response.data)['user_id'], notebook.user_id)
70
70
71
71
def test_get_spark_app_config_by_notebook_path (self ):
72
72
with self .app .app_context ():
73
+ token = self .login_and_get_token ()
73
74
response = self .client .get ('/spark-app/path_to_notebook/config' )
74
75
print (response .data )
0 commit comments