Commit add0ca8e authored by Syed Bilal Raees's avatar Syed Bilal Raees

changes to test,hello and yaml

parent 1d69031b
Pipeline #2025 passed with stage
in 10 seconds
stages:
- build
- test
test_app:
image: python:3.6
stage: build
stage: test
before_script:
- python3 -V
......@@ -12,9 +12,8 @@ test_app:
- python3 -m venv venv
- python3 -m venv python3-virtualenv
- source python3-virtualenv/bin/activate
- pwd
script:
- pip install Flask
- python hello.py
- python test.py
tags:
- ci
import flask
app = flask.Flask(__name__)
app.config["DEBUG"] = True
#import flask
from flask import Flask, request
#app = flask.Flask(__name__)
#app.config["DEBUG"] = True
app = Flask(__name__)
@app.route('/', methods=['GET'])
def home():
return "<h1>HelloO DevOps people</h1><p>This site is a prototype API for greeting Nisum DevOps!</p>"
app.run(host='myApp.com', port=5000)
#app.run(host='myApp.com', port=5000)
@app.route('/')
def calc():
a = int(request.args.get('a'))
b = int(request.args.get('b'))
return str(sum(a, b))
def sum(a, b):
return a + b
import unittest
from hello import sum
class Test(unittest.TestCase):
def test_sum(self):
value = sum(4, 5)
self.assertEqual(value, 9)
if __name__ == '__main__':
unittest.main()
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