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
<!DOCTYPE html> | |
<!-- This is a basic example of a Django parent template. --> | |
<!-- It adds a favicon to the page. --> | |
<!-- The title is set by overriding the "title" block. --> | |
<!-- Body content is added by overriding the "content" block. --> | |
<!-- Tweak this parent template to meet your project's needs. --> | |
{% load static %} |
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
<!DOCTYPE html> | |
<!-- The link tag within the head section adds the favicon to the page. --> | |
<!-- Presume that the favicon is a static file accessible at the images/favicon path. --> | |
<!-- Remember to "load static", too! --> | |
{% load static %} | |
<html lang="en"> | |
<head> |
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
# Id: OCST-1.1.1 | |
# Status: Confirmed | |
# Service: AWS EC2 | |
# Components: | |
# - User Data | |
# STRIDE: | |
# - Elevation of privilege | |
# - Information disclosure | |
# References: | |
# - https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html |
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 pytest | |
from com.automationpanda.example.calc_class import Calculator | |
# "Constants" | |
NUMBER_1 = 3.0 | |
NUMBER_2 = 2.0 | |
# Fixtures |
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 com.automationpanda.example.calc_func import * | |
class Calculator(object): | |
def __init__(self): | |
self._last_answer = 0.0 | |
@property | |
def last_answer(self): | |
return self._last_answer |
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.mark.parametrize("a,b,expected", [ | |
(NUMBER_1, NUMBER_2, NUMBER_1), | |
(NUMBER_2, NUMBER_1, NUMBER_1), | |
(NUMBER_1, NUMBER_1, NUMBER_1), | |
]) | |
def test_maximum(a, b, expected): | |
assert maximum(a, b) == expected | |
@pytest.mark.parametrize("a,b,expected", [ |
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
def test_divide_by_zero(): | |
with pytest.raises(ZeroDivisionError) as e: | |
divide(NUMBER_1, 0) | |
assert "division by zero" in str(e.value) |
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 pytest | |
from com.automationpanda.example.calc_func import * | |
NUMBER_1 = 3.0 | |
NUMBER_2 = 2.0 | |
def test_add(): | |
value = add(NUMBER_1, NUMBER_2) | |
assert value == 5.0 |
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
def add(a, b): | |
return a + b | |
def subtract(a, b): | |
return a - b | |
def multiply(a, b): | |
return a * b |
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
# Add pytest options here | |
[pytest] | |