Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pythonApp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Syed Bilal Raees
pythonApp
Commits
add0ca8e
Commit
add0ca8e
authored
May 18, 2022
by
Syed Bilal Raees
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes to test,hello and yaml
parent
1d69031b
Pipeline
#2025
passed with stage
in 10 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
9 deletions
+30
-9
.gitlab-ci.yml
.gitlab-ci.yml
+3
-4
hello.py
hello.py
+16
-5
test.py
test.py
+11
-0
No files found.
.gitlab-ci.yml
View file @
add0ca8e
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
hello.py
View file @
add0ca8e
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
test.py
0 → 100644
View file @
add0ca8e
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
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment