import sqlite3, unittest
from fablab import database

#Path to the database file, different from the deployment db
DB_PATH = 'db/fablab_test_api.db'
ENGINE = database.Engine()

MACHINE1_ID = 'machine-1'
MACHINE1 = {
    'machineID': 1,
    'machinename': 'Stratasys 380mc',
    'typeID': 1,
    'tutorial': 'www.google.com',
    'createdAt': 1519472221,
    'updatedAt': None,
    'createdBy': 0,
    'updatedBy': None
}

MACHINE2_ID = 'machine-2'
MACHINE2 = {
    'machineID': 2,
    'machinename': 'Formlabs Form 2',
    'typeID': 1,
    'tutorial': 'www.google.com',
    'createdAt': 1519472221,
    'updatedAt': 1519472221,
    'createdBy': 0,
    'updatedBy': 1
}
Exemplo n.º 2
0
'''
Database interface for checking the tables been created correctly.
@authors: PWP-20
Code of Ivan and Mika provided in Programmable Web Project exercise _ University of Oulu
is been utilized. 

'''

import sqlite3, unittest, collections

from fablab import database

#Path to the test database file, It is different from the deployment db
DB_PATH = 'db/fablab_test.db'
ENGINE = database.Engine(DB_PATH)

INITIAL_SIZE_machines = 7
INITIAL_SIZE_users = 10
INITIAL_SIZE_machinetypes = 5
INITIAL_SIZE_messages = 3
INITIAL_SIZE_reservations = 10


class TestCaseCreatedTables(unittest.TestCase):
    '''
    Test cases for the created tables.
    Setup Test class 
    '''
    #INITIATION AND TEARDOWN METHODS
    @classmethod
    def setUpClass(cls):
Exemplo n.º 3
0
import fablab.database as database
engine = database.Engine()
engine.create_tables()
engine.populate_tables()

con = engine.connect()
test = con.get_reservation(1)
print(test)