Skip to content

Commit

Permalink
Merge pull request #3 from stevemac007/upgrade-deps
Browse files Browse the repository at this point in the history
Upgraded requirements.
  • Loading branch information
stevemac007 committed Nov 9, 2019
2 parents eb3d0e8 + c0e0dba commit f5f459f
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 6 deletions.
14 changes: 8 additions & 6 deletions requirements.txt
@@ -1,6 +1,8 @@
boto3==1.7.13
Jinja2==2.10
jmespath==0.9.3
psutil==5.4.5
PyYAML==5.1
mock==2.0.0
boto3==1.10.14
Jinja2==2.10.3
jmespath==0.9.4
psutil==5.6.5
PyYAML==5.1.2
mock==3.0.5
nose
ec2_metadata==2.0.0
44 changes: 44 additions & 0 deletions tests/test_main.py
@@ -0,0 +1,44 @@
import unittest

import configbutler.main


class TestResolverLookup(unittest.TestCase):

def test_invalid_lookup(self):

result = configbutler.main.lookup_resolver("blart")
self.assertEqual(None, result)

def test_aws_lookup(self):

result = configbutler.main.lookup_resolver("aws")
self.assertEqual("<class 'configbutler.resolvers.AWSResolver'>", str(type(result)))

def test_string_lookup(self):

result = configbutler.main.lookup_resolver("string")
self.assertEqual("<class 'configbutler.resolvers.StringResolver'>", str(type(result)))

def test_math_lookup(self):

result = configbutler.main.lookup_resolver("math")
self.assertEqual("<class 'configbutler.resolvers.MathResolver'>", str(type(result)))


class TestArgsParser(unittest.TestCase):

def test_default(self):
"""
Should fail as the 'entrypoint' is mandatory
:return:
"""
with self.assertRaises(SystemExit):
configbutler.main.parse_args([])

def test_valid_entrypoint(self):
config = configbutler.main.parse_args(["/tmp"])
self.assertEqual(False, config.dry_run)
self.assertEqual("/tmp", config.entrypoint)
self.assertEqual(False, config.show_properties)
self.assertEqual(False, config.install_service)

0 comments on commit f5f459f

Please sign in to comment.