Logo

DevelopReview Code

Spend time reviewing code generated by AI, not writing it

  Join our Discord 

Trusted by engineers from

placeholderplaceholderplaceholderplaceholderplaceholderplaceholder
Sweep logo

Clean up your tech debt, automatically

Sweep generates repository-level code at your command. Cut down your dev time on mundane tasks, like tests, documentation, and refactoring.

KL

Sweep: Add backend tests

Sweep logo

This PR adds test coverage for the Backend classes in minichain/backend.py. Specifically, it:
  • Creates a test file tests/test_backend.py with test cases for normal usage and edge cases...

Sweep logo
tests/test_backend.py
import pytest
from minichain.backend import Id, Mock, Google, Python, Bash, OpenAI, OpenAIEmbed, HuggingFace, HuggingFaceEmbed, Manifest

def test_id():
    backend = Id()
    assert backend.run("test") == "test"

def test_mock():
    backend = Mock(["mocked_response"])
    assert backend.run("test") == "mocked_response"

# Rest of test cases...

def test_manifest():
    client = Manifest(client=None)  # Mock client
    backend = Manifest(client)
    assert backend.run("test") == "test"  # Mock response

Preview the plan in Slack

Request tests directly in Slack. Review the progress in a thread. Get alerted when a new PR is created.

KL

/sweep Write tests for backend

Sweep logo

I’m going to create a PR with the following:

Add test for backend This PR adds test cases for the Google, Bash, and Python backends in the ‘minichain’ library.

I have the following plan:
  • test/test_backend.py: Create a new file ‘test_backend.py’ in the ‘tests’ directory. Add the following test cases...

Preview the plan in Slack

Request tests directly in Slack. Review the progress in a thread. Get alerted when a new PR is created.

Review for confidence

Review all changes by Sweep, directly in Github. Comment if any changes need to be made. Push the commit if all looks good.

Sweep logo
plugnplai/plugins.py
def deactivate(self, plugin_name: str):
    """
    Deactivates an activate plugin.
    """
    if plugin_name not in self.active_plugins:
        del self.active_plugins[plugin_name]
-       self.prompt = self.fill_prompt(self.template)
-       self.tokens = count_tokens(self.prompt)
+       self.tokens = count_tokens(self.get_prompt())

See example tickets, handled by Sweep

What our users are saying

Holy crap, I'm seriously impressed 🤯. Other than one issue it seems to be word-perfect. Exactly how I'd write it, and it understands all our company-specific concepts. Very impressive! 🙌

JE

✨Wow! Just found sweep.dev from @wwzeng1 @KevinLu45010771 . It wrote these two PRs for edreisMD/plugnplai#91 edreisMD/plugnplai#75  Total lifesaver 🙌. Sweep just saved me 6 hours of work.

Using this, it’s pretty cool. It’s a little bit like having a junior intern, which doesn’t sound like a lot at first, but you can run like 100 junior interns at once and they can cover a lot of ground in parallel.

Sweep logo

Develop at ease, with Sweep