Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/tests/test_cassandra.py
Show First 20 Lines • Show All 163 Lines • ▼ Show 20 Lines | |||||
def swh_storage_backend_config(cassandra_cluster, keyspace): | def swh_storage_backend_config(cassandra_cluster, keyspace): | ||||
(hosts, port) = cassandra_cluster | (hosts, port) = cassandra_cluster | ||||
storage_config = dict( | storage_config = dict( | ||||
cls="cassandra", | cls="cassandra", | ||||
hosts=hosts, | hosts=hosts, | ||||
port=port, | port=port, | ||||
keyspace=keyspace, | keyspace=keyspace, | ||||
journal_writer={"cls": "memory",}, | journal_writer={"cls": "memory"}, | ||||
objstorage={"cls": "memory", "args": {},}, | objstorage={"cls": "memory"}, | ||||
) | ) | ||||
yield storage_config | yield storage_config | ||||
storage = get_storage(**storage_config) | storage = get_storage(**storage_config) | ||||
for table in TABLES: | for table in TABLES: | ||||
storage._cql_runner._session.execute('TRUNCATE TABLE "%s"' % table) | storage._cql_runner._session.execute('TRUNCATE TABLE "%s"' % table) | ||||
▲ Show 20 Lines • Show All 234 Lines • Show Last 20 Lines |