test: update udt meta string test following PYTHON-405

This commit is contained in:
Adam Holmberg
2015-10-15 09:53:53 -05:00
parent 56732e4e81
commit c43f65e1cb

View File

@@ -329,17 +329,17 @@ class UserTypesTest(unittest.TestCase):
def test_as_cql_query(self): def test_as_cql_query(self):
field_types = [IntegerType, AsciiType, TupleType.apply_parameters([IntegerType, AsciiType])] field_types = [IntegerType, AsciiType, TupleType.apply_parameters([IntegerType, AsciiType])]
udt = UserType("ks1", "mytype", ["a", "b", "c"], field_types) udt = UserType("ks1", "mytype", ["a", "b", "c"], field_types)
self.assertEqual("CREATE TYPE ks1.mytype (a varint, b ascii, c frozen<tuple<varint, ascii>>);", udt.as_cql_query(formatted=False)) self.assertEqual("CREATE TYPE ks1.mytype (a varint, b ascii, c frozen<tuple<varint, ascii>>)", udt.as_cql_query(formatted=False))
self.assertEqual("""CREATE TYPE ks1.mytype ( self.assertEqual("""CREATE TYPE ks1.mytype (
a varint, a varint,
b ascii, b ascii,
c frozen<tuple<varint, ascii>> c frozen<tuple<varint, ascii>>
);""", udt.as_cql_query(formatted=True)) );""", udt.export_as_string())
def test_as_cql_query_name_escaping(self): def test_as_cql_query_name_escaping(self):
udt = UserType("MyKeyspace", "MyType", ["AbA", "keyspace"], [AsciiType, AsciiType]) udt = UserType("MyKeyspace", "MyType", ["AbA", "keyspace"], [AsciiType, AsciiType])
self.assertEqual('CREATE TYPE "MyKeyspace"."MyType" ("AbA" ascii, "keyspace" ascii);', udt.as_cql_query(formatted=False)) self.assertEqual('CREATE TYPE "MyKeyspace"."MyType" ("AbA" ascii, "keyspace" ascii)', udt.as_cql_query(formatted=False))
class IndexTest(unittest.TestCase): class IndexTest(unittest.TestCase):