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()
Ejemplo n.º 2
0
    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()
Ejemplo n.º 3
0
    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)
Ejemplo n.º 5
0
    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()
Ejemplo n.º 6
0
    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)
Ejemplo n.º 7
0
 def test_delete_org_not_created(self, Command):
     config = ScratchOrgConfig({"created": False}, "test")
     config.delete_org()
     Command.assert_not_called()
Ejemplo n.º 8
0
 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()