Exemplo n.º 1
0
    def test_delete_undeclared(self):
        old_klass = nova_limits._limit_class('config_file', 'spam', 'default')

        self.assertEqual(self.fake_db.fake_db, {})
        self.assertEqual(self.fake_db.actions, [
                ('get', 'limit-class:spam'),
                ])
        self.assertEqual(old_klass, 'default')
Exemplo n.º 2
0
    def test_delete(self):
        self.fake_db.fake_db['limit-class:spam'] = 'old_class'
        old_klass = nova_limits._limit_class('config_file', 'spam', 'default')

        self.assertEqual(self.fake_db.fake_db, {})
        self.assertEqual(self.fake_db.actions, [
                ('get', 'limit-class:spam'),
                ('delete', 'limit-class:spam'),
                ])
        self.assertEqual(old_klass, 'old_class')
Exemplo n.º 3
0
    def test_get(self):
        self.fake_db.fake_db['limit-class:spam'] = 'lim_class'
        old_klass = nova_limits._limit_class('config_file', 'spam')

        self.assertEqual(self.fake_db.fake_db, {
                'limit-class:spam': 'lim_class',
                })
        self.assertEqual(self.fake_db.actions, [
                ('get', 'limit-class:spam'),
                ])
        self.assertEqual(old_klass, 'lim_class')