def test_create_column_grants(self):
        inmap = self.std_map()
        inmap['schema public'].update({'table t1': {
            'columns': [{'c1': {'type': 'integer', 'privileges': [{'user1': [
            'insert']}]}}, {'c2': {'type': 'text', 'privileges': [{'user1': [
                'insert']}, {'user2': ['insert', 'update']}]}}],
            'owner': self.db.user, 'privileges': [{self.db.user: ['all']},
                                                  {'PUBLIC': ['select']}]}})
        sql = self.to_sql(inmap)
        assert len(sql) == 7
        # sql[0] = CREATE TABLE
        # sql[1] = ALTER TABLE OWNER
        assert sql[2] == "GRANT ALL ON TABLE t1 TO %s" % self.db.user
        assert sql[3] == GRANT_SELECT % 'PUBLIC'
        assert sql[4] == "GRANT INSERT (c1) ON TABLE t1 TO user1"
        assert sql[5] == "GRANT INSERT (c2) ON TABLE t1 TO user1"
        assert sql[6] == "GRANT INSERT (c2), UPDATE (c2) ON TABLE t1 TO user2"
Attempts to extract the length information of a netstring.
dataset/ETHPy150Open perseas/Pyrseas/tests/dbobject/test_privs.py/PrivilegeToSqlTestCase.test_create_column_grants--crossover with--dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/protocols/basic.py/NetstringReceiver._extractLength