~ubuntu-branches/ubuntu/trusty/quantum/trusty

« back to all changes in this revision

Viewing changes to quantum/tests/unit/test_db_rpc_base.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Adam Gandelman, Chuck Short
  • Date: 2012-11-23 09:43:14 UTC
  • mfrom: (2.1.16)
  • Revision ID: package-import@ubuntu.com-20121123094314-e1tqsulrwe21b9aq
Tags: 2013.1~g1-0ubuntu1
[ Adam Gandelman ]
* debian/patches/*: Refreshed for opening of Grizzly.

[ Chuck Short ]
* New upstream release.
* debian/rules: FTFBS if there is missing binaries.
* debian/quantum-server.install: Add quantum-debug.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
from quantum.db import dhcp_rpc_base
21
21
 
22
22
 
23
 
class TestDhcpAugmentContext(unittest.TestCase):
24
 
    def test_augment_context(self):
25
 
        context = mock.Mock()
26
 
        context.user = 'quantum'
27
 
        context.tenant = None
28
 
        context.is_admin = True
29
 
 
30
 
        new_context = dhcp_rpc_base.augment_context(context)
31
 
 
32
 
        self.assertEqual(new_context.user_id, context.user)
33
 
        self.assertEqual(new_context.roles, ['admin'])
34
 
 
35
 
 
36
23
class TestDhcpRpcCallackMixin(unittest.TestCase):
 
24
 
37
25
    def setUp(self):
38
 
        self.context_p = mock.patch('quantum.db.dhcp_rpc_base.augment_context')
39
 
        self.context_p.start()
40
 
 
41
26
        self.plugin_p = mock.patch('quantum.manager.QuantumManager.get_plugin')
42
27
        get_plugin = self.plugin_p.start()
43
28
        self.plugin = mock.Mock()
49
34
    def tearDown(self):
50
35
        self.log_p.stop()
51
36
        self.plugin_p.stop()
52
 
        self.context_p.stop()
53
37
 
54
38
    def test_get_active_networks(self):
55
39
        plugin_retval = [dict(id='a'), dict(id='b')]