def test_list_aliases(alias): """ aliases.list_aliases """ ret = aliases.list_aliases() assert isinstance(ret, dict) assert alias.name in ret
def test_list_aliases_mult(self): ''' Tests the return of a file containing multiple aliases ''' ret = {'foo': '*****@*****.**', 'hello': '[email protected], [email protected]'} self.assertEqual(aliases.list_aliases(), ret)
def test_list_aliases(self): ''' Tests the return of a file containing one alias ''' with patch('salt.modules.aliases.__parse_aliases', MagicMock(return_value=self.mock_alias)): ret = {'foo': '*****@*****.**'} self.assertEqual(aliases.list_aliases(), ret)
def test_list_aliases_mult(self): ''' Tests the return of a file containing multiple aliases ''' with patch('salt.modules.aliases.__parse_aliases', MagicMock(return_value=self.mock_alias_mult)): ret = {'foo': '*****@*****.**', 'hello': '[email protected], [email protected]'} self.assertEqual(aliases.list_aliases(), ret)
def test_rm_alias(alias): """ aliases.rm_alias """ ret = aliases.rm_alias(alias=alias.name) assert ret is True ret = aliases.list_aliases() assert isinstance(ret, dict) assert ret == {}
def test_list_aliases(self): """ Tests the return of a file containing one alias """ with patch( "salt.modules.aliases.__parse_aliases", MagicMock(return_value=self.mock_alias), ): ret = {"foo": "*****@*****.**"} self.assertEqual(aliases.list_aliases(), ret)
def test_list_aliases_mult(self): """ Tests the return of a file containing multiple aliases """ with patch( "salt.modules.aliases.__parse_aliases", MagicMock(return_value=self.mock_alias_mult), ): ret = { "foo": "*****@*****.**", "hello": "[email protected], [email protected]", } self.assertEqual(aliases.list_aliases(), ret)
def test_list_aliases(self): ''' Tests the return of a file containing one alias ''' ret = {'foo': '*****@*****.**'} self.assertEqual(aliases.list_aliases(), ret)