def __init__(self, row, cols=None):
        self.custom = {}

        if not cols:
            # If columns not specified, then column order doesn't matter.
            cols = row.keys()
        for col in cols:
            ss_col = gdata_lib.PrepColNameForSS(col)
            val = row[col]
            ss_val = gdata_lib.PrepValForSS(val)
            self.custom[ss_col] = SSEntry(ss_val)
Exemplo n.º 2
0
    def testPrepValForSS(self):
        tests = {
            None: None,
            '': '',
            'foo': 'foo',
            'foo123': 'foo123',
            '123': "'123",
            '1.2': "'1.2",
        }

        for val in tests:
            expected = tests[val]
            self.assertEquals(expected, gdata_lib.PrepValForSS(val))