Skip to content

MatchesStructure doesn't work with dicts #530

Open

Description

@jelmer

Migrated from Launchpad: https://bugs.launchpad.net/bugs/972135

Original Reporter: Julian Edwards
Date Created: 2012-04-03 06:17:39.548355+00:00
Status on Launchpad: Triaged
Importance: Wishlist


MatchesStructure is one of my favourite matchers! However, it doesn't work if the matchee is a dict, like this:

    params = {"this": 1, "that": 2, "tother":3}
    user.this = 1
    user.that = 2
    user.tother = 3
    self.assertThat(
        params,
        MatchesStructure.fromExample(
            user, "this", "that", "tother"))

If it detected that "params" was a dict and DTRT, that would be awesome.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions