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'), '')
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)
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)
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"), "")
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") == ""
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)
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)
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
def test_get_target_no_alias(self): ''' Tests return of an alias doesn't exist ''' self.assertEqual(aliases.get_target('pizza'), '')
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)
def test_get_target(self): ''' Tests the target returned by an alias with one target ''' ret = '*****@*****.**' self.assertEqual(aliases.get_target('foo'), ret)
def test_set_target(alias): """ aliases.set_target and aliases.get_target """ ret = aliases.get_target(alias.name) assert ret == alias.target