Skip to content

Instantly share code, notes, and snippets.

View samkit-jain's full-sized avatar
👨‍💻
Honing my craft

Samkit Jain samkit-jain

👨‍💻
Honing my craft
View GitHub Profile

Title

Status (Draft / Under Review / Approved / Deployed)
Targets (Backend / Frontend)
Author(s) Names of the people writing the RFC
Developer(s) Names of the people responsible for the implementation of the RFC
Reviewer(s) Names of the people verifying the RFC
Updated YYYY-MM-DD
name: Override Merge
on:
issue_comment:
types: [created]
jobs:
merge_comment:
# Run only if
# 1. The comment was made on a PR.
@samkit-jain
samkit-jain / buildspec.yml
Created September 15, 2021 16:30
Buildspec with codecov
version: 0.2
env:
variables:
ECR_REGISTRY: 1234567890.dkr.ecr.ap-southeast-1.amazonaws.com
ECR_REPOSITORY: repository
secrets-manager:
DOCKER_HUB_USERNAME: arn:aws:secretsmanager:ap-southeast-1:1234567890:secret:dockerhub:username
DOCKER_HUB_PASSWORD: arn:aws:secretsmanager:ap-southeast-1:123457890:secret:dockerhub:password
version: 0.2
env:
variables:
ECR_REGISTRY: 1234567890.dkr.ecr.ap-southeast-1.amazonaws.com
ECR_REPOSITORY: repository
secrets-manager:
DOCKER_HUB_USERNAME: arn:aws:secretsmanager:ap-southeast-1:1234567890:secret:dockerhub:username
DOCKER_HUB_PASSWORD: arn:aws:secretsmanager:ap-southeast-1:123457890:secret:dockerhub:password
def test_sign_up_01(client):
# Sign up a user by testing the ``POST /signup/`` API endpoint.
response = client.post(
"/signup/",
json={"username": "username", "password": "password"},
)
assert response.status_code == 200
assert response.json == {"message": "Registration successful"}
# If you want to go an extra step, can also check if the entry was created
def test_sign_in_01(client):
# Sign in a user by testing the ``POST /signin/`` API endpoint.
# Uisng the same user as created in the ``test_sign_up_01()`` test.
response = client.post(
"/signin/",
json={"username": "username", "password": "password"},
)
assert response.status_code == 200
assert response.json == {"message": "Logged in"}
@samkit-jain
samkit-jain / conftest.py
Last active September 15, 2021 12:43
Juvoxa Testing
import pytest
def pytest_sessionstart(session):
"""This is run before the tests are run.
So, if you want to make any changes like creating a dummy ``.env`` file,
you can do so here.
"""
pass
# initializing variables
transactions = [] # list to store single row entries
d_i = index of date column # from BANK_DETAILS
p_i = index of particular column # from BANK_DETAILS
# iterate over all transactions
for v_t in valid_transactions:
# date exists in the row
if v_t[d_i] is not None:
transactions.append(v_t)
# reading table using tabula
rows = tabula.read_pdf(filepath,
pages='all',
silent=True,
pandas_options={
'header': None,
'error_bad_lines': False,
'warn_bad_lines': False
})
# converting to list
#!/usr/bin/env bash
set -xe
# build binary
GOARCH=amd64 GOOS=linux go build -o bin/application application.go
# create zip containing the bin, assets and .ebextensions folder
zip -r uploadThis.zip bin public .ebextensions