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 calculator import calc, get_values_from_expr | |
def test_calc_add(): | |
result = calc("3 + 2") | |
assert result == 5 | |
def test_calc_add2(): | |
result = calc("300 + 20") | |
assert result == 320 |
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 get_values_from_expr(expression): | |
if "+" in expression: | |
raw_values = expression.split("+") | |
# raw_values is a list of operands like ['120 ',' 20'] with extra spaces | |
values = list(map(str.strip, raw_values)) | |
elif "-" in expression: | |
raw_values = expression.split("-") | |
# raw_values is a list of operands like ['120 ',' 20'] with extra spaces | |
values = list(map(str.strip, raw_values)) | |
elif "*" in expression: |
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 calculator import calc, get_values_from_expr | |
def test_calc_add(): | |
result = calc("3 + 2") | |
assert result == 5 | |
def test_calc_add2(): | |
result = calc("300 + 20") | |
assert result == 320 |
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 get_values_from_expr(expression): | |
if "+" in expression: | |
raw_values = expression.split("+") | |
print(raw_values) | |
# raw_values is a list of operands like ['120 ',' 20'] with extra spaces | |
values = list(map(str.strip, raw_values)) | |
else: | |
raw_values = expression.split("-") | |
print(raw_values) | |
# raw_values is a list of operands like ['120 ',' 20'] with extra spaces |
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 get_values_from_expr(expression): | |
if "+" in expression: | |
raw_values = expression.split("+") | |
print(raw_values) | |
# raw_values is a list of operands like ['120 ',' 20'] with extra spaces | |
values = list(map(str.strip, raw_values)) | |
else: | |
raw_values = expression.split("-") | |
print(raw_values) | |
# raw_values is a list of operands like ['120 ',' 20'] with extra spaces |
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
global: | |
scrape_interval: 15s | |
scrape_configs: | |
- job_name: 'prometheus' | |
scrape_interval: 5s | |
static_configs: | |
- targets: ['localhost:9090'] | |
- job_name: 'cadvisor' | |
scrape_interval: 5s | |
static_configs: |
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
global: | |
scrape_interval: 15s | |
scrape_configs: | |
- job_name: 'prometheus' | |
scrape_interval: 5s | |
static_configs: | |
- targets: ['localhost:9090'] |