Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-analytics-data-api-client
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
edx-analytics-data-api-client
Commits
a8d4cc07
Commit
a8d4cc07
authored
Jul 28, 2014
by
Clinton Blackburn
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11 from edx/date-format
Added API date format to Client
parents
55b73d84
35ba7aa6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
analyticsclient/client.py
+3
-0
analyticsclient/tests/test_client.py
+4
-0
No files found.
analyticsclient/client.py
View file @
a8d4cc07
...
...
@@ -21,6 +21,9 @@ class Client(object):
way to get access to those classes and their methods.
"""
# Date format to be used when sending and parsing data from the API
DATE_FORMAT
=
'
%
Y-
%
m-
%
d'
def
__init__
(
self
,
base_url
,
auth_token
=
None
,
timeout
=
0.25
):
"""
Initialize the client.
...
...
analyticsclient/tests/test_client.py
View file @
a8d4cc07
...
...
@@ -22,6 +22,10 @@ class ClientTests(ClientTestCase):
httpretty
.
disable
()
httpretty
.
reset
()
def
test_date_format
(
self
):
self
.
assertEqual
(
Client
.
DATE_FORMAT
,
'
%
Y-
%
m-
%
d'
)
self
.
assertEqual
(
Client
(
''
)
.
DATE_FORMAT
,
'
%
Y-
%
m-
%
d'
)
def
test_has_resource
(
self
):
httpretty
.
register_uri
(
httpretty
.
GET
,
self
.
test_url
,
body
=
''
)
self
.
assertEquals
(
self
.
client
.
has_resource
(
self
.
test_endpoint
),
True
)
...
...
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