Skip to content

Commit

Permalink
stop app running om import
Browse files Browse the repository at this point in the history
  • Loading branch information
bilalshaikh42 committed Aug 20, 2019
1 parent be037b4 commit 3d316b4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
6 changes: 3 additions & 3 deletions datanator_rest_api/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def _default(self):
args.opt_arg_4


class App(cement.App):
class Cli(cement.App):
""" Command line application """
class Meta:
label = 'datanator_rest_api'
Expand All @@ -79,5 +79,5 @@ class Meta:


def main():
with App() as app:
app.run()
with Cli() as cli:
cli.run()
10 changes: 6 additions & 4 deletions datanator_rest_api/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ def get_function_name():
return '{}.{}{}'.format(get_controller_name(), get_path_name(), get_function_name())


app = connexion.App(__name__, specification_dir='spec/')
app.add_api('DatanatorAPI.yaml', resolver=MyResolver(
"datanator_rest_api.server"), validate_responses=False)
app.run(port=8080)
if __name__ == "__main__":

app = connexion.App(__name__, specification_dir='spec/')
app.add_api('DatanatorAPI.yaml', resolver=MyResolver(
"datanator_rest_api.server"), validate_responses=False)
app.run(port=8080)
2 changes: 1 addition & 1 deletion tests/test_api.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import unittest
from swagger_tester import swagger_test


class ApiTestCase(unittest.TestCase):

def test_1(self):
swagger_test('./spec/DatanatorAPI.yaml')
self.assertTrue(True) # example assertion

0 comments on commit 3d316b4

Please sign in to comment.