Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
olapy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
olapy
Commits
985bf2ad
Commit
985bf2ad
authored
Jul 17, 2017
by
mouadh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parsing queries test
parent
6d7bfd7c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
olapy/test_parsing_queries.py
olapy/test_parsing_queries.py
+35
-0
No files found.
olapy/test_parsing_queries.py
0 → 100644
View file @
985bf2ad
from
__future__
import
absolute_import
,
division
,
print_function
from
olapy.core.mdx.executor.execute
import
MdxEngine
CUBE
=
'sales'
query1
=
"""SELECT
{[Measures].[Amount]} ON COLUMNS
FROM [sales]"""
where1
=
"Where [Time].[Calendar].[Day].[May 12,2010]"
executer
=
MdxEngine
(
CUBE
)
def
test_parsing_query1
():
query_parts
=
executer
.
decorticate_query
(
query1
)
assert
query_parts
[
'all'
]
==
[[
'Measures'
,
'Amount'
]]
assert
query_parts
[
'rows'
]
==
[]
assert
query_parts
[
'where'
]
==
[]
assert
query_parts
[
'columns'
]
==
[[
'Measures'
,
'Amount'
]]
query1_where
=
query1
+
'
\
n
'
+
where1
query_parts
=
executer
.
decorticate_query
(
query1_where
)
assert
query_parts
[
'all'
]
==
[[
'Measures'
,
'Amount'
],
[
'Time'
,
'Calendar'
,
'Day'
,
'May 12,2010'
]]
assert
query_parts
[
'rows'
]
==
[]
assert
query_parts
[
'where'
]
==
[]
assert
query_parts
[
'columns'
]
==
[[
'Measures'
,
'Amount'
]]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment