def test_chgid_same_gid(mock_info_ret): """ Tests if the user's gid is the same as as the argument """ with patch("salt.modules.mac_user.info", MagicMock(return_value=mock_info_ret)): assert mac_user.chgid("foo", 4376)
def test_chgid_same_gid(self): ''' Tests if the user's gid 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.chgid('foo', 4376))
def test_chgid_same_gid(self): ''' Tests if the user's gid is the same as as the argument ''' self.assertTrue(mac_user.chgid('foo', 4376))
def test_chgid_user_exists(self): ''' Tests if the user exists or not ''' with self.assertRaises(CommandExecutionError): mac_user.chgid('foo', 4376)
def test_chgid_int(self): ''' Tests if the gid is an int ''' with self.assertRaises(SaltInvocationError): mac_user.chgid('foo', 'foo')