def test_04_search_repo_in_repos(self):
     # search among puppet-repos by id
     repo = Repo.search(
         self.pulp,
         data={
             "criteria": {
                 "sort": None,
                 "fields": None,
                 "limit": None,
                 "filters": {"$and": [{"id": "SimplePuppetSearchRepoTest"}, {"notes._repo-type": "puppet-repo"}]},
                 "skip": None,
             }
         },
     )
     self.assertIn(Repo({"id": self.repo.id}, ["id"], ["id"]), repo)
 def test_05_search_repo_with_regexp(self):
     # search puppet-repos with .*repo.*
     repo = Repo.search(
         self.pulp,
         data={
             "criteria": {
                 "sort": None,
                 "fields": None,
                 "limit": None,
                 "filters": {"$and": [{"notes._repo-type": "puppet-repo"}, {"id": {"$regex": ".*Repo.*"}}]},
                 "skip": None,
             }
         },
     )
     # asserting to 2 as we have two repos matched the pattern
     self.assertTrue(len(repo) == 2)
 def test_04_search_repo_in_repos(self):
     #search among puppet-repos by id
     repo = Repo.search(self.pulp,
                        data={
                            "criteria": {
                                "sort": None,
                                "fields": None,
                                "limit": None,
                                "filters": {
                                    "$and": [{
                                        "id":
                                        "SimplePuppetSearchRepoTest"
                                    }, {
                                        "notes._repo-type":
                                        "puppet-repo"
                                    }]
                                },
                                "skip": None
                            }
                        })
     self.assertIn(Repo({"id": self.repo.id}, ['id'], ['id']), repo)
 def test_05_search_repo_with_regexp(self):
     #search puppet-repos with .*repo.*
     repo = Repo.search(self.pulp,
                        data={
                            "criteria": {
                                "sort": None,
                                "fields": None,
                                "limit": None,
                                "filters": {
                                    "$and": [{
                                        "notes._repo-type":
                                        "puppet-repo"
                                    }, {
                                        "id": {
                                            "$regex": ".*Repo.*"
                                        }
                                    }]
                                },
                                "skip": None
                            }
                        })
     #asserting to 2 as we have two repos matched the pattern
     self.assertTrue(len(repo) == 2)