Esempio n. 1
0
 def test_create_app(self):
     """
     Verify cli_etcd_or_default works with cli input.
     """
     store = MagicMock(get=MagicMock(side_effect=etcd.EtcdKeyNotFound))
     app = script.create_app(store)
     self.assertTrue(isinstance(app, falcon.API))
     self.assertEquals(2, len(app._middleware))
Esempio n. 2
0
 def test_create_app(self):
     """
     Verify cli_etcd_or_default works with cli input.
     """
     store = MagicMock(get=MagicMock(side_effect=etcd.EtcdKeyNotFound))
     app = script.create_app(store)
     self.assertTrue(isinstance(app, falcon.API))
     self.assertEquals(2, len(app._middleware))
Esempio n. 3
0
 def test_create_app(self):
     """
     Verify the application is created as expected.
     """
     with mock.patch('cherrypy.engine.publish') as _publish:
         _publish.return_value = [[[], etcd.EtcdKeyNotFound]]
         app = script.create_app(
             'commissaire.authentication.httpbasicauth',
             {'filepath': os.path.realpath('../conf/users.json')})
         self.assertTrue(isinstance(app, falcon.API))
         self.assertEquals(2, len(app._middleware))
Esempio n. 4
0
 def test_create_app(self):
     """
     Verify cli_etcd_or_default works with cli input.
     """
     with mock.patch('cherrypy.engine.publish') as _publish:
         _publish.return_value = [[[], etcd.EtcdKeyNotFound]]
         app = script.create_app(
             'commissaire.authentication.httpbasicauth',
             {'filepath': os.path.realpath('../conf/users.json')})
         self.assertTrue(isinstance(app, falcon.API))
         self.assertEquals(2, len(app._middleware))
Esempio n. 5
0
 def test_create_app(self):
     """
     Verify cli_etcd_or_default works with cli input.
     """
     with mock.patch('cherrypy.engine.publish') as _publish:
         _publish.return_value = [[[], etcd.EtcdKeyNotFound]]
         app = script.create_app(
             None,
             'commissaire.authentication.httpauthbyfile',
             {'filepath': os.path.realpath('../conf/users.json')})
         self.assertTrue(isinstance(app, falcon.API))
         self.assertEquals(2, len(app._middleware))