Exemplo n.º 1
0
def remove(uri):
    ''' remove collection by URI
    ''' 
    manager = CollectionManager(uri)
    params = manager.parse_uri(uri)
    if params['collection'] in manager.collections():
        manager.remove(params['collection'])
Exemplo n.º 2
0
    def test_sqlite_manager(self):

        URI = 'sqlite://tests/db/testdb.sqlite'
        collection_name = 'kvlite_test'

        manager = CollectionManager(URI)

        if collection_name in manager.collections():
            manager.remove(collection_name)

        self.assertNotIn(collection_name, manager.collections())

        manager.create(collection_name)
        self.assertIn(collection_name, manager.collections())

        manager.remove(collection_name)
        self.assertNotIn(collection_name, manager.collections())
Exemplo n.º 3
0
    def test_sqlite_manager(self):
        
        URI = 'sqlite://tests/db/testdb.sqlite'
        collection_name = 'kvlite_test'
        
        manager = CollectionManager(URI)

        if collection_name in manager.collections():
            manager.remove(collection_name)
            
        self.assertNotIn(collection_name, manager.collections())

        manager.create(collection_name)
        self.assertIn(collection_name, manager.collections())

        manager.remove(collection_name)
        self.assertNotIn(collection_name, manager.collections())
Exemplo n.º 4
0
    def test_mysql_manager(self):

        URI = 'mysql://*****:*****@localhost/kvlite_test'
        collection_name = 'kvlite_test'

        manager = CollectionManager(URI)

        if collection_name in manager.collections():
            manager.remove(collection_name)

        self.assertNotIn(collection_name, manager.collections())

        manager.create(collection_name)
        self.assertIn(collection_name, manager.collections())

        manager.remove(collection_name)
        self.assertNotIn(collection_name, manager.collections())
Exemplo n.º 5
0
    def test_mysql_manager(self):
        
        URI = 'mysql://*****:*****@localhost/kvlite_test'
        collection_name = 'kvlite_test'
        
        manager = CollectionManager(URI)

        if collection_name in manager.collections():
            manager.remove(collection_name)
            
        self.assertNotIn(collection_name, manager.collections())

        manager.create(collection_name)
        self.assertIn(collection_name, manager.collections())

        manager.remove(collection_name)
        self.assertNotIn(collection_name, manager.collections())