This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import http from 'k6/http'; | |
import { sleep } from 'k6'; | |
export let options = { | |
stages: [ | |
{ duration: '1m', target: 100 }, | |
{ duration: '2m', target: 500 }, | |
{ duration: '2m', target: 1000 }, | |
], | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func NewMockService(logger commons.Logger, session custom_gocql.SessionInterface) Service { | |
return &Service{session: session, logger: logger} | |
} | |
// InitMockFunc it's use for implelementing the interface. | |
// it's just mock, so just put empty function | |
func InitMockFunc() { | |
session.ExecutedQuery = []string{} | |
session.MockQuery = func(stmt string, val ...interface{}) custom_gocql.QueryInterface { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--extra-index-url https://${DEPLOY_TOKEN_USERNAME}:${DEPLOY_TOKEN_PASSWORD}@gitlab.com/api/v4/projects/23550133/packages/pypi/simple | |
hello-package==0.0.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: python:3.8.5 | |
variables: | |
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" | |
cache: | |
paths: | |
- .cache/pip | |
- venv/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pytest==6.2.1 | |
requests==2.25.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!make | |
build: | |
python setup.py sdist bdist_wheel | |
test: | |
pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import setuptools | |
with open("README.md", "r", encoding="utf-8") as fh: | |
long_description = fh.read() | |
setuptools.setup( | |
name="hello-package", | |
version="0.0.2", | |
author="Rizal", | |
author_email="rizalubuntuuser@gmail.com", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from hello import Hello | |
def test_greeting(): | |
hello_obj = Hello() | |
assert hello_obj.greeting("Rizal") == "Hello Rizal!" | |
def test_location(): | |
hello_obj = Hello() | |
status_code, response = hello_obj.get_location() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from .hello import Hello |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
class Hello(object): | |
def greeting(self, name): | |
return "Hello {}!".format(name) | |
def get_location(self): | |
ip_info_url = "https://ipinfo.io/json" | |
r = requests.get(ip_info_url) |
NewerOlder