Skip to content

Commit

Permalink
Fix pylint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanAhlen authored Mar 14, 2024
1 parent 5890959 commit 60d17e6
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions desktop/libs/notebook/src/notebook/api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def test_save_notebook(self):
assert_equal(doc.type, "query-hive")

def test_type_when_saving_an_actual_notebook(self):
notebook_json = """
notebook_json = """
{
"selectedSnippet": "hive",
"showHistory": false,
Expand All @@ -175,24 +175,24 @@ def test_type_when_saving_an_actual_notebook(self):
"snippets": [{"id":"2b7d1f46-17a0-30af-efeb-33d4c29b1055","type":"hive","status":"running","statement_raw":""" \
""""select * from default.web_logs where app = '${app_name}';","variables":""" \
"""[{"name":"app_name","value":"metastore"}],"statement":""" \
""""select * from default.web_logs where app = 'metastore';","properties":{"settings":[],"files":[],"functions":[]},""" \
""""select 1;","properties":{"settings":[],"files":[],"functions":[]},""" \
""""result":{"id":"b424befa-f4f5-8799-a0b4-79753f2552b1","type":"table","handle":{"log_context":null,""" \
""""statements_count":1,"end":{"column":21,"row":0},"statement_id":0,"has_more_statements":false,""" \
""""start":{"column":0,"row":0},"secret":"rVRWw7YPRGqPT7LZ/TeFaA==an","has_result_set":true,""" \
""""statement":"select * from default.web_logs where app = 'metastore';","operation_type":0,""" \
""""modified_row_count":null,"guid":"7xm6+epkRx6dyvYvGNYePA==an"}},"lastExecuted": 1462554843817,"database":"default"}],
""""modified_row_count":null,"guid":"7xm6"}},"lastExecuted": 1462554843817,"database":"default"}],
"uuid": "d9efdee1-ef25-4d43-b8f9-1a170f69a05a"
}
"""

response = self.client.post(reverse('notebook:save_notebook'), {'notebook': notebook_json})
data = json.loads(response.content)
response = self.client.post(reverse('notebook:save_notebook'), {'notebook': notebook_json})
data = json.loads(response.content)

assert_equal(0, data['status'], data)
assert_equal('notebook', data['type'], data)
doc = Document2.objects.get(pk=data['id'])
assert_equal(0, data['status'], data)
assert_equal('notebook', data['type'], data)
doc = Document2.objects.get(pk=data['id'])

assert_equal(doc.type, "notebook")
assert_equal(doc.type, "notebook")

def test_save_notebook_with_connector_off(self):
reset = ENABLE_CONNECTORS.set_for_testing(False)
Expand Down

0 comments on commit 60d17e6

Please sign in to comment.