Esempio n. 1
0
    def test_casstype_parameterized(self):
        self.assertEqual(LongType.cass_parameterized_type_with(()), 'LongType')
        self.assertEqual(LongType.cass_parameterized_type_with((), full=True), 'org.apache.cassandra.db.marshal.LongType')
        self.assertEqual(SetType.cass_parameterized_type_with([DecimalType], full=True), 'org.apache.cassandra.db.marshal.SetType(org.apache.cassandra.db.marshal.DecimalType)')

        self.assertEqual(LongType.cql_parameterized_type(), 'bigint')

        subtypes = (cassandra.cqltypes.UTF8Type, cassandra.cqltypes.UTF8Type)
        self.assertEqual('map<text, text>',
                         cassandra.cqltypes.MapType.apply_parameters(subtypes).cql_parameterized_type())
Esempio n. 2
0
    def test_casstype_parameterized(self):
        self.assertEqual(LongType.cass_parameterized_type_with(()), 'LongType')
        self.assertEqual(LongType.cass_parameterized_type_with((), full=True), 'org.apache.cassandra.db.marshal.LongType')
        self.assertEqual(SetType.cass_parameterized_type_with([DecimalType], full=True), 'org.apache.cassandra.db.marshal.SetType(org.apache.cassandra.db.marshal.DecimalType)')

        self.assertEqual(LongType.cql_parameterized_type(), 'bigint')

        subtypes = (cassandra.cqltypes.UTF8Type, cassandra.cqltypes.UTF8Type)
        self.assertEqual('map<text, text>',
                         cassandra.cqltypes.MapType.apply_parameters(subtypes).cql_parameterized_type())
Esempio n. 3
0
    def test_cassandratype(self):
        """
        Smoke test cass_parameterized_type_with
        """

        self.assertEqual(LongType.cass_parameterized_type_with(()), "LongType")
        self.assertEqual(
            LongType.cass_parameterized_type_with((), full=True), "org.apache.cassandra.db.marshal.LongType"
        )
        self.assertEqual(
            SetType.cass_parameterized_type_with([DecimalType], full=True),
            "org.apache.cassandra.db.marshal.SetType(org.apache.cassandra.db.marshal.DecimalType)",
        )

        self.assertEqual(LongType.cql_parameterized_type(), "bigint")
        self.assertEqual(
            cassandra.cqltypes.MapType.apply_parameters(
                cassandra.cqltypes.UTF8Type, cassandra.cqltypes.UTF8Type
            ).cql_parameterized_type(),
            "map<text, text>",
        )