Exemple #1
0
 def test_get_target_no_alias(self):
     '''
     Tests return of an alias doesn't exist
     '''
     with patch('salt.modules.aliases.__parse_aliases',
                MagicMock(return_value=self.mock_alias)):
         self.assertEqual(aliases.get_target('pizza'), '')
Exemple #2
0
 def test_get_target_mult(self):
     '''
     Tests the target returned by an alias with multiple targets
     '''
     with patch('salt.modules.aliases.__parse_aliases',
                MagicMock(return_value=self.mock_alias_mult)):
         ret = '[email protected], [email protected]'
         self.assertEqual(aliases.get_target('hello'), ret)
Exemple #3
0
 def test_get_target(self):
     '''
     Tests the target returned by an alias with one target
     '''
     with patch('salt.modules.aliases.__parse_aliases',
                MagicMock(return_value=self.mock_alias)):
         ret = '*****@*****.**'
         self.assertEqual(aliases.get_target('foo'), ret)
Exemple #4
0
 def test_get_target_no_alias(self):
     """
     Tests return of an alias doesn't exist
     """
     with patch(
             "salt.modules.aliases.__parse_aliases",
             MagicMock(return_value=self.mock_alias),
     ):
         self.assertEqual(aliases.get_target("pizza"), "")
Exemple #5
0
def test_get_target_no_alias(mock_alias):
    """
    Tests return of an alias doesn't exist
    """
    with patch(
        "salt.modules.aliases.__parse_aliases",
        MagicMock(return_value=mock_alias),
    ):
        assert aliases.get_target("pizza") == ""
Exemple #6
0
 def test_get_target_mult(self):
     """
     Tests the target returned by an alias with multiple targets
     """
     with patch(
             "salt.modules.aliases.__parse_aliases",
             MagicMock(return_value=self.mock_alias_mult),
     ):
         ret = "[email protected], [email protected]"
         self.assertEqual(aliases.get_target("hello"), ret)
Exemple #7
0
 def test_get_target(self):
     """
     Tests the target returned by an alias with one target
     """
     with patch(
             "salt.modules.aliases.__parse_aliases",
             MagicMock(return_value=self.mock_alias),
     ):
         ret = "*****@*****.**"
         self.assertEqual(aliases.get_target("foo"), ret)
Exemple #8
0
def test_get_target(mock_alias):
    """
    Tests the target returned by an alias with one target
    """
    with patch(
        "salt.modules.aliases.__parse_aliases",
        MagicMock(return_value=mock_alias),
    ):
        ret = "*****@*****.**"
        assert aliases.get_target("foo") == ret
Exemple #9
0
 def test_get_target_no_alias(self):
     '''
     Tests return of an alias doesn't exist
     '''
     self.assertEqual(aliases.get_target('pizza'), '')
Exemple #10
0
 def test_get_target_mult(self):
     '''
     Tests the target returned by an alias with multiple targets
     '''
     ret = '[email protected], [email protected]'
     self.assertEqual(aliases.get_target('hello'), ret)
Exemple #11
0
 def test_get_target(self):
     '''
     Tests the target returned by an alias with one target
     '''
     ret = '*****@*****.**'
     self.assertEqual(aliases.get_target('foo'), ret)
Exemple #12
0
def test_set_target(alias):
    """
    aliases.set_target and aliases.get_target
    """
    ret = aliases.get_target(alias.name)
    assert ret == alias.target
Exemple #13
0
 def test_get_target_no_alias(self):
     '''
     Tests return of an alias doesn't exist
     '''
     self.assertEqual(aliases.get_target('pizza'), '')
Exemple #14
0
 def test_get_target_mult(self):
     '''
     Tests the target returned by an alias with multiple targets
     '''
     ret = '[email protected], [email protected]'
     self.assertEqual(aliases.get_target('hello'), ret)
Exemple #15
0
 def test_get_target(self):
     '''
     Tests the target returned by an alias with one target
     '''
     ret = '*****@*****.**'
     self.assertEqual(aliases.get_target('foo'), ret)