コード例 #1
0
ファイル: test_base.py プロジェクト: twitty-onica/runway
    def test_parse_user_data_missing_variable(self):
        """Test parse user data missing variable."""
        with self.assertRaises(MissingVariable):
            variables = {
                "name": "tom",
            }

            raw_user_data = "name: ${name}, last: $last and $$"
            blueprint_name = "test"
            parse_user_data(variables, raw_user_data, blueprint_name)
コード例 #2
0
    def test_parse_user_data_missing_variable(self):
        """Test parse user data missing variable."""
        variables = {
            'name': 'tom',
        }

        raw_user_data = 'name: ${name}, last: $last and $$'
        blueprint_name = 'test'
        with self.assertRaises(MissingVariable):
            parse_user_data(variables, raw_user_data, blueprint_name)
コード例 #3
0
ファイル: test_base.py プロジェクト: twitty-onica/runway
    def test_parse_user_data(self):
        """Test parse user data."""
        expected = "name: tom, last: taubkin and $"
        variables = {"name": "tom", "last": "taubkin"}

        raw_user_data = "name: ${name}, last: $last and $$"
        blueprint_name = "test"
        res = parse_user_data(variables, raw_user_data, blueprint_name)
        self.assertEqual(res, expected)
コード例 #4
0
    def test_parse_user_data(self):
        """Test parse user data."""
        expected = 'name: tom, last: taubkin and $'
        variables = {'name': 'tom', 'last': 'taubkin'}

        raw_user_data = 'name: ${name}, last: $last and $$'
        blueprint_name = 'test'
        res = parse_user_data(variables, raw_user_data, blueprint_name)
        self.assertEqual(res, expected)
コード例 #5
0
def test_parse_user_data() -> None:
    """Test parse_user_data."""
    assert (
        parse_user_data(
            {"name": CFNParameter("name", "tom"), "last": "smith"},
            "name: ${name}, last: $last and $$",
            "test",
        )
        == "name: tom, last: smith and $"
    )
コード例 #6
0
ファイル: test_base.py プロジェクト: twitty-onica/runway
 def test_parse_user_data_invalid_placeholder(self):
     """Test parse user data invalid placeholder."""
     with self.assertRaises(InvalidUserdataPlaceholder):
         raw_user_data = "$100"
         blueprint_name = "test"
         parse_user_data({}, raw_user_data, blueprint_name)
コード例 #7
0
def test_parse_user_data_raise_missing_variable() -> None:
    """Test parse_user_data."""
    with pytest.raises(MissingVariable):
        parse_user_data({"name": "tom"}, "name: ${name}, last: $last and $$", "test")
コード例 #8
0
def test_parse_user_data_raise_invalid_placeholder() -> None:
    """Test parse_user_data."""
    with pytest.raises(InvalidUserdataPlaceholder):
        parse_user_data({}, "$100", "test")
コード例 #9
0
 def test_parse_user_data_invalid_placeholder(self):
     """Test parse user data invalid placeholder."""
     raw_user_data = '$100'
     blueprint_name = 'test'
     with self.assertRaises(InvalidUserdataPlaceholder):
         parse_user_data({}, raw_user_data, blueprint_name)