-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_proyecto.py
39 lines (28 loc) · 899 Bytes
/
test_proyecto.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import unittest2 as unittest
import proyecto
from flask import Flask, current_app, request
from flask.ext import shelve
import flask_login
import flask_testing
import pytest
from jinja2 import Environment, PackageLoader
# from test import test_support
app = Flask(__name__)
class test_proyecto(unittest.TestCase):
def setUp(self):
app.config['TESTING'] = True
app.config['SHELVE_FILENAME'] = 'shelve.db'
shelve.init_app(app)
return app
def test_creacion(self):
with app.app_context():
import shelve
nombre_empresa = 'Empresa Prueba'
calificacion = 9
d = shelve.open('shelve.db')
d[str(nombre_empresa)] = calificacion
self.assertEqual(d[str(nombre_empresa)],calificacion)
def main():
unittest.main()
if __name__ == '__main__':
unittest.main()