Example #1
0
 def test_after_request_return_response(self):
     bv = BaseView()
     name = 'test_name'
     req = 'test_request'
     actual = bv.after_request(name, req)
     desired = 'test_request'
     self.assertEqual(actual, desired)
Example #2
0
 def test_reset_results(self):
     bv = BaseView()
     bv.results = {'key1': 'value1'}
     bv.reset_results()
     desired = {
         'data': None,
         'status': -1,
         'error': None,
         'traceback': None
     }
     self.assertDictEqual(bv.results, desired)
Example #3
0
 def test_after_request_reset_results(self):
     bv = BaseView()
     name = 'test_name'
     req = 'test_request'
     bv.after_request(name, req)
     desired = {
         'data': None,
         'status': -1,
         'error': None,
         'traceback': None
     }
     self.assertDictEqual(bv.results, desired)
Example #4
0
 def test_add_config(self):
     bv = BaseView()
     bv.add_config()
     desired = {
         'data': None,
         'status': -1,
         'error': None,
         'traceback': None,
         'utahconfig': {
             'release': config.release,
             'mode': config.mode
         }
     }
     self.assertDictEqual(bv.results, desired)
Example #5
0
 def test_reset_status(self):
     bv = BaseView()
     bv.results['status'] = 42
     bv.reset_status()
     self.assertEqual(bv.results['status'], -1)
Example #6
0
def baseview():
    baseview = BaseView()
    yield baseview