Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
language: python
python:
- "2.6"
- "2.7"
- "3.3"
- "3.4"
Expand Down
2 changes: 1 addition & 1 deletion aws_lambda/aws_lambda.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ def get_concurrency(cfg):


def read_cfg(path_to_config_file, profile_name):
cfg = read(path_to_config_file, loader=yaml.load)
cfg = read(path_to_config_file, loader=yaml.full_load)
if profile_name is not None:
cfg['profile'] = profile_name
elif 'AWS_PROFILE' in os.environ:
Expand Down
2 changes: 1 addition & 1 deletion tests/dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
bumpversion==0.5.3
pre-commit==0.15.0
pytest
pytest>=3.6
pytest-cov
flake8
4 changes: 2 additions & 2 deletions tests/unit/test_LambdaContext.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
class TestLambdaContext(unittest.TestCase):

def test_get_remaining_time_in_millis(self):
context = LambdaContext('function_name',2000)
context = LambdaContext('function_name', 2000)
time.sleep(.5)
self.assertTrue(context.get_remaining_time_in_millis() < 2000)
self.assertTrue(context.get_remaining_time_in_millis() < 2000000)


if __name__ == '__main__':
Expand Down
36 changes: 36 additions & 0 deletions tests/unit/test_readHelper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import os
import unittest
import yaml
from aws_lambda.helpers import read


class TestReadHelper(unittest.TestCase):

TEST_FILE = 'readTmp.txt'

def setUp(self):
with open(TestReadHelper.TEST_FILE, 'w') as tmp_file:
tmp_file.write('testYaml: testing')

def tearDown(self):
os.remove(TestReadHelper.TEST_FILE)

def test_read_no_loader_non_binary(self):
fileContents = read(TestReadHelper.TEST_FILE)
self.assertEqual(fileContents, 'testYaml: testing')

def test_read_yaml_loader_non_binary(self):
testYaml = read(TestReadHelper.TEST_FILE, loader=yaml.full_load)
self.assertEqual(testYaml['testYaml'], 'testing')

def test_read_no_loader_binary_mode(self):
fileContents = read(TestReadHelper.TEST_FILE, binary_file=True)
self.assertEqual(fileContents, b'testYaml: testing')

def test_read_yaml_loader_binary_mode(self):
testYaml = read(
TestReadHelper.TEST_FILE,
loader=yaml.full_load,
binary_file=True
)
self.assertEqual(testYaml['testYaml'], 'testing')