-
Notifications
You must be signed in to change notification settings - Fork 24
/
gdata_tests.py
53 lines (40 loc) · 1.12 KB
/
gdata_tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import unittest
import getpass
import datetime
import mm
import os
from xlrd_helper import XLSReader
no_gdata = True
try:
import gdata
no_gdata = False
except ImportError:
print "no gdata"
path = os.path.dirname(__file__)
now = datetime.datetime.now().replace(microsecond=0)
class TestGdataSuite(unittest.TestCase):
@unittest.skipIf(no_gdata, 'Skipping gdata test (gdata package not installed)')
def test_minimal(self):
my_data = [
{
'msg': "My first Cell",
'id': 1,
'when': now,
},
{
'msg': "My second Cell",
'id': 2,
'when': now,
},
]
mm_doc = mm.Document(my_data)
# TODO: store this in a config
username = raw_input("Google Username: ")
password = getpass.getpass("Google password: ")
str = mm_doc.write_gdata(
"Test MarMir File",
username,
password)
# TODO: check if file actually got there or not
if __name__ == "__main__":
unittest.main()