Example #1
0
 def test_non_linux(self):
     """Test value 'non-linux' with all possible platforms."""
     non_linux_os = ['aix', 'cygwin', 'darwin', 'win32']
     for non_linux in non_linux_os:
         with patch('runway.cfngin.hooks.aws_lambda.sys') as mock_sys:
             mock_sys.configure_mock(platform=non_linux)
             assert should_use_docker('non-linux')
     with patch('runway.cfngin.hooks.aws_lambda.sys') as mock_sys:
         mock_sys.configure_mock(platform='linux')
         assert not should_use_docker('non-linux')
Example #2
0
 def test_non_linux(self) -> None:
     """Test value 'non-linux' with all possible platforms."""
     non_linux_os = ["aix", "cygwin", "darwin", "win32"]
     for non_linux in non_linux_os:
         with patch("runway.cfngin.hooks.aws_lambda.sys") as mock_sys:
             mock_sys.configure_mock(platform=non_linux)
             assert should_use_docker("non-linux")
     with patch("runway.cfngin.hooks.aws_lambda.sys") as mock_sys:
         mock_sys.configure_mock(platform="linux")
         assert not should_use_docker("non-linux")
Example #3
0
 def test_str_false(self):
     """Test value 'false'."""
     assert not should_use_docker('False')
     assert not should_use_docker('false')
Example #4
0
 def test_str_true(self):
     """Test value 'false'."""
     assert should_use_docker('True')
     assert should_use_docker('true')
Example #5
0
 def test_bool_false(self):
     """Test value bool(True)."""
     assert not should_use_docker(False)
Example #6
0
 def test_bool_true(self):
     """Test value bool(True)."""
     assert should_use_docker(True)
Example #7
0
 def test_str_false(self) -> None:
     """Test value 'false'."""
     assert not should_use_docker("False")
     assert not should_use_docker("false")
Example #8
0
 def test_str_true(self) -> None:
     """Test value 'false'."""
     assert should_use_docker("True")
     assert should_use_docker("true")