source: products/quintagroup.gdocs.spreadsheet/trunk/quintagroup/gdocs/spreadsheet/tests/test_context.txt @ 2757

Last change on this file since 2757 was 2757, checked in by liebster, 14 years ago

Add doctests of context and adapter

File size: 1.3 KB
Line 
1==========================
2A GSpreadsheet content type doctest
3==========================
4
5Import the class.
6
7    >>> from quintagroup.gdocs.spreadsheet.content.gspreadsheet import GSpreadsheet
8
9Create object
10
11    >>> my_context = GSpreadsheet('id')
12
13Testing set attributes of class GSpreadsheet
14
15    >>> my_context.title = u"Some title"
16    >>> my_context.description = u"Some description"
17    >>> my_context.spreadsheet_id = u"Some spreadsheet id"
18    >>> my_context.worksheet_id = u"Some worksheet id"
19    >>> my_context.order_columns = ({'column_key': 'col1', 'column_title': 'Title 1'},)
20
21    >>> my_context.title
22    'Some title'
23    >>> my_context.description
24    'Some description'
25    >>> my_context.spreadsheet_id
26    'Some spreadsheet id'
27    >>> my_context.worksheet_id
28    'Some worksheet id'
29    >>> len(my_context.order_columns)
30    1
31    >>> my_context.order_columns[0]['column_key']
32    'col1'
33    >>> my_context.order_columns[0]['column_title']
34    'Title 1'
35
36Testing all_keys_columns property method of class GSpreadsheet
37
38    >>> my_context.all_keys_columns
39    ['col1', 'col2', 'col3', 'col4', 'col5']
40
41Testing getKeyColumnVocabulary method of class GSpreadsheet
42
43    >>> kcv = my_context.getKeyColumnVocabulary()
44    >>> len(kcv)
45    5
46    >>> kcv[0]
47    'col1'
48    >>> kcv[4]
49    'col5'
50
Note: See TracBrowser for help on using the repository browser.