Exemple #1
0
    def test_create_record(self):
        model = {
            '$buckets': {
                'stuff': {
                    '$collections': {
                        'good_stuff': {
                            '$records': {
                                'bitcoin': {}
                            }
                        }
                    }
                }
            }
        }

        migrate_model(self.client, model)
        self.client.get_record('bitcoin',
                               bucket='stuff',
                               collection='good_stuff')
Exemple #2
0
 def test_support_permissions(self):
     model = {'$buckets': {'stuff': {'$permissions': {'read': ['bar']}}}}
     migrate_model(self.client, model)
     perms = self.client.get_bucket('stuff')['permissions']
     assert 'bar' in perms['read']
Exemple #3
0
 def test_support_metadata(self):
     model = {'$buckets': {'stuff': {'foo': 'bar'}}}
     migrate_model(self.client, model)
     data = self.client.get_bucket('stuff')['data']
     assert data['foo'] == 'bar'
Exemple #4
0
    def test_create_collection(self):
        model = {'$buckets': {'stuff': {'$collections': {'good_stuff': {}}}}}

        migrate_model(self.client, model)
        self.client.get_collection('good_stuff', bucket='stuff')
Exemple #5
0
    def test_create_bucket(self):
        model = {'$buckets': {'stuff': {}}}

        migrate_model(self.client, model)
        self.client.get_bucket('stuff')