Skip to content

Commit d4d97fb

Browse files
author
yamaszone
committed
Added example blackbox tests
1 parent 4ca59e1 commit d4d97fb

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

assignments/fixtures/credentials

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ aws_secret_access_key = dxt7e3d3fCSf/NftN8Cys5L4duQ2KPQwN0n+oW
44

55
[profile1]
66
# Comments
7-
aws_access_key_id = testkeyvalue
7+
aws_access_key_id = testvalue
88
# More comments
99
aws_secret_access_key =testsecretvalue

assignments/test_awscreds.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import subprocess
2+
import pexpect
3+
4+
import unittest
5+
6+
def execute(cmd):
7+
output, status = pexpect.run(cmd
8+
, withexitstatus=1
9+
, timeout=600
10+
)
11+
12+
#print(output)
13+
return output
14+
15+
16+
class test_awscreds(unittest.TestCase):
17+
18+
def test_awscreds_returns_access_key_given_profile(self):
19+
self.assertIn('testvalue', execute('./awscreds -field key -profile profile1'))

0 commit comments

Comments
 (0)