Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds test for surface.get_offset() #1859

Merged
merged 2 commits into from May 26, 2020
Merged

Adds test for surface.get_offset() #1859

merged 2 commits into from May 26, 2020

Conversation

NachiketUN
Copy link
Contributor

@NachiketUN NachiketUN commented May 25, 2020

#1807
I have added a test for surface.get_offset() only. But since I used 'black' to reformat the code, it shows multiple additions and deletions.

@illume
Copy link
Member

illume commented May 26, 2020

Hi,

thanks for your contribution.

Oh, it looks like some other people haven't been running the code formatter.
Sorry about that.

Here's the test amongst the formatting changes:

    def test_get_offset(self):
        """get_offset returns the (0,0) if surface is not a child
                      returns the position of child subsurface inside of parent
        """
        surf = pygame.Surface((100, 100))
        self.assertEqual(surf.get_offset(), (0, 0))
        # subsurface offset test
        subsurf = surf.subsurface(1, 1, 10, 10)
        self.assertEqual(subsurf.get_offset(), (1, 1))

I had to fix some conflicts with a recently merged commit.

Copy link
Member

@illume illume left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@illume illume merged commit f1b2e28 into pygame:master May 26, 2020
@illume illume added the Surface pygame.Surface label May 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Surface pygame.Surface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants