Exemplo n.º 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')
Exemplo n.º 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")
Exemplo n.º 3
0
 def test_str_false(self):
     """Test value 'false'."""
     assert not should_use_docker('False')
     assert not should_use_docker('false')
Exemplo n.º 4
0
 def test_str_true(self):
     """Test value 'false'."""
     assert should_use_docker('True')
     assert should_use_docker('true')
Exemplo n.º 5
0
 def test_bool_false(self):
     """Test value bool(True)."""
     assert not should_use_docker(False)
Exemplo n.º 6
0
 def test_bool_true(self):
     """Test value bool(True)."""
     assert should_use_docker(True)
Exemplo n.º 7
0
 def test_str_false(self) -> None:
     """Test value 'false'."""
     assert not should_use_docker("False")
     assert not should_use_docker("false")
Exemplo n.º 8
0
 def test_str_true(self) -> None:
     """Test value 'false'."""
     assert should_use_docker("True")
     assert should_use_docker("true")