def test_chgid_gid_same(self): ''' Tests if the group id is the same as argument ''' mock = MagicMock(return_value={'gid': 10}) with patch.object(groupadd, 'info', mock): self.assertTrue(groupadd.chgid('test', 10))
def test_chgid_gid_same(self): """ Tests if the group id is the same as argument """ mock_pre_gid = MagicMock(return_value=10) with patch.dict(groupadd.__salt__, {"file.group_to_gid": mock_pre_gid}): self.assertTrue(groupadd.chgid("test", 10))
def test_chgid_gid_same(self): """ Tests if the group id is the same as argument """ mock = MagicMock(return_value={"gid": 10}) with patch.object(groupadd, "info", mock): self.assertTrue(groupadd.chgid("test", 10))
def test_chgid_gid_same(self): ''' Tests if the group id is the same as argument ''' mock_pre_gid = MagicMock(return_value=10) with patch.dict(groupadd.__salt__, {'file.group_to_gid': mock_pre_gid}): self.assertTrue(groupadd.chgid('test', 10))
def test_chgid(self): ''' Tests the gid for a named group was changed ''' mock = MagicMock(return_value=None) with patch.dict(groupadd.__salt__, {'cmd.run': mock}): mock = MagicMock(side_effect=[{'gid': 10}, {'gid': 500}]) with patch.object(groupadd, 'info', mock): self.assertTrue(groupadd.chgid('test', 500))
def test_chgid(self): """ Tests the gid for a named group was changed """ mock_pre_gid = MagicMock(return_value=0) mock_cmdrun = MagicMock(return_value=0) with patch.dict(groupadd.__salt__, {"file.group_to_gid": mock_pre_gid}): with patch.dict(groupadd.__salt__, {"cmd.run": mock_cmdrun}): self.assertFalse(groupadd.chgid("test", 500))
def test_chgid(self): """ Tests the gid for a named group was changed """ mock = MagicMock(return_value=None) with patch.dict(groupadd.__salt__, {"cmd.run": mock}): mock = MagicMock(side_effect=[{"gid": 10}, {"gid": 500}]) with patch.object(groupadd, "info", mock): self.assertTrue(groupadd.chgid("test", 500))
def test_chgid(self): ''' Tests the gid for a named group was changed ''' mock_pre_gid = MagicMock(return_value=0) mock_cmdrun = MagicMock(return_value=0) with patch.dict(groupadd.__salt__, {'file.group_to_gid': mock_pre_gid}): with patch.dict(groupadd.__salt__, {'cmd.run': mock_cmdrun}): self.assertFalse(groupadd.chgid('test', 500))