File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -127,3 +127,7 @@ def init_service(http):
127
127
Use the given http object to build the analytics service object
128
128
"""
129
129
return gapi .build ('analytics' , 'v3' , http = http )
130
+
131
+ def reset_default_token_store ():
132
+ import os
133
+ os .remove (DEFAULT_TOKEN_FILE )
Original file line number Diff line number Diff line change 86
86
Local host redirect if unspecified
87
87
"""
88
88
89
+ def reset_token_store ():
90
+ """
91
+ Deletes the default token store
92
+ """
93
+ auth .reset_default_token_store ()
89
94
90
95
@Substitution (extras = _AUTH_PARAMS )
91
96
@Appender (_GA_READER_DOC )
Original file line number Diff line number Diff line change @@ -13,6 +13,21 @@ class TestGoogle(unittest.TestCase):
13
13
14
14
_multiprocess_can_split_ = True
15
15
16
+ def test_remove_token_store (self ):
17
+ import os
18
+ try :
19
+ import pandas .io .auth as auth
20
+ from pandas .io .ga import reset_token_store
21
+ except ImportError :
22
+ raise nose .SkipTest
23
+
24
+ auth .DEFAULT_TOKEN_FILE = 'test.dat'
25
+ with open (auth .DEFAULT_TOKEN_FILE , 'w' ) as fh :
26
+ fh .write ('test' )
27
+
28
+ reset_token_store ()
29
+ self .assert_ (not os .path .exists (auth .DEFAULT_TOKEN_FILE ))
30
+
16
31
@slow
17
32
@network
18
33
def test_getdata (self ):
You can’t perform that action at this time.
0 commit comments