Skip to content

Commit

Permalink
fix unittest issue
Browse files Browse the repository at this point in the history
  • Loading branch information
vvaezian committed May 13, 2024
1 parent 0ebea1e commit 7c11984
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions tests/initial_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ wget -O metabase.jar -q https://downloads.metabase.com/v$MB_VERSION/metabase.jar
# starting metabase jar locally
java -jar metabase.jar > logs 2>&1 &

# waiting 45 seconds for the initialization to complete
sleep 45
# waiting 60 seconds for the initialization to complete
sleep 60

# checking whether the metabase initialization has completed. If not, wait another 45 seconds
success='False'
Expand Down Expand Up @@ -102,7 +102,7 @@ json='{
"dataset_query":{
"type":"native",
"native":{
"query":"select *\nfrom test_table\nwhere 1 = 1 \n[[ and {{test_filter}} ]]\n",
"query":"select *\nfrom test_table2\nwhere 1 = 1 \n[[ and {{test_filter}} ]]\n",
"template-tags":{
"test_filter":{
"name":"test_filter",
Expand Down
8 changes: 4 additions & 4 deletions tests/test_metabase_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,10 @@ def test_get_card_data(self):
csv_data = 'col1,col2\nrow1 cell1,1\n,2\nrow3 cell1,\n,\nrow5 cell1,5\n'
self.assertEqual(res, csv_data)

# # filtered data
# res = mb.get_card_data(card_id=2, parameters=[{"type":"string/=","value":['row1 cell1', 'row3 cell1'],"target":["dimension",["template-tag","test_filter"]]}])
# filtered_data = [{'col1': 'row1 cell1', 'col2': 1}, {'col1': 'row3 cell1', 'col2': None}]
# self.assertEqual(res, filtered_data)
# filtered data
res = mb.get_card_data(card_id=2, parameters=[{"type":"string/=","value":['row1 cell1', 'row3 cell1'],"target":["dimension",["template-tag","test_filter"]]}])
filtered_data = [{'col1': 'row1 cell1', 'col2': '1'}, {'col1': 'row3 cell1', 'col2': None}]
self.assertEqual(res, filtered_data)



Expand Down

0 comments on commit 7c11984

Please sign in to comment.