def test_delete_org_error(self, Command): Command.return_value = mock.Mock( stdout=io.BytesIO(b"An error occurred deleting this org"), stderr=io.BytesIO(b""), returncode=1, ) config = ScratchOrgConfig({"username": "******", "created": True}, "test") with self.assertRaises(ScratchOrgException): config.delete_org()
def test_delete_org_error(self, Command): Command.return_value = mock.Mock( stdout=io.BytesIO(b"An error occurred deleting this org"), stderr=io.BytesIO(b""), returncode=1, ) config = ScratchOrgConfig({"username": "******", "created": True}, "test") with self.assertRaises(ScratchOrgException): config.delete_org()
def test_delete_org(self, Command): Command.return_value = mock.Mock( stdout=io.BytesIO(b"info"), stderr=io.BytesIO(b""), returncode=0 ) config = ScratchOrgConfig({"username": "******", "created": True}, "test") config.delete_org() self.assertFalse(config.config["created"]) self.assertIs(config.config["username"], None)
def test_delete_org(self, Command): Command.return_value = mock.Mock( stdout=io.BytesIO(b"info"), stderr=io.BytesIO(b""), returncode=0 ) config = ScratchOrgConfig({"username": "******", "created": True}, "test") config.delete_org() self.assertFalse(config.config["created"]) self.assertIs(config.config["username"], None)
def test_delete_org_error(self, Command): Command.return_value = mock.Mock( stdout=io.BytesIO(b'An error occurred deleting this org'), stderr=io.BytesIO(b''), returncode=1, ) config = ScratchOrgConfig({'username': '******', 'created': True}, 'test') with self.assertRaises(ScratchOrgException): config.delete_org()
def test_delete_org(self, Command): Command.return_value = mock.Mock( stdout=io.BytesIO(b'info'), stderr=io.BytesIO(b''), returncode=0, ) config = ScratchOrgConfig({'username': '******', 'created': True}, 'test') config.delete_org() self.assertFalse(config.config['created']) self.assertIs(config.config['username'], None)
def test_delete_org_not_created(self, Command): config = ScratchOrgConfig({"created": False}, "test") config.delete_org() Command.assert_not_called()
def test_delete_org_not_created(self, Command): config = ScratchOrgConfig({'created': False}, 'test') config.delete_org() Command.assert_not_called()
def test_delete_org_not_created(self, Command): config = ScratchOrgConfig({"created": False}, "test") config.delete_org() Command.assert_not_called()