Skip to content

Commit

Permalink
test for stepfunction_cost_updater
Browse files Browse the repository at this point in the history
  • Loading branch information
SooLee committed May 20, 2021
1 parent 3991dd7 commit c62fecd
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/tibanna/unicorn/test_stepfunction_cost_updater.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from tibanna.stepfunction_cost_updater import StepFunctionCostUpdater

def test_StepFunctionCostUpdater():
sf = StepFunctionCostUpdater()
assert sf.sfn_start_lambda == 'Wait'
assert sf.definition['States'] == sf.sfn_state_defs
assert sf.definition['StartAt'] == 'Wait'
assert 'Wait' in sf.sfn_state_defs
assert 'UpdateCostAwsem' in sf.sfn_state_defs
assert 'UpdateCostDone' in sf.sfn_state_defs
assert 'Done' in sf.sfn_state_defs
correct_lambda_name = 'arn:aws:lambda:us-east-1:%s:function:update_cost_awsem' % sf.aws_acc
assert sf.sfn_state_defs['UpdateCostAwsem']['Resource'] == correct_lambda_name
# try changing dev suffix
sf.dev_suffix = 'dev'
correct_lambda_name = 'arn:aws:lambda:us-east-1:%s:function:update_cost_awsem_dev' % sf.aws_acc
assert sf.sfn_state_defs['UpdateCostAwsem']['Resource'] == correct_lambda_name

0 comments on commit c62fecd

Please sign in to comment.