Commit 6399cff0 authored by Lucas Kanashiro's avatar Lucas Kanashiro

Merge branch 'feature/25-top-level-package' into 'development'

Change module app to finder

See merge request !22
parents d0e387e8 0dc123c8
Pipeline #58430 failed with stages
in 6 minutes and 23 seconds
......@@ -22,6 +22,7 @@ unit-test:
POSTGRES_DB: finder_test
APP_SETTINGS: config.DevelopmentConfig
DATABASE_TEST_URL: postgresql://finder:password@postgres:5432/finder_test
FLASK_APP: manage.py
script:
- pip3 install -r requirements.txt
- python3 manage.py test
......
......@@ -24,7 +24,7 @@ manager.add_command('runserver', server)
seeder = FlaskSeeder()
seeder.init_app(app, db)
from app.controllers import default
from app.controllers import provider
from app.controllers import image
from app.models import Provider, Image
from finder.controllers import default
from finder.controllers import provider
from finder.controllers import image
from finder.models import Provider, Image
import os
import markdown2
from flask import render_template, make_response, request
from app import app
from app.models import Provider
from app.models import Image
from finder import app
from finder.models import Provider
from finder.models import Image
@app.route("/")
......
from app import app
from app import db
from finder import app
from finder import db
from flask import request, jsonify
from app.models import Image, image_schema, images_schema
from finder.models import Image, image_schema, images_schema
# endpoint to create new image
......
from app import app
from app import db
from finder import app
from finder import db
from flask import request, jsonify
from app.models import Provider, provider_schema, providers_schema
from finder.models import Provider, provider_schema, providers_schema
# endpoint to create new provider
......
from app import db
from app import ma
from finder import db
from finder import ma
class Provider(db.Model):
......
from flask_testing import TestCase
from app import app, db
from finder import app, db
class BaseTestCase(TestCase):
......
......@@ -4,7 +4,7 @@ import unittest
from flask import current_app
from flask_testing import TestCase
from app import app
from finder import app
class TestConfig(TestCase):
......
import json
import unittest
from app.tests.base import BaseTestCase
from app.models import Provider, Image
from app import db
from finder.tests.base import BaseTestCase
from finder.models import Provider, Image
from finder import db
class TestImageService(BaseTestCase):
......
import json
import unittest
from app.tests.base import BaseTestCase
from app.models import Provider
from app import db
from finder.tests.base import BaseTestCase
from finder.models import Provider
from finder import db
class TestProviderService(BaseTestCase):
......
from app import app, db
from finder import app, db
from flask.cli import FlaskGroup
import sys
import unittest
......@@ -9,7 +9,7 @@ cli = FlaskGroup(app)
@cli.command()
def test():
"""Runs the tests without code coverage"""
tests = unittest.TestLoader().discover('app/tests', pattern='test*.py')
tests = unittest.TestLoader().discover('finder/tests', pattern='test*.py')
result = unittest.TextTestRunner(verbosity=2).run(tests)
if result.wasSuccessful():
return 0
......
from app import app
from finder import app
if __name__ == "__main__":
app.run()
from app.models import Provider, Image
from app import db
from finder.models import Provider, Image
from finder import db
import json
json_file = open('seed.json')
......
......@@ -5,4 +5,5 @@ POSTGRES_HOST=db
DB_PORT=5432
APP_SETTINGS=config.DevelopmentConfig
DATABASE_URL=postgresql://finder:password@db:5432/finder
DATABASE_TEST_URL=postgresql://finder:password@db:5432/finder_test
\ No newline at end of file
DATABASE_TEST_URL=postgresql://finder:password@db:5432/finder_test
FLASK_APP=manage.py
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment