def test_chuid_same_uid(mock_info_ret): """ Tests if the user's uid is the same as as the argument """ with patch("salt.modules.mac_user.info", MagicMock(return_value=mock_info_ret)): assert mac_user.chuid("foo", 4376)
def test_chuid_same_uid(self): ''' Tests if the user's uid is the same as as the argument ''' with patch('salt.modules.mac_user.info', MagicMock(return_value=self.mock_info_ret)): self.assertTrue(mac_user.chuid('foo', 4376))
def test_chuid_same_uid(self): ''' Tests if the user's uid is the same as as the argument ''' self.assertTrue(mac_user.chuid('foo', 4376))
def test_chuid_user_exists(self): ''' Tests if the user exists or not ''' with self.assertRaises(CommandExecutionError): mac_user.chuid('foo', 4376)
def test_chuid_int(self): ''' Tests if the uid is an int ''' with self.assertRaises(SaltInvocationError): mac_user.chuid('foo', 'foo')